mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Improve interfaces_file documentation (#7611)
Improve interfaces_file documentation.
This commit is contained in:
parent
d05932fb2c
commit
f496256d18
1 changed files with 24 additions and 20 deletions
|
@ -12,14 +12,14 @@ __metaclass__ = type
|
||||||
DOCUMENTATION = '''
|
DOCUMENTATION = '''
|
||||||
---
|
---
|
||||||
module: interfaces_file
|
module: interfaces_file
|
||||||
short_description: Tweak settings in /etc/network/interfaces files
|
short_description: Tweak settings in C(/etc/network/interfaces) files
|
||||||
extends_documentation_fragment:
|
extends_documentation_fragment:
|
||||||
- ansible.builtin.files
|
- ansible.builtin.files
|
||||||
- community.general.attributes
|
- community.general.attributes
|
||||||
description:
|
description:
|
||||||
- Manage (add, remove, change) individual interface options in an interfaces-style file without having
|
- 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.
|
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
|
- Read information about interfaces from interfaces-styled files.
|
||||||
attributes:
|
attributes:
|
||||||
check_mode:
|
check_mode:
|
||||||
support: full
|
support: full
|
||||||
|
@ -29,27 +29,27 @@ options:
|
||||||
dest:
|
dest:
|
||||||
type: path
|
type: path
|
||||||
description:
|
description:
|
||||||
- Path to the interfaces file
|
- Path to the interfaces file.
|
||||||
default: /etc/network/interfaces
|
default: /etc/network/interfaces
|
||||||
iface:
|
iface:
|
||||||
type: str
|
type: str
|
||||||
description:
|
description:
|
||||||
- Name of the interface, required for value changes or option remove
|
- Name of the interface, required for value changes or option remove.
|
||||||
address_family:
|
address_family:
|
||||||
type: str
|
type: str
|
||||||
description:
|
description:
|
||||||
- Address family of the interface, useful if same interface name is used for both inet and inet6
|
- Address family of the interface, useful if same interface name is used for both V(inet) and V(inet6).
|
||||||
option:
|
option:
|
||||||
type: str
|
type: str
|
||||||
description:
|
description:
|
||||||
- Name of the option, required for value changes or option remove
|
- Name of the option, required for value changes or option remove.
|
||||||
value:
|
value:
|
||||||
type: str
|
type: str
|
||||||
description:
|
description:
|
||||||
- If O(option) is not presented for the O(iface) and O(state) is V(present) option will be added.
|
- 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.
|
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
|
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
|
ones or cleaning the whole option set are supported.
|
||||||
backup:
|
backup:
|
||||||
description:
|
description:
|
||||||
- Create a backup file including the timestamp information so you can get
|
- Create a backup file including the timestamp information so you can get
|
||||||
|
@ -64,72 +64,76 @@ options:
|
||||||
choices: [ "present", "absent" ]
|
choices: [ "present", "absent" ]
|
||||||
|
|
||||||
notes:
|
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: []
|
requirements: []
|
||||||
author: "Roman Belyakovsky (@hryamzik)"
|
author: "Roman Belyakovsky (@hryamzik)"
|
||||||
'''
|
'''
|
||||||
|
|
||||||
RETURN = '''
|
RETURN = '''
|
||||||
dest:
|
dest:
|
||||||
description: destination file/path
|
description: Destination file/path.
|
||||||
returned: success
|
returned: success
|
||||||
type: str
|
type: str
|
||||||
sample: "/etc/network/interfaces"
|
sample: "/etc/network/interfaces"
|
||||||
ifaces:
|
ifaces:
|
||||||
description: interfaces dictionary
|
description: Interfaces dictionary.
|
||||||
returned: success
|
returned: success
|
||||||
type: complex
|
type: dict
|
||||||
contains:
|
contains:
|
||||||
ifaces:
|
ifaces:
|
||||||
description: interface dictionary
|
description: Interface dictionary.
|
||||||
returned: success
|
returned: success
|
||||||
type: dict
|
type: dict
|
||||||
contains:
|
contains:
|
||||||
eth0:
|
eth0:
|
||||||
description: Name of the interface
|
description: Name of the interface.
|
||||||
returned: success
|
returned: success
|
||||||
type: dict
|
type: dict
|
||||||
contains:
|
contains:
|
||||||
address_family:
|
address_family:
|
||||||
description: interface address family
|
description: Interface address family.
|
||||||
returned: success
|
returned: success
|
||||||
type: str
|
type: str
|
||||||
sample: "inet"
|
sample: "inet"
|
||||||
method:
|
method:
|
||||||
description: interface method
|
description: Interface method.
|
||||||
returned: success
|
returned: success
|
||||||
type: str
|
type: str
|
||||||
sample: "manual"
|
sample: "manual"
|
||||||
mtu:
|
mtu:
|
||||||
description: other options, all values returned as strings
|
description: Other options, all values returned as strings.
|
||||||
returned: success
|
returned: success
|
||||||
type: str
|
type: str
|
||||||
sample: "1500"
|
sample: "1500"
|
||||||
pre-up:
|
pre-up:
|
||||||
description: list of C(pre-up) scripts
|
description: List of C(pre-up) scripts.
|
||||||
returned: success
|
returned: success
|
||||||
type: list
|
type: list
|
||||||
|
elements: str
|
||||||
sample:
|
sample:
|
||||||
- "route add -net 10.10.10.0/24 gw 10.10.10.1 dev eth1"
|
- "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"
|
- "route add -net 10.10.11.0/24 gw 10.10.11.1 dev eth2"
|
||||||
up:
|
up:
|
||||||
description: list of C(up) scripts
|
description: List of C(up) scripts.
|
||||||
returned: success
|
returned: success
|
||||||
type: list
|
type: list
|
||||||
|
elements: str
|
||||||
sample:
|
sample:
|
||||||
- "route add -net 10.10.10.0/24 gw 10.10.10.1 dev eth1"
|
- "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"
|
- "route add -net 10.10.11.0/24 gw 10.10.11.1 dev eth2"
|
||||||
post-up:
|
post-up:
|
||||||
description: list of C(post-up) scripts
|
description: List of C(post-up) scripts.
|
||||||
returned: success
|
returned: success
|
||||||
type: list
|
type: list
|
||||||
|
elements: str
|
||||||
sample:
|
sample:
|
||||||
- "route add -net 10.10.10.0/24 gw 10.10.10.1 dev eth1"
|
- "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"
|
- "route add -net 10.10.11.0/24 gw 10.10.11.1 dev eth2"
|
||||||
down:
|
down:
|
||||||
description: list of C(down) scripts
|
description: List of C(down) scripts.
|
||||||
returned: success
|
returned: success
|
||||||
type: list
|
type: list
|
||||||
|
elements: str
|
||||||
sample:
|
sample:
|
||||||
- "route del -net 10.10.10.0/24 gw 10.10.10.1 dev eth1"
|
- "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"
|
- "route del -net 10.10.11.0/24 gw 10.10.11.1 dev eth2"
|
||||||
|
|
Loading…
Reference in a new issue