i[b-n]*.py: normalize docs (#9393)

* i[b-n]*.py: normalize docs

* Update plugins/modules/ilo_redfish_command.py

Co-authored-by: Felix Fontein <felix@fontein.de>

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
Alexei Znamensky 2024-12-27 09:52:26 +13:00 committed by GitHub
parent 61b2304f4d
commit 84655b0d0f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
25 changed files with 1036 additions and 1100 deletions

View file

@ -9,16 +9,15 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = '''
---
DOCUMENTATION = r"""
module: interfaces_file
short_description: Tweak settings in C(/etc/network/interfaces) files
extends_documentation_fragment:
- ansible.builtin.files
- community.general.attributes
description:
- Manage (add, remove, change) individual interface options in an interfaces-style file without having
to manage the file as a whole with, say, M(ansible.builtin.template) or M(ansible.builtin.assemble). Interface has to be presented in a file.
- Manage (add, remove, change) individual interface options in an interfaces-style file without having to manage the file
as a whole with, say, M(ansible.builtin.template) or M(ansible.builtin.assemble). Interface has to be presented in a file.
- Read information about interfaces from interfaces-styled files.
attributes:
check_mode:
@ -46,14 +45,14 @@ options:
value:
type: str
description:
- If O(option) is not presented for the O(iface) and O(state) is V(present) option will be added.
If O(option) already exists and is not V(pre-up), V(up), V(post-up) or V(down), it's value will be updated.
V(pre-up), V(up), V(post-up) and V(down) options cannot be updated, only adding new options, removing existing
ones or cleaning the whole option set are supported.
- If O(option) is not presented for the O(iface) and O(state) is V(present) option will be added. If O(option) already
exists and is not V(pre-up), V(up), V(post-up) or V(down), it's value will be updated. V(pre-up), V(up), V(post-up)
and V(down) options cannot be updated, only adding new options, removing existing ones or cleaning the whole option
set are supported.
backup:
description:
- Create a backup file including the timestamp information so you can get
the original file back if you somehow clobbered it incorrectly.
- Create a backup file including the timestamp information so you can get the original file back if you somehow clobbered
it incorrectly.
type: bool
default: false
state:
@ -61,86 +60,85 @@ options:
description:
- If set to V(absent) the option or section will be removed if present instead of created.
default: "present"
choices: [ "present", "absent" ]
choices: ["present", "absent"]
notes:
- If option is defined multiple times last one will be updated but all will be deleted in case of an absent state.
- If option is defined multiple times last one will be updated but all will be deleted in case of an absent state.
requirements: []
author: "Roman Belyakovsky (@hryamzik)"
'''
"""
RETURN = '''
RETURN = r"""
dest:
description: Destination file/path.
returned: success
type: str
sample: "/etc/network/interfaces"
description: Destination file/path.
returned: success
type: str
sample: "/etc/network/interfaces"
ifaces:
description: Interfaces dictionary.
returned: success
type: dict
contains:
ifaces:
description: Interface dictionary.
returned: success
type: dict
contains:
eth0:
description: Name of the interface.
returned: success
type: dict
contains:
address_family:
description: Interface address family.
returned: success
type: str
sample: "inet"
method:
description: Interface method.
returned: success
type: str
sample: "manual"
mtu:
description: Other options, all values returned as strings.
returned: success
type: str
sample: "1500"
pre-up:
description: List of C(pre-up) scripts.
returned: success
type: list
elements: str
sample:
- "route add -net 10.10.10.0/24 gw 10.10.10.1 dev eth1"
- "route add -net 10.10.11.0/24 gw 10.10.11.1 dev eth2"
up:
description: List of C(up) scripts.
returned: success
type: list
elements: str
sample:
- "route add -net 10.10.10.0/24 gw 10.10.10.1 dev eth1"
- "route add -net 10.10.11.0/24 gw 10.10.11.1 dev eth2"
post-up:
description: List of C(post-up) scripts.
returned: success
type: list
elements: str
sample:
- "route add -net 10.10.10.0/24 gw 10.10.10.1 dev eth1"
- "route add -net 10.10.11.0/24 gw 10.10.11.1 dev eth2"
down:
description: List of C(down) scripts.
returned: success
type: list
elements: str
sample:
- "route del -net 10.10.10.0/24 gw 10.10.10.1 dev eth1"
- "route del -net 10.10.11.0/24 gw 10.10.11.1 dev eth2"
...
'''
description: Interfaces dictionary.
returned: success
type: dict
contains:
ifaces:
description: Interface dictionary.
returned: success
type: dict
contains:
eth0:
description: Name of the interface.
returned: success
type: dict
contains:
address_family:
description: Interface address family.
returned: success
type: str
sample: "inet"
method:
description: Interface method.
returned: success
type: str
sample: "manual"
mtu:
description: Other options, all values returned as strings.
returned: success
type: str
sample: "1500"
pre-up:
description: List of C(pre-up) scripts.
returned: success
type: list
elements: str
sample:
- "route add -net 10.10.10.0/24 gw 10.10.10.1 dev eth1"
- "route add -net 10.10.11.0/24 gw 10.10.11.1 dev eth2"
up:
description: List of C(up) scripts.
returned: success
type: list
elements: str
sample:
- "route add -net 10.10.10.0/24 gw 10.10.10.1 dev eth1"
- "route add -net 10.10.11.0/24 gw 10.10.11.1 dev eth2"
post-up:
description: List of C(post-up) scripts.
returned: success
type: list
elements: str
sample:
- "route add -net 10.10.10.0/24 gw 10.10.10.1 dev eth1"
- "route add -net 10.10.11.0/24 gw 10.10.11.1 dev eth2"
down:
description: List of C(down) scripts.
returned: success
type: list
elements: str
sample:
- "route del -net 10.10.10.0/24 gw 10.10.10.1 dev eth1"
- "route del -net 10.10.11.0/24 gw 10.10.11.1 dev eth2"
"""
EXAMPLES = '''
EXAMPLES = r"""
- name: Set eth1 mtu configuration value to 8000
community.general.interfaces_file:
dest: /etc/network/interfaces.d/eth1.cfg
@ -150,7 +148,7 @@ EXAMPLES = '''
backup: true
state: present
register: eth1_cfg
'''
"""
import os
import re