Reformat documentation with 'andebox yaml-doc' (#335)

* Reformat documentation with 'andebox yaml-doc'.

* Revert unwanted changes.
This commit is contained in:
Felix Fontein 2024-12-28 15:34:20 +01:00 committed by GitHub
parent 77de6d90bf
commit 539119c57d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 717 additions and 758 deletions

View file

@ -8,8 +8,7 @@
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = '''
---
DOCUMENTATION = r"""
module: api_modify
author:
- "Felix Fontein (@felixfontein)"
@ -17,17 +16,17 @@ short_description: Modify data at paths with API
version_added: 2.2.0
description:
- Allows to modify information for a path using the API.
- Use the M(community.routeros.api_find_and_modify) module to modify one or multiple entries in a controlled way
depending on some search conditions.
- Use the M(community.routeros.api_find_and_modify) module to modify one or multiple entries in a controlled way depending
on some search conditions.
- To make a backup of a path that can be restored with this module, use the M(community.routeros.api_info) module.
- The module ignores dynamic and builtin entries.
- B(Note) that this module is still heavily in development, and only supports B(some) paths.
If you want to support new paths, or think you found problems with existing paths, please first
L(create an issue in the community.routeros Issue Tracker,https://github.com/ansible-collections/community.routeros/issues/).
- B(Note) that this module is still heavily in development, and only supports B(some) paths. If you want to support new
paths, or think you found problems with existing paths, please first L(create an issue in the community.routeros Issue
Tracker,https://github.com/ansible-collections/community.routeros/issues/).
notes:
- If write-only fields are present in the path, the module is B(not idempotent) in a strict sense,
since it is not able to verify the current value of these fields. The behavior the module should
assume can be controlled with the O(handle_write_only) option.
- If write-only fields are present in the path, the module is B(not idempotent) in a strict sense, since it is not able
to verify the current value of these fields. The behavior the module should assume can be controlled with the O(handle_write_only)
option.
requirements:
- Needs L(ordereddict,https://pypi.org/project/ordereddict) for Python 2.6
extends_documentation_fragment:
@ -47,230 +46,231 @@ options:
path:
description:
- Path to query.
- An example value is V(ip address). This is equivalent to running modification commands in C(/ip address) in the RouterOS CLI.
- An example value is V(ip address). This is equivalent to running modification commands in C(/ip address) in the RouterOS
CLI.
required: true
type: str
choices:
# BEGIN PATH LIST
- caps-man aaa
- caps-man access-list
- caps-man channel
- caps-man configuration
- caps-man datapath
- caps-man manager
- caps-man manager interface
- caps-man provisioning
- caps-man security
- certificate settings
- interface bonding
- interface bridge
- interface bridge mlag
- interface bridge port
- interface bridge port-controller
- interface bridge port-extender
- interface bridge settings
- interface bridge vlan
- interface detect-internet
- interface eoip
- interface ethernet
- interface ethernet poe
- interface ethernet switch
- interface ethernet switch port
- interface gre
- interface gre6
- interface l2tp-client
- interface l2tp-server server
- interface list
- interface list member
- interface ovpn-client
- interface ovpn-server server
- interface ppp-client
- interface pppoe-client
- interface pppoe-server server
- interface pptp-server server
- interface sstp-server server
- interface vlan
- interface vrrp
- interface wifi
- interface wifi aaa
- interface wifi access-list
- interface wifi cap
- interface wifi capsman
- interface wifi channel
- interface wifi configuration
- interface wifi datapath
- interface wifi interworking
- interface wifi provisioning
- interface wifi security
- interface wifi steering
- interface wifiwave2
- interface wifiwave2 aaa
- interface wifiwave2 access-list
- interface wifiwave2 cap
- interface wifiwave2 capsman
- interface wifiwave2 channel
- interface wifiwave2 configuration
- interface wifiwave2 datapath
- interface wifiwave2 interworking
- interface wifiwave2 provisioning
- interface wifiwave2 security
- interface wifiwave2 steering
- interface wireguard
- interface wireguard peers
- interface wireless
- interface wireless align
- interface wireless cap
- interface wireless security-profiles
- interface wireless sniffer
- interface wireless snooper
- iot modbus
- ip accounting
- ip accounting web-access
- ip address
- ip arp
- ip cloud
- ip cloud advanced
- ip dhcp-client
- ip dhcp-client option
- ip dhcp-relay
- ip dhcp-server
- ip dhcp-server config
- ip dhcp-server lease
- ip dhcp-server matcher
- ip dhcp-server network
- ip dhcp-server option
- ip dhcp-server option sets
- ip dns
- ip dns adlist
- ip dns static
- ip firewall address-list
- ip firewall connection tracking
- ip firewall filter
- ip firewall layer7-protocol
- ip firewall mangle
- ip firewall nat
- ip firewall raw
- ip firewall service-port
- ip hotspot service-port
- ip ipsec identity
- ip ipsec peer
- ip ipsec policy
- ip ipsec profile
- ip ipsec proposal
- ip ipsec settings
- ip neighbor discovery-settings
- ip pool
- ip proxy
- ip route
- ip route rule
- ip route vrf
- ip service
- ip settings
- ip smb
- ip socks
- ip ssh
- ip tftp settings
- ip traffic-flow
- ip traffic-flow ipfix
- ip traffic-flow target
- ip upnp
- ip upnp interfaces
- ip vrf
- ipv6 address
- ipv6 dhcp-client
- ipv6 dhcp-server
- ipv6 dhcp-server option
- ipv6 firewall address-list
- ipv6 firewall filter
- ipv6 firewall mangle
- ipv6 firewall nat
- ipv6 firewall raw
- ipv6 nd
- ipv6 nd prefix
- ipv6 nd prefix default
- ipv6 route
- ipv6 settings
- mpls
- mpls interface
- mpls ldp
- mpls ldp accept-filter
- mpls ldp advertise-filter
- mpls ldp interface
- port firmware
- port remote-access
- ppp aaa
- ppp profile
- ppp secret
- queue interface
- queue simple
- queue tree
- queue type
- radius
- radius incoming
- routing bgp aggregate
- routing bgp connection
- routing bgp instance
- routing bgp network
- routing bgp peer
- routing bgp template
- routing filter
- routing filter community-list
- routing filter num-list
- routing filter rule
- routing filter select-rule
- routing id
- routing igmp-proxy
- routing igmp-proxy interface
- routing mme
- routing ospf area
- routing ospf area range
- routing ospf instance
- routing ospf interface-template
- routing ospf static-neighbor
- routing pimsm instance
- routing pimsm interface-template
- routing rip
- routing ripng
- routing rule
- routing table
- snmp
- snmp community
- system clock
- system clock manual
- system health settings
- system identity
- system leds settings
- system logging
- system logging action
- system note
- system ntp client
- system ntp client servers
- system ntp server
- system package update
- system resource irq rps
- system routerboard settings
- system scheduler
- system script
- system upgrade mirror
- system ups
- system watchdog
- tool bandwidth-server
- tool e-mail
- tool graphing
- tool graphing interface
- tool graphing resource
- tool mac-server
- tool mac-server mac-winbox
- tool mac-server ping
- tool netwatch
- tool romon
- tool sms
- tool sniffer
- tool traffic-generator
- user
- user aaa
- user group
- user settings
- caps-man aaa
- caps-man access-list
- caps-man channel
- caps-man configuration
- caps-man datapath
- caps-man manager
- caps-man manager interface
- caps-man provisioning
- caps-man security
- certificate settings
- interface bonding
- interface bridge
- interface bridge mlag
- interface bridge port
- interface bridge port-controller
- interface bridge port-extender
- interface bridge settings
- interface bridge vlan
- interface detect-internet
- interface eoip
- interface ethernet
- interface ethernet poe
- interface ethernet switch
- interface ethernet switch port
- interface gre
- interface gre6
- interface l2tp-client
- interface l2tp-server server
- interface list
- interface list member
- interface ovpn-client
- interface ovpn-server server
- interface ppp-client
- interface pppoe-client
- interface pppoe-server server
- interface pptp-server server
- interface sstp-server server
- interface vlan
- interface vrrp
- interface wifi
- interface wifi aaa
- interface wifi access-list
- interface wifi cap
- interface wifi capsman
- interface wifi channel
- interface wifi configuration
- interface wifi datapath
- interface wifi interworking
- interface wifi provisioning
- interface wifi security
- interface wifi steering
- interface wifiwave2
- interface wifiwave2 aaa
- interface wifiwave2 access-list
- interface wifiwave2 cap
- interface wifiwave2 capsman
- interface wifiwave2 channel
- interface wifiwave2 configuration
- interface wifiwave2 datapath
- interface wifiwave2 interworking
- interface wifiwave2 provisioning
- interface wifiwave2 security
- interface wifiwave2 steering
- interface wireguard
- interface wireguard peers
- interface wireless
- interface wireless align
- interface wireless cap
- interface wireless security-profiles
- interface wireless sniffer
- interface wireless snooper
- iot modbus
- ip accounting
- ip accounting web-access
- ip address
- ip arp
- ip cloud
- ip cloud advanced
- ip dhcp-client
- ip dhcp-client option
- ip dhcp-relay
- ip dhcp-server
- ip dhcp-server config
- ip dhcp-server lease
- ip dhcp-server matcher
- ip dhcp-server network
- ip dhcp-server option
- ip dhcp-server option sets
- ip dns
- ip dns adlist
- ip dns static
- ip firewall address-list
- ip firewall connection tracking
- ip firewall filter
- ip firewall layer7-protocol
- ip firewall mangle
- ip firewall nat
- ip firewall raw
- ip firewall service-port
- ip hotspot service-port
- ip ipsec identity
- ip ipsec peer
- ip ipsec policy
- ip ipsec profile
- ip ipsec proposal
- ip ipsec settings
- ip neighbor discovery-settings
- ip pool
- ip proxy
- ip route
- ip route rule
- ip route vrf
- ip service
- ip settings
- ip smb
- ip socks
- ip ssh
- ip tftp settings
- ip traffic-flow
- ip traffic-flow ipfix
- ip traffic-flow target
- ip upnp
- ip upnp interfaces
- ip vrf
- ipv6 address
- ipv6 dhcp-client
- ipv6 dhcp-server
- ipv6 dhcp-server option
- ipv6 firewall address-list
- ipv6 firewall filter
- ipv6 firewall mangle
- ipv6 firewall nat
- ipv6 firewall raw
- ipv6 nd
- ipv6 nd prefix
- ipv6 nd prefix default
- ipv6 route
- ipv6 settings
- mpls
- mpls interface
- mpls ldp
- mpls ldp accept-filter
- mpls ldp advertise-filter
- mpls ldp interface
- port firmware
- port remote-access
- ppp aaa
- ppp profile
- ppp secret
- queue interface
- queue simple
- queue tree
- queue type
- radius
- radius incoming
- routing bgp aggregate
- routing bgp connection
- routing bgp instance
- routing bgp network
- routing bgp peer
- routing bgp template
- routing filter
- routing filter community-list
- routing filter num-list
- routing filter rule
- routing filter select-rule
- routing id
- routing igmp-proxy
- routing igmp-proxy interface
- routing mme
- routing ospf area
- routing ospf area range
- routing ospf instance
- routing ospf interface-template
- routing ospf static-neighbor
- routing pimsm instance
- routing pimsm interface-template
- routing rip
- routing ripng
- routing rule
- routing table
- snmp
- snmp community
- system clock
- system clock manual
- system health settings
- system identity
- system leds settings
- system logging
- system logging action
- system note
- system ntp client
- system ntp client servers
- system ntp server
- system package update
- system resource irq rps
- system routerboard settings
- system scheduler
- system script
- system upgrade mirror
- system ups
- system watchdog
- tool bandwidth-server
- tool e-mail
- tool graphing
- tool graphing interface
- tool graphing resource
- tool mac-server
- tool mac-server mac-winbox
- tool mac-server ping
- tool netwatch
- tool romon
- tool sms
- tool sniffer
- tool traffic-generator
- user
- user aaa
- user group
- user settings
# END PATH LIST
data:
description:
@ -298,12 +298,12 @@ options:
default: ignore
handle_entries_content:
description:
- For a single entry in O(data), this describes how to handle fields that are not mentioned
in that entry, but appear in the actual config.
- For a single entry in O(data), this describes how to handle fields that are not mentioned in that entry, but appear
in the actual config.
- If V(ignore), they are not modified.
- If V(remove), they are removed. If at least one cannot be removed, the module will fail.
- If V(remove_as_much_as_possible), all that can be removed will be removed. The ones that
cannot be removed will be kept.
- If V(remove_as_much_as_possible), all that can be removed will be removed. The ones that cannot be removed will be
kept.
- Note that V(remove) and V(remove_as_much_as_possible) do not apply to write-only fields.
type: str
choices:
@ -315,8 +315,8 @@ options:
description:
- How to handle values passed in for read-only fields.
- If V(ignore), they are not passed to the API.
- If V(validate), the values are not passed for creation, and for updating they are compared to the value returned for the object.
If they differ, the module fails.
- If V(validate), the values are not passed for creation, and for updating they are compared to the value returned for
the object. If they differ, the module fails.
- If V(error), the module will fail if read-only fields are provided.
type: str
choices:
@ -329,9 +329,8 @@ options:
description:
- How to handle values passed in for write-only fields.
- If V(create_only), they are passed on creation, and ignored for updating.
- If V(always_update), they are always passed to the API. This means that if such a value is present,
the module will always result in C(changed) since there is no way to validate whether the value
actually changed.
- If V(always_update), they are always passed to the API. This means that if such a value is present, the module will
always result in C(changed) since there is no way to validate whether the value actually changed.
- If V(error), the module will fail if write-only fields are provided.
type: str
choices:
@ -343,21 +342,18 @@ options:
restrict:
description:
- Restrict operation to entries matching the following criteria.
- This can be useful together with O(handle_absent_entries=remove) to operate on a subset of
the values.
- For example, for O(path=ip firewall filter), you can set O(restrict[].field=chain) and
O(restrict[].values=input) to restrict operation to the input chain, and ignore the
forward and output chains.
- This can be useful together with O(handle_absent_entries=remove) to operate on a subset of the values.
- For example, for O(path=ip firewall filter), you can set O(restrict[].field=chain) and O(restrict[].values=input)
to restrict operation to the input chain, and ignore the forward and output chains.
version_added: 2.18.0
seealso:
- module: community.routeros.api
- module: community.routeros.api_facts
- module: community.routeros.api_find_and_modify
- module: community.routeros.api_info
'''
"""
EXAMPLES = '''
---
EXAMPLES = r"""
- name: Setup DHCP server networks
# Ensures that we have exactly two DHCP server networks (in the specified order)
community.routeros.api_modify:
@ -411,43 +407,42 @@ EXAMPLES = '''
data:
- action: drop
chain: input
'''
"""
RETURN = '''
---
RETURN = r"""
old_data:
description:
- A list of all elements for the current path before a change was made.
sample:
- '.id': '*1'
actual-interface: bridge
address: "192.168.88.1/24"
comment: defconf
disabled: false
dynamic: false
interface: bridge
invalid: false
network: 192.168.88.0
type: list
elements: dict
returned: always
description:
- A list of all elements for the current path before a change was made.
sample:
- '.id': '*1'
actual-interface: bridge
address: "192.168.88.1/24"
comment: defconf
disabled: false
dynamic: false
interface: bridge
invalid: false
network: 192.168.88.0
type: list
elements: dict
returned: always
new_data:
description:
- A list of all elements for the current path after a change was made.
sample:
- '.id': '*1'
actual-interface: bridge
address: "192.168.1.1/24"
comment: awesome
disabled: false
dynamic: false
interface: bridge
invalid: false
network: 192.168.1.0
type: list
elements: dict
returned: always
'''
description:
- A list of all elements for the current path after a change was made.
sample:
- '.id': '*1'
actual-interface: bridge
address: "192.168.1.1/24"
comment: awesome
disabled: false
dynamic: false
interface: bridge
invalid: false
network: 192.168.1.0
type: list
elements: dict
returned: always
"""
from collections import defaultdict