diff --git a/plugins/modules/memset_dns_reload.py b/plugins/modules/memset_dns_reload.py index 8cff51ade1..100f81fc05 100644 --- a/plugins/modules/memset_dns_reload.py +++ b/plugins/modules/memset_dns_reload.py @@ -8,53 +8,47 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type -DOCUMENTATION = ''' ---- +DOCUMENTATION = r""" module: memset_dns_reload author: "Simon Weald (@glitchcrab)" short_description: Request reload of Memset's DNS infrastructure, notes: - - DNS reload requests are a best-effort service provided by Memset; these generally - happen every 15 minutes by default, however you can request an immediate reload if - later tasks rely on the records being created. An API key generated via the - Memset customer control panel is required with the following minimum scope - - C(dns.reload). If you wish to poll the job status to wait until the reload has - completed, then C(job.status) is also required. + - DNS reload requests are a best-effort service provided by Memset; these generally happen every 15 minutes by default, however you can request + an immediate reload if later tasks rely on the records being created. An API key generated using the Memset customer control panel is required + with the following minimum scope - C(dns.reload). If you wish to poll the job status to wait until the reload has completed, then C(job.status) + is also required. description: - Request a reload of Memset's DNS infrastructure, and optionally poll until it finishes. extends_documentation_fragment: - community.general.attributes attributes: - check_mode: - support: none - diff_mode: - support: none + check_mode: + support: none + diff_mode: + support: none options: - api_key: - required: true - type: str - description: - - The API key obtained from the Memset control panel. - poll: - default: false - type: bool - description: - - Boolean value, if set will poll the reload job's status and return - when the job has completed (unless the 30 second timeout is reached first). - If the timeout is reached then the task will not be marked as failed, but - stderr will indicate that the polling failed. -''' + api_key: + required: true + type: str + description: + - The API key obtained from the Memset control panel. + poll: + default: false + type: bool + description: + - Boolean value, if set will poll the reload job's status and return when the job has completed (unless the 30 second timeout is reached + first). If the timeout is reached then the task will not be marked as failed, but stderr will indicate that the polling failed. +""" -EXAMPLES = ''' +EXAMPLES = r""" - name: Submit DNS reload and poll community.general.memset_dns_reload: api_key: 5eb86c9196ab03919abcf03857163741 poll: true delegate_to: localhost -''' +""" -RETURN = ''' ---- +RETURN = r""" memset_api: description: Raw response from the Memset API. returned: always @@ -85,7 +79,7 @@ memset_api: returned: always type: str sample: "dns" -''' +""" from time import sleep diff --git a/plugins/modules/memset_memstore_info.py b/plugins/modules/memset_memstore_info.py index 5dfd1f956a..e9f2699812 100644 --- a/plugins/modules/memset_memstore_info.py +++ b/plugins/modules/memset_memstore_info.py @@ -8,107 +8,104 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type -DOCUMENTATION = ''' ---- +DOCUMENTATION = r""" module: memset_memstore_info author: "Simon Weald (@glitchcrab)" short_description: Retrieve Memstore product usage information notes: - - An API key generated via the Memset customer control panel is needed with the - following minimum scope - C(memstore.usage). + - An API key generated using the Memset customer control panel is needed with the following minimum scope - C(memstore.usage). description: - - Retrieve Memstore product usage information. + - Retrieve Memstore product usage information. extends_documentation_fragment: - - community.general.attributes - - community.general.attributes.info_module + - community.general.attributes + - community.general.attributes.info_module attributes: - check_mode: - version_added: 3.3.0 - # This was backported to 2.5.4 and 1.3.11 as well, since this was a bugfix + check_mode: + version_added: 3.3.0 + # This was backported to 2.5.4 and 1.3.11 as well, since this was a bugfix options: - api_key: - required: true - type: str - description: - - The API key obtained from the Memset control panel. - name: - required: true - type: str - description: - - The Memstore product name (that is, C(mstestyaa1)). -''' + api_key: + required: true + type: str + description: + - The API key obtained from the Memset control panel. + name: + required: true + type: str + description: + - The Memstore product name (that is, V(mstestyaa1)). +""" -EXAMPLES = ''' +EXAMPLES = r""" - name: Get usage for mstestyaa1 community.general.memset_memstore_info: name: mstestyaa1 api_key: 5eb86c9896ab03919abcf03857163741 delegate_to: localhost -''' +""" -RETURN = ''' ---- +RETURN = r""" memset_api: - description: Info from the Memset API + description: Info from the Memset API. returned: always type: complex contains: cdn_bandwidth: - description: Dictionary of CDN bandwidth facts + description: Dictionary of CDN bandwidth facts. returned: always type: complex contains: bytes_out: - description: Outbound CDN bandwidth for the last 24 hours in bytes + description: Outbound CDN bandwidth for the last 24 hours in bytes. returned: always type: int sample: 1000 requests: - description: Number of requests in the last 24 hours + description: Number of requests in the last 24 hours. returned: always type: int sample: 10 bytes_in: - description: Inbound CDN bandwidth for the last 24 hours in bytes + description: Inbound CDN bandwidth for the last 24 hours in bytes. returned: always type: int sample: 1000 containers: - description: Number of containers + description: Number of containers. returned: always type: int sample: 10 bytes: - description: Space used in bytes + description: Space used in bytes. returned: always type: int sample: 3860997965 objs: - description: Number of objects + description: Number of objects. returned: always type: int sample: 1000 bandwidth: - description: Dictionary of CDN bandwidth facts + description: Dictionary of CDN bandwidth facts. returned: always type: complex contains: bytes_out: - description: Outbound bandwidth for the last 24 hours in bytes + description: Outbound bandwidth for the last 24 hours in bytes. returned: always type: int sample: 1000 requests: - description: Number of requests in the last 24 hours + description: Number of requests in the last 24 hours. returned: always type: int sample: 10 bytes_in: - description: Inbound bandwidth for the last 24 hours in bytes + description: Inbound bandwidth for the last 24 hours in bytes. returned: always type: int sample: 1000 -''' +""" from ansible.module_utils.basic import AnsibleModule from ansible_collections.community.general.plugins.module_utils.memset import memset_api_call diff --git a/plugins/modules/memset_server_info.py b/plugins/modules/memset_server_info.py index 40862ae944..3c0829ce09 100644 --- a/plugins/modules/memset_server_info.py +++ b/plugins/modules/memset_server_info.py @@ -8,48 +8,45 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type -DOCUMENTATION = ''' ---- +DOCUMENTATION = r""" module: memset_server_info author: "Simon Weald (@glitchcrab)" short_description: Retrieve server information notes: - - An API key generated via the Memset customer control panel is needed with the - following minimum scope - C(server.info). + - An API key generated using the Memset customer control panel is needed with the following minimum scope - C(server.info). description: - - Retrieve server information. + - Retrieve server information. extends_documentation_fragment: - - community.general.attributes - - community.general.attributes.info_module + - community.general.attributes + - community.general.attributes.info_module attributes: - check_mode: - version_added: 3.3.0 - # This was backported to 2.5.4 and 1.3.11 as well, since this was a bugfix + check_mode: + version_added: 3.3.0 + # This was backported to 2.5.4 and 1.3.11 as well, since this was a bugfix options: - api_key: - required: true - type: str - description: - - The API key obtained from the Memset control panel. - name: - required: true - type: str - description: - - The server product name (that is, C(testyaa1)). -''' + api_key: + required: true + type: str + description: + - The API key obtained from the Memset control panel. + name: + required: true + type: str + description: + - The server product name (that is, C(testyaa1)). +""" -EXAMPLES = ''' +EXAMPLES = r""" - name: Get details for testyaa1 community.general.memset_server_info: name: testyaa1 api_key: 5eb86c9896ab03919abcf03857163741 delegate_to: localhost -''' +""" -RETURN = ''' ---- +RETURN = r""" memset_api: - description: Info from the Memset API + description: Info from the Memset API. returned: always type: complex contains: @@ -59,7 +56,7 @@ memset_api: type: bool sample: true control_panel: - description: Whether the server has a control panel (i.e. cPanel). + description: Whether the server has a control panel (for example cPanel). returned: always type: str sample: 'cpanel' @@ -103,7 +100,7 @@ memset_api: } } firewall_type: - description: The type of firewall the server has (i.e. self-managed, managed). + description: The type of firewall the server has (for example self-managed, managed). returned: always type: str sample: 'managed' @@ -113,7 +110,7 @@ memset_api: type: str sample: 'testyaa1.miniserver.com' ignore_monitoring_off: - description: When true, Memset won't remind the customer that monitoring is disabled. + description: When true, Memset does not remind the customer that monitoring is disabled. returned: always type: bool sample: true @@ -136,7 +133,7 @@ memset_api: type: bool sample: true monitoring_level: - description: The server's monitoring level (i.e. basic). + description: The server's monitoring level (for example V(basic)). returned: always type: str sample: 'basic' @@ -149,7 +146,7 @@ memset_api: description: The network zone(s) the server is in. returned: always type: list - sample: [ 'reading' ] + sample: ['reading'] nickname: description: Customer-set nickname for the server. returned: always @@ -196,7 +193,7 @@ memset_api: type: str sample: 'GBP' renewal_price_vat: - description: VAT rate for renewal payments + description: VAT rate for renewal payments. returned: always type: str sample: '20' @@ -206,7 +203,7 @@ memset_api: type: str sample: '2013-04-10' status: - description: Current status of the server (i.e. live, onhold). + description: Current status of the server (for example live, onhold). returned: always type: str sample: 'LIVE' @@ -216,7 +213,7 @@ memset_api: type: str sample: 'managed' type: - description: What this server is (i.e. dedicated) + description: What this server is (for example V(dedicated)). returned: always type: str sample: 'miniserver' @@ -233,7 +230,7 @@ memset_api: returned: always type: str sample: 'basic' -''' +""" from ansible.module_utils.basic import AnsibleModule from ansible_collections.community.general.plugins.module_utils.memset import memset_api_call diff --git a/plugins/modules/memset_zone.py b/plugins/modules/memset_zone.py index e405ad3e86..4d8804e3be 100644 --- a/plugins/modules/memset_zone.py +++ b/plugins/modules/memset_zone.py @@ -8,60 +8,55 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type -DOCUMENTATION = ''' ---- +DOCUMENTATION = r""" module: memset_zone author: "Simon Weald (@glitchcrab)" short_description: Creates and deletes Memset DNS zones notes: - - Zones can be thought of as a logical group of domains, all of which share the - same DNS records (i.e. they point to the same IP). An API key generated via the - Memset customer control panel is needed with the following minimum scope - - C(dns.zone_create), C(dns.zone_delete), C(dns.zone_list). + - Zones can be thought of as a logical group of domains, all of which share the same DNS records (in other words they point to the same IP). An API key + generated using the Memset customer control panel is needed with the following minimum scope - C(dns.zone_create), C(dns.zone_delete), C(dns.zone_list). description: - Manage DNS zones in a Memset account. extends_documentation_fragment: - community.general.attributes attributes: - check_mode: - support: full - diff_mode: - support: none + check_mode: + support: full + diff_mode: + support: none options: - state: - required: true - description: - - Indicates desired state of resource. - type: str - choices: [ absent, present ] - api_key: - required: true - description: - - The API key obtained from the Memset control panel. - type: str - name: - required: true - description: - - The zone nickname; usually the same as the main domain. Ensure this - value has at most 250 characters. - type: str - aliases: [ nickname ] - ttl: - description: - - The default TTL for all records created in the zone. This must be a - valid int from U(https://www.memset.com/apidocs/methods_dns.html#dns.zone_create). - type: int - default: 0 - choices: [ 0, 300, 600, 900, 1800, 3600, 7200, 10800, 21600, 43200, 86400 ] - force: - required: false - default: false - type: bool - description: - - Forces deletion of a zone and all zone domains/zone records it contains. -''' + state: + required: true + description: + - Indicates desired state of resource. + type: str + choices: [absent, present] + api_key: + required: true + description: + - The API key obtained from the Memset control panel. + type: str + name: + required: true + description: + - The zone nickname; usually the same as the main domain. Ensure this value has at most 250 characters. + type: str + aliases: [nickname] + ttl: + description: + - The default TTL for all records created in the zone. This must be a valid int from U(https://www.memset.com/apidocs/methods_dns.html#dns.zone_create). + type: int + default: 0 + choices: [0, 300, 600, 900, 1800, 3600, 7200, 10800, 21600, 43200, 86400] + force: + required: false + default: false + type: bool + description: + - Forces deletion of a zone and all zone domains/zone records it contains. +""" -EXAMPLES = ''' +EXAMPLES = r""" # Create the zone 'test' - name: Create zone community.general.memset_zone: @@ -79,40 +74,40 @@ EXAMPLES = ''' api_key: 5eb86c9196ab03919abcf03857163741 force: true delegate_to: localhost -''' +""" -RETURN = ''' +RETURN = r""" memset_api: - description: Zone info from the Memset API + description: Zone info from the Memset API. returned: when state == present type: complex contains: domains: - description: List of domains in this zone + description: List of domains in this zone. returned: always type: list sample: [] id: - description: Zone id + description: Zone id. returned: always type: str sample: "b0bb1ce851aeea6feeb2dc32fe83bf9c" nickname: - description: Zone name + description: Zone name. returned: always type: str sample: "example.com" records: - description: List of DNS records for domains in this zone + description: List of DNS records for domains in this zone. returned: always type: list sample: [] ttl: - description: Default TTL for domains in this zone + description: Default TTL for domains in this zone. returned: always type: int sample: 300 -''' +""" from ansible.module_utils.basic import AnsibleModule from ansible_collections.community.general.plugins.module_utils.memset import check_zone diff --git a/plugins/modules/memset_zone_domain.py b/plugins/modules/memset_zone_domain.py index 7443e6c256..ca4b07aaaf 100644 --- a/plugins/modules/memset_zone_domain.py +++ b/plugins/modules/memset_zone_domain.py @@ -8,53 +8,50 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type -DOCUMENTATION = ''' ---- +DOCUMENTATION = r""" module: memset_zone_domain author: "Simon Weald (@glitchcrab)" short_description: Create and delete domains in Memset DNS zones notes: - - Zone domains can be thought of as a collection of domains, all of which share the - same DNS records (i.e. they point to the same IP). An API key generated via the - Memset customer control panel is needed with the following minimum scope - - C(dns.zone_domain_create), C(dns.zone_domain_delete), C(dns.zone_domain_list). - - Currently this module can only create one domain at a time. Multiple domains should - be created using C(loop). + - Zone domains can be thought of as a collection of domains, all of which share the same DNS records (in other words, they point to the same IP). An API + key generated using the Memset customer control panel is needed with the following minimum scope - C(dns.zone_domain_create), C(dns.zone_domain_delete), + C(dns.zone_domain_list). + - Currently this module can only create one domain at a time. Multiple domains should be created using C(loop). description: - Manage DNS zone domains in a Memset account. extends_documentation_fragment: - community.general.attributes attributes: - check_mode: - support: full - diff_mode: - support: none + check_mode: + support: full + diff_mode: + support: none options: - state: - default: present - description: - - Indicates desired state of resource. - type: str - choices: [ absent, present ] - api_key: - required: true - description: - - The API key obtained from the Memset control panel. - type: str - domain: - required: true - description: - - The zone domain name. Ensure this value has at most 250 characters. - type: str - aliases: ['name'] - zone: - required: true - description: - - The zone to add the domain to (this must already exist). - type: str -''' + state: + default: present + description: + - Indicates desired state of resource. + type: str + choices: [absent, present] + api_key: + required: true + description: + - The API key obtained from the Memset control panel. + type: str + domain: + required: true + description: + - The zone domain name. Ensure this value has at most 250 characters. + type: str + aliases: ['name'] + zone: + required: true + description: + - The zone to add the domain to (this must already exist). + type: str +""" -EXAMPLES = ''' +EXAMPLES = r""" # Create the zone domain 'test.com' - name: Create zone domain community.general.memset_zone_domain: @@ -63,25 +60,25 @@ EXAMPLES = ''' state: present api_key: 5eb86c9196ab03919abcf03857163741 delegate_to: localhost -''' +""" -RETURN = ''' +RETURN = r""" memset_api: - description: Domain info from the Memset API + description: Domain info from the Memset API. returned: when changed or state == present type: complex contains: domain: - description: Domain name + description: Domain name. returned: always type: str sample: "example.com" id: - description: Domain ID + description: Domain ID. returned: always type: str sample: "b0bb1ce851aeea6feeb2dc32fe83bf9c" -''' +""" from ansible.module_utils.basic import AnsibleModule from ansible_collections.community.general.plugins.module_utils.memset import get_zone_id diff --git a/plugins/modules/memset_zone_record.py b/plugins/modules/memset_zone_record.py index 349240b84e..553cd66926 100644 --- a/plugins/modules/memset_zone_record.py +++ b/plugins/modules/memset_zone_record.py @@ -8,83 +8,78 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type -DOCUMENTATION = ''' ---- +DOCUMENTATION = r""" module: memset_zone_record author: "Simon Weald (@glitchcrab)" short_description: Create and delete records in Memset DNS zones notes: - - Zones can be thought of as a logical group of domains, all of which share the - same DNS records (i.e. they point to the same IP). An API key generated via the - Memset customer control panel is needed with the following minimum scope - - C(dns.zone_create), C(dns.zone_delete), C(dns.zone_list). - - Currently this module can only create one DNS record at a time. Multiple records - should be created using C(loop). + - Zones can be thought of as a logical group of domains, all of which share the same DNS records (in other words they point to the same IP). An API key + generated using the Memset customer control panel is needed with the following minimum scope - C(dns.zone_create), C(dns.zone_delete), C(dns.zone_list). + - Currently this module can only create one DNS record at a time. Multiple records should be created using C(loop). description: - Manage DNS records in a Memset account. extends_documentation_fragment: - community.general.attributes attributes: - check_mode: - support: full - diff_mode: - support: none + check_mode: + support: full + diff_mode: + support: none options: - state: - default: present - description: - - Indicates desired state of resource. - type: str - choices: [ absent, present ] - api_key: - required: true - description: - - The API key obtained from the Memset control panel. - type: str - address: - required: true - description: - - The address for this record (can be IP or text string depending on record type). - type: str - aliases: [ ip, data ] - priority: - description: - - C(SRV) and C(TXT) record priority, in the range 0 > 999 (inclusive). - type: int - default: 0 - record: - required: false - description: - - The subdomain to create. - type: str - default: '' - type: - required: true - description: - - The type of DNS record to create. - choices: [ A, AAAA, CNAME, MX, NS, SRV, TXT ] - type: str - relative: - type: bool - default: false - description: - - If set then the current domain is added onto the address field for C(CNAME), C(MX), C(NS) - and C(SRV)record types. - ttl: - description: - - The record's TTL in seconds (will inherit zone's TTL if not explicitly set). This must be a - valid int from U(https://www.memset.com/apidocs/methods_dns.html#dns.zone_record_create). - default: 0 - choices: [ 0, 300, 600, 900, 1800, 3600, 7200, 10800, 21600, 43200, 86400 ] - type: int - zone: - required: true - description: - - The name of the zone to which to add the record to. - type: str -''' + state: + default: present + description: + - Indicates desired state of resource. + type: str + choices: [absent, present] + api_key: + required: true + description: + - The API key obtained from the Memset control panel. + type: str + address: + required: true + description: + - The address for this record (can be IP or text string depending on record type). + type: str + aliases: [ip, data] + priority: + description: + - C(SRV) and C(TXT) record priority, in the range 0 > 999 (inclusive). + type: int + default: 0 + record: + required: false + description: + - The subdomain to create. + type: str + default: '' + type: + required: true + description: + - The type of DNS record to create. + choices: [A, AAAA, CNAME, MX, NS, SRV, TXT] + type: str + relative: + type: bool + default: false + description: + - If set then the current domain is added onto the address field for C(CNAME), C(MX), C(NS) and C(SRV)record types. + ttl: + description: + - The record's TTL in seconds (will inherit zone's TTL if not explicitly set). This must be a valid int from + U(https://www.memset.com/apidocs/methods_dns.html#dns.zone_record_create). + default: 0 + choices: [0, 300, 600, 900, 1800, 3600, 7200, 10800, 21600, 43200, 86400] + type: int + zone: + required: true + description: + - The name of the zone to which to add the record to. + type: str +""" -EXAMPLES = ''' +EXAMPLES = r""" # Create DNS record for www.domain.com - name: Create DNS record community.general.memset_zone_record: @@ -118,11 +113,11 @@ EXAMPLES = ''' address: "{{ item.address }}" delegate_to: localhost with_items: - - { 'zone': 'domain1.com', 'type': 'A', 'record': 'www', 'address': '1.2.3.4' } - - { 'zone': 'domain2.com', 'type': 'A', 'record': 'mail', 'address': '4.3.2.1' } -''' + - {'zone': 'domain1.com', 'type': 'A', 'record': 'www', 'address': '1.2.3.4'} + - {'zone': 'domain2.com', 'type': 'A', 'record': 'mail', 'address': '4.3.2.1'} +""" -RETURN = ''' +RETURN = r""" memset_api: description: Record info from the Memset API. returned: when state == present @@ -168,7 +163,7 @@ memset_api: returned: always type: str sample: "b0bb1ce851aeea6feeb2dc32fe83bf9c" -''' +""" from ansible.module_utils.basic import AnsibleModule from ansible_collections.community.general.plugins.module_utils.memset import get_zone_id diff --git a/plugins/modules/mksysb.py b/plugins/modules/mksysb.py index d1f49ca82e..d3c9abeac0 100644 --- a/plugins/modules/mksysb.py +++ b/plugins/modules/mksysb.py @@ -10,20 +10,19 @@ from __future__ import absolute_import, division, print_function __metaclass__ = type -DOCUMENTATION = """ ---- +DOCUMENTATION = r""" author: Kairo Araujo (@kairoaraujo) module: mksysb short_description: Generates AIX mksysb rootvg backups description: -- This module manages a basic AIX mksysb (image) of rootvg. + - This module manages a basic AIX mksysb (image) of rootvg. seealso: -- name: C(mksysb) command manual page - description: Manual page for the command. - link: https://www.ibm.com/docs/en/aix/7.3?topic=m-mksysb-command + - name: C(mksysb) command manual page + description: Manual page for the command. + link: https://www.ibm.com/docs/en/aix/7.3?topic=m-mksysb-command extends_documentation_fragment: -- community.general.attributes + - community.general.attributes attributes: check_mode: support: full @@ -32,63 +31,62 @@ attributes: options: backup_crypt_files: description: - - Backup encrypted files. + - Backup encrypted files. type: bool default: true backup_dmapi_fs: description: - - Back up DMAPI filesystem files. + - Back up DMAPI filesystem files. type: bool default: true create_map_files: description: - - Creates a new MAP files. + - Creates a new MAP files. type: bool default: false exclude_files: description: - - Excludes files using C(/etc/rootvg.exclude). + - Excludes files using C(/etc/rootvg.exclude). type: bool default: false exclude_wpar_files: description: - - Excludes WPAR files. + - Excludes WPAR files. type: bool default: false extended_attrs: description: - - Backup extended attributes. + - Backup extended attributes. type: bool default: true name: type: str description: - - Backup name + - Backup name. required: true new_image_data: description: - - Creates a new file data. + - Creates a new file data. type: bool default: true software_packing: description: - - Exclude files from packing option listed in C(/etc/exclude_packing.rootvg). + - Exclude files from packing option listed in C(/etc/exclude_packing.rootvg). type: bool default: false storage_path: type: str description: - - Storage path where the mksysb will stored. + - Storage path where the mksysb will stored. required: true use_snapshot: description: - - Creates backup using snapshots. + - Creates backup using snapshots. type: bool default: false """ -EXAMPLES = """ ---- +EXAMPLES = r""" - name: Running a backup image mksysb community.general.mksysb: name: myserver @@ -97,8 +95,7 @@ EXAMPLES = """ exclude_wpar_files: true """ -RETURN = """ ---- +RETURN = r""" changed: description: Return changed for mksysb actions as true or false. returned: always diff --git a/plugins/modules/modprobe.py b/plugins/modules/modprobe.py index 3d6a7c2410..b7b93cce2b 100644 --- a/plugins/modules/modprobe.py +++ b/plugins/modules/modprobe.py @@ -8,59 +8,58 @@ from __future__ import absolute_import, division, print_function __metaclass__ = type -DOCUMENTATION = ''' ---- +DOCUMENTATION = r""" module: modprobe short_description: Load or unload kernel modules author: - - David Stygstra (@stygstra) - - Julien Dauphant (@jdauphant) - - Matt Jeffery (@mattjeffery) + - David Stygstra (@stygstra) + - Julien Dauphant (@jdauphant) + - Matt Jeffery (@mattjeffery) description: - - Load or unload kernel modules. + - Load or unload kernel modules. extends_documentation_fragment: - - community.general.attributes + - community.general.attributes attributes: - check_mode: - support: full - diff_mode: - support: none + check_mode: + support: full + diff_mode: + support: none options: - name: - type: str - required: true - description: - - Name of kernel module to manage. - state: - type: str - description: - - Whether the module should be present or absent. - choices: [ absent, present ] - default: present - params: - type: str - description: - - Modules parameters. - default: '' - persistent: - type: str - choices: [ disabled, absent, present ] - default: disabled - version_added: 7.0.0 - description: - - Persistency between reboots for configured module. - - This option creates files in C(/etc/modules-load.d/) and C(/etc/modprobe.d/) that make your module configuration persistent during reboots. - - If V(present), adds module name to C(/etc/modules-load.d/) and params to C(/etc/modprobe.d/) so the module will be loaded on next reboot. - - If V(absent), will comment out module name from C(/etc/modules-load.d/) and comment out params from C(/etc/modprobe.d/) so the module will not be - loaded on next reboot. - - If V(disabled), will not touch anything and leave C(/etc/modules-load.d/) and C(/etc/modprobe.d/) as it is. - - Note that it is usually a better idea to rely on the automatic module loading by PCI IDs, USB IDs, DMI IDs or similar triggers encoded in the - kernel modules themselves instead of configuration like this. - - In fact, most modern kernel modules are prepared for automatic loading already. - - "B(Note:) This option works only with distributions that use C(systemd) when set to values other than V(disabled)." -''' + name: + type: str + required: true + description: + - Name of kernel module to manage. + state: + type: str + description: + - Whether the module should be present or absent. + choices: [absent, present] + default: present + params: + type: str + description: + - Modules parameters. + default: '' + persistent: + type: str + choices: [disabled, absent, present] + default: disabled + version_added: 7.0.0 + description: + - Persistency between reboots for configured module. + - This option creates files in C(/etc/modules-load.d/) and C(/etc/modprobe.d/) that make your module configuration persistent during reboots. + - If V(present), adds module name to C(/etc/modules-load.d/) and params to C(/etc/modprobe.d/) so the module will be loaded on next reboot. + - If V(absent), will comment out module name from C(/etc/modules-load.d/) and comment out params from C(/etc/modprobe.d/) so the module + will not be loaded on next reboot. + - If V(disabled), will not touch anything and leave C(/etc/modules-load.d/) and C(/etc/modprobe.d/) as it is. + - Note that it is usually a better idea to rely on the automatic module loading by PCI IDs, USB IDs, DMI IDs or similar triggers encoded + in the kernel modules themselves instead of configuration like this. + - In fact, most modern kernel modules are prepared for automatic loading already. + - B(Note:) This option works only with distributions that use C(systemd) when set to values other than V(disabled). +""" -EXAMPLES = ''' +EXAMPLES = r""" - name: Add the 802.1q module community.general.modprobe: name: 8021q @@ -78,7 +77,7 @@ EXAMPLES = ''' state: present params: 'numdummies=2' persistent: present -''' +""" import os.path import platform diff --git a/plugins/modules/monit.py b/plugins/modules/monit.py index 5475ab1e52..f97cd12e64 100644 --- a/plugins/modules/monit.py +++ b/plugins/modules/monit.py @@ -9,14 +9,13 @@ from __future__ import absolute_import, division, print_function __metaclass__ = type -DOCUMENTATION = ''' ---- +DOCUMENTATION = r""" module: monit -short_description: Manage the state of a program monitored via Monit +short_description: Manage the state of a program monitored using Monit description: - - Manage the state of a program monitored via Monit. + - Manage the state of a program monitored using Monit. extends_documentation_fragment: - - community.general.attributes + - community.general.attributes attributes: check_mode: support: full @@ -32,26 +31,25 @@ options: description: - The state of service. required: true - choices: [ "present", "started", "stopped", "restarted", "monitored", "unmonitored", "reloaded" ] + choices: ["present", "started", "stopped", "restarted", "monitored", "unmonitored", "reloaded"] type: str timeout: description: - - If there are pending actions for the service monitored by monit, then Ansible will check - for up to this many seconds to verify the requested action has been performed. - Ansible will sleep for five seconds between each check. + - If there are pending actions for the service monitored by monit, then Ansible will check for up to this many seconds to verify the requested + action has been performed. Ansible will sleep for five seconds between each check. default: 300 type: int author: - - Darryl Stoflet (@dstoflet) - - Simon Kelly (@snopoke) -''' + - Darryl Stoflet (@dstoflet) + - Simon Kelly (@snopoke) +""" -EXAMPLES = ''' +EXAMPLES = r""" - name: Manage the state of program httpd to be in started state community.general.monit: name: httpd state: started -''' +""" import time import re diff --git a/plugins/modules/mqtt.py b/plugins/modules/mqtt.py index f8d64e6a00..462f809ade 100644 --- a/plugins/modules/mqtt.py +++ b/plugins/modules/mqtt.py @@ -9,8 +9,7 @@ from __future__ import absolute_import, division, print_function __metaclass__ = type -DOCUMENTATION = ''' ---- +DOCUMENTATION = r""" module: mqtt short_description: Publish a message on an MQTT topic for the IoT description: @@ -26,12 +25,12 @@ options: server: type: str description: - - MQTT broker address/name + - MQTT broker address/name. default: localhost port: type: int description: - - MQTT broker port number + - MQTT broker port number. default: 1883 username: type: str @@ -44,76 +43,67 @@ options: client_id: type: str description: - - MQTT client identifier + - MQTT client identifier. - If not specified, a value C(hostname + pid) will be used. topic: type: str description: - - MQTT topic name + - MQTT topic name. required: true payload: type: str description: - - Payload. The special string V("None") may be used to send a NULL - (that is, empty) payload which is useful to simply notify with the O(topic) + - Payload. The special string V("None") may be used to send a NULL (that is, empty) payload which is useful to simply notify with the O(topic) or to clear previously retained messages. required: true qos: type: str description: - - QoS (Quality of Service) + - QoS (Quality of Service). default: "0" - choices: [ "0", "1", "2" ] + choices: ["0", "1", "2"] retain: description: - - Setting this flag causes the broker to retain (i.e. keep) the message so that - applications that subsequently subscribe to the topic can received the last - retained message immediately. + - Setting this flag causes the broker to retain (in other words keep) the message so that applications that subsequently subscribe to the topic can + received the last retained message immediately. type: bool default: false ca_cert: type: path description: - - The path to the Certificate Authority certificate files that are to be - treated as trusted by this client. If this is the only option given - then the client will operate in a similar manner to a web browser. That - is to say it will require the broker to have a certificate signed by the - Certificate Authorities in ca_certs and will communicate using TLS v1, - but will not attempt any form of authentication. This provides basic - network encryption but may not be sufficient depending on how the broker - is configured. - aliases: [ ca_certs ] + - The path to the Certificate Authority certificate files that are to be treated as trusted by this client. If this is the only option given + then the client will operate in a similar manner to a web browser. That is to say it will require the broker to have a certificate signed + by the Certificate Authorities in ca_certs and will communicate using TLS v1, but will not attempt any form of authentication. This provides + basic network encryption but may not be sufficient depending on how the broker is configured. + aliases: [ca_certs] client_cert: type: path description: - - The path pointing to the PEM encoded client certificate. If this is not - None it will be used as client information for TLS based - authentication. Support for this feature is broker dependent. - aliases: [ certfile ] + - The path pointing to the PEM encoded client certificate. If this is not None it will be used as client information for TLS based authentication. + Support for this feature is broker dependent. + aliases: [certfile] client_key: type: path description: - - The path pointing to the PEM encoded client private key. If this is not - None it will be used as client information for TLS based - authentication. Support for this feature is broker dependent. - aliases: [ keyfile ] + - The path pointing to the PEM encoded client private key. If this is not None it will be used as client information for TLS based authentication. + Support for this feature is broker dependent. + aliases: [keyfile] tls_version: description: - Specifies the version of the SSL/TLS protocol to be used. - - By default (if the python version supports it) the highest TLS version is - detected. If unavailable, TLS v1 is used. + - By default (if the python version supports it) the highest TLS version is detected. If unavailable, TLS v1 is used. type: str choices: - tlsv1.1 - tlsv1.2 -requirements: [ mosquitto ] +requirements: [mosquitto] notes: - - This module requires a connection to an MQTT broker such as Mosquitto - U(http://mosquitto.org) and the I(Paho) C(mqtt) Python client (U(https://pypi.org/project/paho-mqtt/)). + - This module requires a connection to an MQTT broker such as Mosquitto U(http://mosquitto.org) and the I(Paho) C(mqtt) + Python client (U(https://pypi.org/project/paho-mqtt/)). author: "Jan-Piet Mens (@jpmens)" -''' +""" -EXAMPLES = ''' +EXAMPLES = r""" - name: Publish a message on an MQTT topic community.general.mqtt: topic: 'service/ansible/{{ ansible_hostname }}' @@ -122,7 +112,7 @@ EXAMPLES = ''' retain: false client_id: ans001 delegate_to: localhost -''' +""" # =========================================== # MQTT module support methods. diff --git a/plugins/modules/mssql_db.py b/plugins/modules/mssql_db.py index a85f721fca..95f529aff3 100644 --- a/plugins/modules/mssql_db.py +++ b/plugins/modules/mssql_db.py @@ -10,8 +10,7 @@ from __future__ import absolute_import, division, print_function __metaclass__ = type -DOCUMENTATION = ''' ---- +DOCUMENTATION = r""" module: mssql_db short_description: Add or remove MSSQL databases from a remote host description: @@ -26,56 +25,54 @@ attributes: options: name: description: - - name of the database to add or remove + - Name of the database to add or remove. required: true - aliases: [ db ] + aliases: [db] type: str login_user: description: - - The username used to authenticate with + - The username used to authenticate with. type: str default: '' login_password: description: - - The password used to authenticate with + - The password used to authenticate with. type: str default: '' login_host: description: - - Host running the database + - Host running the database. type: str required: true login_port: description: - - Port of the MSSQL server. Requires login_host be defined as other than localhost if login_port is used + - Port of the MSSQL server. Requires login_host be defined as other than localhost if login_port is used. default: '1433' type: str state: description: - - The database state + - The database state. default: present - choices: [ "present", "absent", "import" ] + choices: ["present", "absent", "import"] type: str target: description: - - Location, on the remote host, of the dump file to read from or write to. Uncompressed SQL - files (C(.sql)) files are supported. + - Location, on the remote host, of the dump file to read from or write to. Uncompressed SQL files (C(.sql)) files are supported. type: str autocommit: description: - - Automatically commit the change only if the import succeed. Sometimes it is necessary to use autocommit=true, since some content can't be changed - within a transaction. + - Automatically commit the change only if the import succeed. Sometimes it is necessary to use autocommit=true, since some content can not + be changed within a transaction. type: bool default: false notes: - - Requires the pymssql Python package on the remote host. For Ubuntu, this - is as easy as pip install pymssql (See M(ansible.builtin.pip).) + - Requires the pymssql Python package on the remote host. For Ubuntu, this is as easy as pip install pymssql (See M(ansible.builtin.pip)). requirements: - - pymssql + - pymssql author: Vedit Firat Arig (@vedit) -''' +""" -EXAMPLES = ''' +EXAMPLES = r""" - name: Create a new database with name 'jackdata' community.general.mssql_db: name: jackdata @@ -92,11 +89,11 @@ EXAMPLES = ''' name: my_db state: import target: /tmp/dump.sql -''' +""" -RETURN = ''' +RETURN = r""" # -''' +""" import os import traceback diff --git a/plugins/modules/mssql_script.py b/plugins/modules/mssql_script.py index b1713092c8..045cafde88 100644 --- a/plugins/modules/mssql_script.py +++ b/plugins/modules/mssql_script.py @@ -7,8 +7,7 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type -DOCUMENTATION = r''' ---- +DOCUMENTATION = r""" module: mssql_script short_description: Execute SQL scripts on a MSSQL database @@ -17,77 +16,74 @@ version_added: "4.0.0" description: - Execute SQL scripts on a MSSQL database. - extends_documentation_fragment: - community.general.attributes attributes: - check_mode: - support: partial - details: - - The script will not be executed in check mode. - diff_mode: - support: none + check_mode: + support: partial + details: + - The script will not be executed in check mode. + diff_mode: + support: none options: - name: - description: Database to run script against. - aliases: [ db ] - default: '' - type: str - login_user: - description: The username used to authenticate with. - type: str - login_password: - description: The password used to authenticate with. - type: str - login_host: - description: Host running the database. - type: str - required: true - login_port: - description: Port of the MSSQL server. Requires O(login_host) be defined as well. - default: 1433 - type: int - script: - description: - - The SQL script to be executed. - - Script can contain multiple SQL statements. Multiple Batches can be separated by V(GO) command. - - Each batch must return at least one result set. - required: true - type: str - transaction: - description: - - If transactional mode is requested, start a transaction and commit the change only if the script succeed. - Otherwise, rollback the transaction. - - If transactional mode is not requested (default), automatically commit the change. - type: bool - default: false - version_added: 8.4.0 - output: - description: - - With V(default) each row will be returned as a list of values. See RV(query_results). - - Output format V(dict) will return dictionary with the column names as keys. See RV(query_results_dict). - - V(dict) requires named columns to be returned by each query otherwise an error is thrown. - choices: [ "dict", "default" ] - default: 'default' - type: str - params: - description: | - Parameters passed to the script as SQL parameters. - (Query V('SELECT %(name\)s"') with V(example: '{"name": "John Doe"}).)' - type: dict + name: + description: Database to run script against. + aliases: [db] + default: '' + type: str + login_user: + description: The username used to authenticate with. + type: str + login_password: + description: The password used to authenticate with. + type: str + login_host: + description: Host running the database. + type: str + required: true + login_port: + description: Port of the MSSQL server. Requires O(login_host) be defined as well. + default: 1433 + type: int + script: + description: + - The SQL script to be executed. + - Script can contain multiple SQL statements. Multiple Batches can be separated by V(GO) command. + - Each batch must return at least one result set. + required: true + type: str + transaction: + description: + - If transactional mode is requested, start a transaction and commit the change only if the script succeed. Otherwise, rollback the transaction. + - If transactional mode is not requested (default), automatically commit the change. + type: bool + default: false + version_added: 8.4.0 + output: + description: + - With V(default) each row will be returned as a list of values. See RV(query_results). + - Output format V(dict) will return dictionary with the column names as keys. See RV(query_results_dict). + - V(dict) requires named columns to be returned by each query otherwise an error is thrown. + choices: ["dict", "default"] + default: 'default' + type: str + params: + description: |- + Parameters passed to the script as SQL parameters. + (Query V('SELECT %(name\)s"') with V(example: '{"name": "John Doe"}).)'. + type: dict notes: - - Requires the pymssql Python package on the remote host. For Ubuntu, this - is as easy as C(pip install pymssql) (See M(ansible.builtin.pip).) + - Requires the pymssql Python package on the remote host. For Ubuntu, this is as easy as C(pip install pymssql) (See M(ansible.builtin.pip)). requirements: - - pymssql + - pymssql author: - - Kris Budde (@kbudde) -''' + - Kris Budde (@kbudde) +""" -EXAMPLES = r''' +EXAMPLES = r""" - name: Check DB connection community.general.mssql_script: login_user: "{{ mssql_login_user }}" @@ -140,11 +136,11 @@ EXAMPLES = r''' register: result_batches - assert: that: - - result_batches.query_results | length == 2 # two batch results - - result_batches.query_results[0] | length == 2 # two selects in first batch - - result_batches.query_results[0][0] | length == 1 # one row in first select - - result_batches.query_results[0][0][0] | length == 1 # one column in first row - - result_batches.query_results[0][0][0][0] == 'Batch 0 - Select 0' # each row contains a list of values. + - result_batches.query_results | length == 2 # two batch results + - result_batches.query_results[0] | length == 2 # two selects in first batch + - result_batches.query_results[0][0] | length == 1 # one row in first select + - result_batches.query_results[0][0][0] | length == 1 # one column in first row + - result_batches.query_results[0][0][0][0] == 'Batch 0 - Select 0' # each row contains a list of values. - name: two batches with dict output community.general.mssql_script: @@ -161,68 +157,68 @@ EXAMPLES = r''' register: result_batches_dict - assert: that: - - result_batches_dict.query_results_dict | length == 2 # two batch results - - result_batches_dict.query_results_dict[0] | length == 2 # two selects in first batch - - result_batches_dict.query_results_dict[0][0] | length == 1 # one row in first select - - result_batches_dict.query_results_dict[0][0][0]['b0s0'] == 'Batch 0 - Select 0' # column 'b0s0' of first row -''' + - result_batches_dict.query_results_dict | length == 2 # two batch results + - result_batches_dict.query_results_dict[0] | length == 2 # two selects in first batch + - result_batches_dict.query_results_dict[0][0] | length == 1 # one row in first select + - result_batches_dict.query_results_dict[0][0][0]['b0s0'] == 'Batch 0 - Select 0' # column 'b0s0' of first row +""" -RETURN = r''' +RETURN = r""" query_results: - description: List of batches (queries separated by V(GO) keyword). - type: list - elements: list - returned: success and O(output=default) - sample: [[[["Batch 0 - Select 0"]], [["Batch 0 - Select 1"]]], [[["Batch 1 - Select 0"]]]] - contains: - queries: - description: - - List of result sets of each query. - - If a query returns no results, the results of this and all the following queries will not be included in the output. - - Use the V(GO) keyword in O(script) to separate queries. - type: list - elements: list - contains: - rows: - description: List of rows returned by query. - type: list - elements: list - contains: - column_value: - description: - - List of column values. - - Any non-standard JSON type is converted to string. - type: list - example: ["Batch 0 - Select 0"] - returned: success, if output is default + description: List of batches (queries separated by V(GO) keyword). + type: list + elements: list + returned: success and O(output=default) + sample: [[[["Batch 0 - Select 0"]], [["Batch 0 - Select 1"]]], [[["Batch 1 - Select 0"]]]] + contains: + queries: + description: + - List of result sets of each query. + - If a query returns no results, the results of this and all the following queries will not be included in the output. + - Use the V(GO) keyword in O(script) to separate queries. + type: list + elements: list + contains: + rows: + description: List of rows returned by query. + type: list + elements: list + contains: + column_value: + description: + - List of column values. + - Any non-standard JSON type is converted to string. + type: list + example: ["Batch 0 - Select 0"] + returned: success, if output is default query_results_dict: - description: List of batches (queries separated by V(GO) keyword). - type: list - elements: list - returned: success and O(output=dict) - sample: [[[["Batch 0 - Select 0"]], [["Batch 0 - Select 1"]]], [[["Batch 1 - Select 0"]]]] - contains: - queries: - description: - - List of result sets of each query. - - If a query returns no results, the results of this and all the following queries will not be included in the output. - Use 'GO' keyword to separate queries. - type: list - elements: list - contains: - rows: - description: List of rows returned by query. - type: list - elements: list - contains: - column_dict: - description: - - Dictionary of column names and values. - - Any non-standard JSON type is converted to string. - type: dict - example: {"col_name": "Batch 0 - Select 0"} - returned: success, if output is dict -''' + description: List of batches (queries separated by V(GO) keyword). + type: list + elements: list + returned: success and O(output=dict) + sample: [[[["Batch 0 - Select 0"]], [["Batch 0 - Select 1"]]], [[["Batch 1 - Select 0"]]]] + contains: + queries: + description: + - List of result sets of each query. + - If a query returns no results, the results of this and all the following queries will not be included in the output. Use 'GO' keyword + to separate queries. + type: list + elements: list + contains: + rows: + description: List of rows returned by query. + type: list + elements: list + contains: + column_dict: + description: + - Dictionary of column names and values. + - Any non-standard JSON type is converted to string. + type: dict + example: {"col_name": "Batch 0 - Select 0"} + returned: success, if output is dict +""" from ansible.module_utils.basic import AnsibleModule, missing_required_lib import traceback diff --git a/plugins/modules/nagios.py b/plugins/modules/nagios.py index 0f1f0b7c50..7a0c26b48e 100644 --- a/plugins/modules/nagios.py +++ b/plugins/modules/nagios.py @@ -14,20 +14,19 @@ from __future__ import absolute_import, division, print_function __metaclass__ = type -DOCUMENTATION = ''' ---- +DOCUMENTATION = r""" module: nagios short_description: Perform common tasks in Nagios related to downtime and notifications description: - - "The C(nagios) module has two basic functions: scheduling downtime and toggling alerts for services or hosts." + - 'The C(nagios) module has two basic functions: scheduling downtime and toggling alerts for services or hosts.' - The C(nagios) module is not idempotent. - All actions require the O(host) parameter to be given explicitly. In playbooks you can use the C({{inventory_hostname}}) variable to refer to the host the playbook is currently running on. - - You can specify multiple services at once by separating them with commas, .e.g. O(services=httpd,nfs,puppet). - - When specifying what service to handle there is a special service value, O(host), which will handle alerts/downtime/acknowledge for the I(host itself), - for example O(services=host). This keyword may not be given with other services at the same time. - B(Setting alerts/downtime/acknowledge for a host does not affect alerts/downtime/acknowledge for any of the services running on it.) - To schedule downtime for all services on particular host use keyword "all", for example O(services=all). + - You can specify multiple services at once by separating them with commas, for example O(services=httpd,nfs,puppet). + - When specifying what service to handle there is a special service value, O(host), which will handle alerts/downtime/acknowledge for the I(host + itself), for example O(services=host). This keyword may not be given with other services at the same time. B(Setting alerts/downtime/acknowledge + for a host does not affect alerts/downtime/acknowledge for any of the services running on it.) To schedule downtime for all services on particular + host use keyword "all", for example O(services=all). extends_documentation_fragment: - community.general.attributes attributes: @@ -41,9 +40,8 @@ options: - Action to take. - The V(acknowledge) and V(forced_check) actions were added in community.general 1.2.0. required: true - choices: [ "downtime", "delete_downtime", "enable_alerts", "disable_alerts", "silence", "unsilence", - "silence_nagios", "unsilence_nagios", "command", "servicegroup_service_downtime", - "servicegroup_host_downtime", "acknowledge", "forced_check" ] + choices: ["downtime", "delete_downtime", "enable_alerts", "disable_alerts", "silence", "unsilence", "silence_nagios", "unsilence_nagios", + "command", "servicegroup_service_downtime", "servicegroup_host_downtime", "acknowledge", "forced_check"] type: str host: description: @@ -51,18 +49,16 @@ options: type: str cmdfile: description: - - Path to the nagios I(command file) (FIFO pipe). - Only required if auto-detection fails. + - Path to the nagios I(command file) (FIFO pipe). Only required if auto-detection fails. type: str author: description: - - Author to leave downtime comments as. - Only used when O(action) is V(downtime) or V(acknowledge). + - Author to leave downtime comments as. Only used when O(action) is V(downtime) or V(acknowledge). type: str default: Ansible comment: description: - - Comment when O(action) is V(downtime) or V(acknowledge). + - Comment when O(action) is V(downtime) or V(acknowledge). type: str default: Scheduling downtime start: @@ -79,8 +75,8 @@ options: services: description: - What to manage downtime/alerts for. Separate multiple services with commas. - - "B(Required) option when O(action) is one of: V(downtime), V(acknowledge), V(forced_check), V(enable_alerts), V(disable_alerts)." - aliases: [ "service" ] + - 'B(Required) option when O(action) is one of: V(downtime), V(acknowledge), V(forced_check), V(enable_alerts), V(disable_alerts).' + aliases: ["service"] type: str servicegroup: description: @@ -94,9 +90,9 @@ options: type: str author: "Tim Bielawa (@tbielawa)" -''' +""" -EXAMPLES = ''' +EXAMPLES = r""" - name: Set 30 minutes of apache downtime community.general.nagios: action: downtime @@ -245,7 +241,7 @@ EXAMPLES = ''' community.general.nagios: action: command command: DISABLE_FAILURE_PREDICTION -''' +""" import time import os.path diff --git a/plugins/modules/netcup_dns.py b/plugins/modules/netcup_dns.py index cba70c0fa3..370aaa5dca 100644 --- a/plugins/modules/netcup_dns.py +++ b/plugins/modules/netcup_dns.py @@ -9,13 +9,12 @@ from __future__ import absolute_import, division, print_function __metaclass__ = type -DOCUMENTATION = ''' ---- +DOCUMENTATION = r""" module: netcup_dns notes: [] short_description: Manage Netcup DNS records description: - - "Manages DNS records via the Netcup API, see the docs U(https://ccp.netcup.net/run/webservice/servers/endpoint.php)." + - Manages DNS records using the Netcup API, see the docs U(https://ccp.netcup.net/run/webservice/servers/endpoint.php). extends_documentation_fragment: - community.general.attributes attributes: @@ -26,12 +25,12 @@ attributes: options: api_key: description: - - "API key for authentication, must be obtained via the netcup CCP (U(https://ccp.netcup.net))." + - API key for authentication, must be obtained using the netcup CCP (U(https://ccp.netcup.net)). required: true type: str api_password: description: - - "API password for authentication, must be obtained via the netcup CCP (U(https://ccp.netcup.net))." + - API password for authentication, must be obtained using the netcup CCP (U(https://ccp.netcup.net)). required: true type: str customer_id: @@ -48,7 +47,7 @@ options: description: - Record to add or delete, supports wildcard (V(*)). Default is V(@) (that is, the zone name). default: "@" - aliases: [ name ] + aliases: [name] type: str type: description: @@ -80,7 +79,7 @@ options: - Whether the record should exist or not. required: false default: present - choices: [ 'present', 'absent' ] + choices: ['present', 'absent'] type: str timeout: description: @@ -91,10 +90,9 @@ options: requirements: - "nc-dnsapi >= 0.1.3" author: "Nicolai Buchwitz (@nbuchwitz)" +""" -''' - -EXAMPLES = ''' +EXAMPLES = r""" - name: Create a record of type A community.general.netcup_dns: api_key: "..." @@ -156,41 +154,41 @@ EXAMPLES = ''' type: "A" value: "127.0.0.1" timeout: 30 +""" -''' - -RETURN = ''' +RETURN = r""" records: - description: list containing all records - returned: success - type: complex - contains: - name: - description: the record name - returned: success - type: str - sample: fancy-hostname - type: - description: the record type - returned: success - type: str - sample: A - value: - description: the record destination - returned: success - type: str - sample: 127.0.0.1 - priority: - description: the record priority (only relevant if type=MX) - returned: success - type: int - sample: 0 - id: - description: internal id of the record - returned: success - type: int - sample: 12345 -''' + description: List containing all records. + returned: success + type: list + elements: dict + contains: + name: + description: The record name. + returned: success + type: str + sample: fancy-hostname + type: + description: The record type. + returned: success + type: str + sample: A + value: + description: The record destination. + returned: success + type: str + sample: 127.0.0.1 + priority: + description: The record priority (only relevant if RV(records[].type=MX)). + returned: success + type: int + sample: 0 + id: + description: Internal id of the record. + returned: success + type: int + sample: 12345 +""" import traceback diff --git a/plugins/modules/newrelic_deployment.py b/plugins/modules/newrelic_deployment.py index e5a1160822..99ff996670 100644 --- a/plugins/modules/newrelic_deployment.py +++ b/plugins/modules/newrelic_deployment.py @@ -9,13 +9,12 @@ from __future__ import absolute_import, division, print_function __metaclass__ = type -DOCUMENTATION = ''' ---- +DOCUMENTATION = r""" module: newrelic_deployment author: "Matt Coddington (@mcodd)" short_description: Notify New Relic about app deployments description: - - Notify New Relic about app deployments (see https://docs.newrelic.com/docs/apm/new-relic-apm/maintenance/record-monitor-deployments/) + - Notify New Relic about app deployments (see U(https://docs.newrelic.com/docs/apm/new-relic-apm/maintenance/record-monitor-deployments/)). extends_documentation_fragment: - community.general.attributes attributes: @@ -44,49 +43,48 @@ options: changelog: type: str description: - - A list of changes for this deployment + - A list of changes for this deployment. required: false description: type: str description: - - Text annotation for the deployment - notes for you + - Text annotation for the deployment - notes for you. required: false revision: type: str description: - - A revision number (e.g., git commit SHA) + - A revision number (for example, git commit SHA). required: true user: type: str description: - - The name of the user/process that triggered this deployment + - The name of the user/process that triggered this deployment. required: false validate_certs: description: - - If V(false), SSL certificates will not be validated. This should only be used - on personally controlled sites using self-signed certificates. + - If V(false), SSL certificates will not be validated. This should only be used on personally controlled sites using self-signed certificates. required: false default: true type: bool app_name_exact_match: type: bool description: - - If this flag is set to V(true) then the application ID lookup by name would only work for an exact match. - If set to V(false) it returns the first result. + - If this flag is set to V(true) then the application ID lookup by name would only work for an exact match. If set to V(false) it returns + the first result. required: false default: false version_added: 7.5.0 requirements: [] -''' +""" -EXAMPLES = ''' -- name: Notify New Relic about an app deployment +EXAMPLES = r""" +- name: Notify New Relic about an app deployment community.general.newrelic_deployment: token: AAAAAA app_name: myapp user: ansible deployment revision: '1.0' -''' +""" from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.urls import fetch_url diff --git a/plugins/modules/nexmo.py b/plugins/modules/nexmo.py index 39f127f98c..3293362ec3 100644 --- a/plugins/modules/nexmo.py +++ b/plugins/modules/nexmo.py @@ -9,11 +9,11 @@ from __future__ import absolute_import, division, print_function __metaclass__ = type -DOCUMENTATION = ''' +DOCUMENTATION = r""" module: nexmo -short_description: Send a SMS via nexmo +short_description: Send a SMS using nexmo description: - - Send a SMS message via nexmo + - Send a SMS message using nexmo. author: "Matt Martz (@sivel)" attributes: check_mode: @@ -24,42 +24,40 @@ options: api_key: type: str description: - - Nexmo API Key + - Nexmo API Key. required: true api_secret: type: str description: - - Nexmo API Secret + - Nexmo API Secret. required: true src: type: int description: - - Nexmo Number to send from + - Nexmo Number to send from. required: true dest: type: list elements: int description: - - Phone number(s) to send SMS message to + - Phone number(s) to send SMS message to. required: true msg: type: str description: - - Message to text to send. Messages longer than 160 characters will be - split into multiple messages + - Message to text to send. Messages longer than 160 characters will be split into multiple messages. required: true validate_certs: description: - - If V(false), SSL certificates will not be validated. This should only be used - on personally controlled sites using self-signed certificates. + - If V(false), SSL certificates will not be validated. This should only be used on personally controlled sites using self-signed certificates. type: bool default: true extends_documentation_fragment: - ansible.builtin.url - community.general.attributes -''' +""" -EXAMPLES = """ +EXAMPLES = r""" - name: Send notification message via Nexmo community.general.nexmo: api_key: 640c8a53 diff --git a/plugins/modules/nginx_status_info.py b/plugins/modules/nginx_status_info.py index 6bbea078b0..7fa681d6d8 100644 --- a/plugins/modules/nginx_status_info.py +++ b/plugins/modules/nginx_status_info.py @@ -9,8 +9,7 @@ from __future__ import absolute_import, division, print_function __metaclass__ = type -DOCUMENTATION = r''' ---- +DOCUMENTATION = r""" module: nginx_status_info short_description: Retrieve information on nginx status description: @@ -34,9 +33,9 @@ options: notes: - See U(http://nginx.org/en/docs/http/ngx_http_stub_status_module.html) for more information. -''' +""" -EXAMPLES = r''' +EXAMPLES = r""" # Gather status info from nginx on localhost - name: Get current http stats community.general.nginx_status_info: @@ -49,10 +48,9 @@ EXAMPLES = r''' url: http://localhost/nginx_status timeout: 20 register: result -''' +""" -RETURN = r''' ---- +RETURN = r""" active_connections: description: Active connections. returned: success @@ -64,7 +62,8 @@ accepts: type: int sample: 81769947 handled: - description: The total number of handled connections. Generally, the parameter value is the same as accepts unless some resource limits have been reached. + description: The total number of handled connections. Generally, the parameter value is the same as accepts unless some resource limits have + been reached. returned: success type: int sample: 81769947 @@ -93,7 +92,7 @@ data: returned: success type: str sample: "Active connections: 2340 \nserver accepts handled requests\n 81769947 81769947 144332345 \nReading: 0 Writing: 241 Waiting: 2092 \n" -''' +""" import re from ansible.module_utils.basic import AnsibleModule diff --git a/plugins/modules/nictagadm.py b/plugins/modules/nictagadm.py index 5b81861e8f..a02a8fcffd 100644 --- a/plugins/modules/nictagadm.py +++ b/plugins/modules/nictagadm.py @@ -8,8 +8,7 @@ from __future__ import absolute_import, division, print_function __metaclass__ = type -DOCUMENTATION = r''' ---- +DOCUMENTATION = r""" module: nictagadm short_description: Manage nic tags on SmartOS systems description: @@ -26,39 +25,39 @@ attributes: options: name: description: - - Name of the nic tag. + - Name of the nic tag. required: true type: str mac: description: - - Specifies the O(mac) address to attach the nic tag to when not creating an O(etherstub). - - Parameters O(mac) and O(etherstub) are mutually exclusive. + - Specifies the O(mac) address to attach the nic tag to when not creating an O(etherstub). + - Parameters O(mac) and O(etherstub) are mutually exclusive. type: str etherstub: description: - - Specifies that the nic tag will be attached to a created O(etherstub). - - Parameter O(etherstub) is mutually exclusive with both O(mtu), and O(mac). + - Specifies that the nic tag will be attached to a created O(etherstub). + - Parameter O(etherstub) is mutually exclusive with both O(mtu), and O(mac). type: bool default: false mtu: description: - - Specifies the size of the O(mtu) of the desired nic tag. - - Parameters O(mtu) and O(etherstub) are mutually exclusive. + - Specifies the size of the O(mtu) of the desired nic tag. + - Parameters O(mtu) and O(etherstub) are mutually exclusive. type: int force: description: - - When O(state=absent) this switch will use the C(-f) parameter and delete the nic tag regardless of existing VMs. + - When O(state=absent) this switch will use the C(-f) parameter and delete the nic tag regardless of existing VMs. type: bool default: false state: description: - - Create or delete a SmartOS nic tag. + - Create or delete a SmartOS nic tag. type: str - choices: [ absent, present ] + choices: [absent, present] default: present -''' +""" -EXAMPLES = r''' +EXAMPLES = r""" - name: Create 'storage0' on '00:1b:21:a3:f5:4d' community.general.nictagadm: name: storage0 @@ -70,11 +69,11 @@ EXAMPLES = r''' community.general.nictagadm: name: storage0 state: absent -''' +""" -RETURN = r''' +RETURN = r""" name: - description: nic tag name + description: Nic tag name. returned: always type: str sample: storage0 @@ -84,26 +83,26 @@ mac: type: str sample: 00:1b:21:a3:f5:4d etherstub: - description: specifies if the nic tag will create and attach to an etherstub. + description: Specifies if the nic tag will create and attach to an etherstub. returned: always type: bool sample: false mtu: - description: specifies which MTU size was passed during the nictagadm add command. mtu and etherstub are mutually exclusive. + description: Specifies which MTU size was passed during the nictagadm add command. mtu and etherstub are mutually exclusive. returned: always type: int sample: 1500 force: - description: Shows if -f was used during the deletion of a nic tag + description: Shows if -f was used during the deletion of a nic tag. returned: always type: bool sample: false state: - description: state of the target + description: State of the target. returned: always type: str sample: present -''' +""" from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.common.network import is_mac diff --git a/plugins/modules/nmcli.py b/plugins/modules/nmcli.py index 4ea6799577..a8784e870c 100644 --- a/plugins/modules/nmcli.py +++ b/plugins/modules/nmcli.py @@ -9,1090 +9,1067 @@ from __future__ import absolute_import, division, print_function __metaclass__ = type -DOCUMENTATION = r''' ---- +DOCUMENTATION = r""" module: nmcli author: - - Chris Long (@alcamie101) + - Chris Long (@alcamie101) short_description: Manage Networking requirements: - - nmcli + - nmcli extends_documentation_fragment: - - community.general.attributes + - community.general.attributes description: - - 'Manage the network devices. Create, modify and manage various connection and device type e.g., ethernet, teams, bonds, vlans etc.' - - 'On CentOS 8 and Fedora >=29 like systems, the requirements can be met by installing the following packages: NetworkManager.' - - 'On CentOS 7 and Fedora <=28 like systems, the requirements can be met by installing the following packages: NetworkManager-tui.' - - 'On Ubuntu and Debian like systems, the requirements can be met by installing the following packages: network-manager' - - 'On openSUSE, the requirements can be met by installing the following packages: NetworkManager.' + - Manage the network devices. Create, modify and manage various connection and device type, for example V(ethernet), V(team), V(bond), V(vlan) and so on. + - 'On CentOS 8 and Fedora >=29 like systems, the requirements can be met by installing the following packages: NetworkManager.' + - 'On CentOS 7 and Fedora <=28 like systems, the requirements can be met by installing the following packages: NetworkManager-tui.' + - 'On Ubuntu and Debian like systems, the requirements can be met by installing the following packages: network-manager.' + - 'On openSUSE, the requirements can be met by installing the following packages: NetworkManager.' attributes: - check_mode: - support: full - diff_mode: - support: full + check_mode: + support: full + diff_mode: + support: full options: - state: + state: + description: + - Whether the device should exist or not, taking action if the state is different from what is stated. + - Using O(state=present) to create connection will automatically bring connection up. + - Using O(state=up) and O(state=down) will not modify connection with other parameters. These states have been added in community.general + 9.5.0. + type: str + required: true + choices: [absent, present, up, down] + autoconnect: + description: + - Whether the connection should start on boot. + - Whether the connection profile can be automatically activated. + type: bool + default: true + conn_name: + description: + - The name used to call the connection. Pattern is V([-][-]). + type: str + required: true + conn_reload: + description: + - Whether the connection should be reloaded if it was modified. + type: bool + required: false + default: false + version_added: 9.5.0 + ifname: + description: + - The interface to bind the connection to. + - The connection will only be applicable to this interface name. + - A special value of V(*) can be used for interface-independent connections. + - The ifname argument is mandatory for all connection types except bond, team, bridge, vlan and vpn. + - This parameter defaults to O(conn_name) when left unset for all connection types except vpn that removes it. + type: str + type: + description: + - This is the type of device or network connection that you wish to create or modify. + - Type V(dummy) is added in community.general 3.5.0. + - Type V(gsm) is added in community.general 3.7.0. + - Type V(infiniband) is added in community.general 2.0.0. + - Type V(loopback) is added in community.general 8.1.0. + - Type V(macvlan) is added in community.general 6.6.0. + - Type V(ovs-bridge) is added in community.general 8.6.0. + - Type V(ovs-interface) is added in community.general 8.6.0. + - Type V(ovs-port) is added in community.general 8.6.0. + - Type V(wireguard) is added in community.general 4.3.0. + - Type V(vpn) is added in community.general 5.1.0. + - Using V(bond-slave), V(bridge-slave), or V(team-slave) implies V(ethernet) connection type with corresponding O(slave_type) option. + - If you want to control non-ethernet connection attached to V(bond), V(bridge), or V(team) consider using O(slave_type) option. + type: str + choices: [bond, bond-slave, bridge, bridge-slave, dummy, ethernet, generic, gre, infiniband, ipip, macvlan, sit, team, team-slave, vlan, vxlan, + wifi, gsm, wireguard, ovs-bridge, ovs-port, ovs-interface, vpn, loopback] + mode: + description: + - This is the type of device or network connection that you wish to create for a bond or bridge. + type: str + choices: [802.3ad, active-backup, balance-alb, balance-rr, balance-tlb, balance-xor, broadcast] + default: balance-rr + transport_mode: + description: + - This option sets the connection type of Infiniband IPoIB devices. + type: str + choices: [datagram, connected] + version_added: 5.8.0 + slave_type: + description: + - Type of the device of this slave's master connection (for example V(bond)). + - Type V(ovs-port) is added in community.general 8.6.0. + type: str + choices: ['bond', 'bridge', 'team', 'ovs-port'] + version_added: 7.0.0 + master: + description: + - Master [-][-]. + - The Type Of Service. + type: int + route_metric4: + description: + - Set metric level of ipv4 routes configured on interface. + type: int + version_added: 2.0.0 + routing_rules4: + description: + - Is the same as in an C(ip rule add) command, except always requires specifying a priority. + type: list + elements: str + version_added: 3.3.0 + never_default4: + description: + - Set as default route. + - This parameter is mutually_exclusive with gw4 parameter. + type: bool + default: false + version_added: 2.0.0 + dns4: + description: + - A list of up to 3 DNS servers. + - The entries must be IPv4 addresses, for example V(192.0.2.53). + elements: str + type: list + dns4_search: + description: + - A list of DNS search domains. + elements: str + type: list + dns4_options: + description: + - A list of DNS options. + elements: str + type: list + version_added: 7.2.0 + dns4_ignore_auto: + description: + - Ignore automatically configured IPv4 name servers. + type: bool + default: false + version_added: 3.2.0 + method4: + description: + - Configuration method to be used for IPv4. + - If O(ip4) is set, C(ipv4.method) is automatically set to V(manual) and this parameter is not needed. + type: str + choices: [auto, link-local, manual, shared, disabled] + version_added: 2.2.0 + may_fail4: + description: + - If you need O(ip4) configured before C(network-online.target) is reached, set this option to V(false). + - This option applies when O(method4) is not V(disabled). + type: bool + default: true + version_added: 3.3.0 + ip6: + description: + - List of IPv6 addresses to this interface. + - Use the format V(abbe::cafe/128) or V(abbe::cafe). + - If defined and O(method6) is not specified, automatically set C(ipv6.method) to V(manual). + type: list + elements: str + gw6: + description: + - The IPv6 gateway for this interface. + - Use the format V(2001:db8::1). + type: str + gw6_ignore_auto: + description: + - Ignore automatically configured IPv6 routes. + type: bool + default: false + version_added: 3.2.0 + routes6: + description: + - The list of IPv6 routes. + - Use the format V(fd12:3456:789a:1::/64 2001:dead:beef::1). + - To specify more complex routes, use the O(routes6_extended) option. + type: list + elements: str + version_added: 4.4.0 + routes6_extended: + description: + - The list of IPv6 routes but with parameters. + type: list + elements: dict + suboptions: + ip: + description: + - IP or prefix of route. + - Use the format V(fd12:3456:789a:1::/64). type: str required: true - conn_reload: + next_hop: description: - - Whether the connection should be reloaded if it was modified. + - Use the format V(2001:dead:beef::1). + type: str + metric: + description: + - Route metric. + type: int + table: + description: + - The table to add this route to. + - The default depends on C(ipv6.route-table). + type: int + cwnd: + description: + - The clamp for congestion window. + type: int + mtu: + description: + - If non-zero, only transmit packets of the specified size or smaller. + type: int + onlink: + description: + - Pretend that the nexthop is directly attached to this link, even if it does not match any interface prefix. type: bool - required: false - default: false - version_added: 9.5.0 - ifname: + route_metric6: + description: + - Set metric level of IPv6 routes configured on interface. + type: int + version_added: 4.4.0 + dns6: + description: + - A list of up to 3 DNS servers. + - The entries must be IPv6 addresses, for example V(2001:4860:4860::8888). + elements: str + type: list + dns6_search: + description: + - A list of DNS search domains. + elements: str + type: list + dns6_options: + description: + - A list of DNS options. + elements: str + type: list + version_added: 7.2.0 + dns6_ignore_auto: + description: + - Ignore automatically configured IPv6 name servers. + type: bool + default: false + version_added: 3.2.0 + method6: + description: + - Configuration method to be used for IPv6. + - If O(ip6) is set, C(ipv6.method) is automatically set to V(manual) and this parameter is not needed. + - V(disabled) was added in community.general 3.3.0. + type: str + choices: [ignore, auto, dhcp, link-local, manual, shared, disabled] + version_added: 2.2.0 + ip_privacy6: + description: + - If enabled, it makes the kernel generate a temporary IPv6 address in addition to the public one. + type: str + choices: [disabled, prefer-public-addr, prefer-temp-addr, unknown] + version_added: 4.2.0 + addr_gen_mode6: + description: + - Configure method for creating the address for use with IPv6 Stateless Address Autoconfiguration. + - V(default) and V(default-or-eui64) have been added in community.general 6.5.0. + type: str + choices: [default, default-or-eui64, eui64, stable-privacy] + version_added: 4.2.0 + mtu: + description: + - The connection MTU, for example V(9000). This can not be applied when creating the interface and is done once the interface has been created. + - Can be used when modifying Team, VLAN, Ethernet (Future plans to implement wifi, gsm, pppoe, infiniband). + - This parameter defaults to V(1500) when unset. + type: int + dhcp_client_id: + description: + - DHCP Client Identifier sent to the DHCP server. + type: str + primary: + description: + - This is only used with bond and is the primary interface name (for "active-backup" mode), this is the usually the 'ifname'. + type: str + miimon: + description: + - This is only used with bond - miimon. + - This parameter defaults to V(100) when unset. + type: int + downdelay: + description: + - This is only used with bond - downdelay. + type: int + updelay: + description: + - This is only used with bond - updelay. + type: int + xmit_hash_policy: + description: + - This is only used with bond - xmit_hash_policy type. + type: str + version_added: 5.6.0 + arp_interval: + description: + - This is only used with bond - ARP interval. + type: int + arp_ip_target: + description: + - This is only used with bond - ARP IP target. + type: str + stp: + description: + - This is only used with bridge and controls whether Spanning Tree Protocol (STP) is enabled for this bridge. + type: bool + default: true + priority: + description: + - This is only used with 'bridge' - sets STP priority. + type: int + default: 128 + forwarddelay: + description: + - This is only used with bridge - [forward-delay <2-30>] STP forwarding delay, in seconds. + type: int + default: 15 + hellotime: + description: + - This is only used with bridge - [hello-time <1-10>] STP hello time, in seconds. + type: int + default: 2 + maxage: + description: + - This is only used with bridge - [max-age <6-42>] STP maximum message age, in seconds. + type: int + default: 20 + ageingtime: + description: + - This is only used with bridge - [ageing-time <0-1000000>] the Ethernet MAC address aging time, in seconds. + type: int + default: 300 + mac: + description: + - MAC address of the connection. + - Note this requires a recent kernel feature, originally introduced in 3.15 upstream kernel. + type: str + slavepriority: + description: + - This is only used with 'bridge-slave' - [<0-63>] - STP priority of this slave. + type: int + default: 32 + path_cost: + description: + - This is only used with 'bridge-slave' - [<1-65535>] - STP port cost for destinations using this slave. + type: int + default: 100 + hairpin: + description: + - This is only used with 'bridge-slave' - 'hairpin mode' for the slave, which allows frames to be sent back out through the slave the frame + was received on. + - The default change to V(false) in community.general 7.0.0. It used to be V(true) before. + type: bool + default: false + runner: + description: + - This is the type of device or network connection that you wish to create for a team. + type: str + choices: [broadcast, roundrobin, activebackup, loadbalance, lacp] + default: roundrobin + version_added: 3.4.0 + runner_hwaddr_policy: + description: + - This defines the policy of how hardware addresses of team device and port devices should be set during the team lifetime. + type: str + choices: [same_all, by_active, only_active] + version_added: 3.4.0 + runner_fast_rate: + description: + - Option specifies the rate at which our link partner is asked to transmit LACPDU packets. If this is V(true) then packets will be sent + once per second. Otherwise they will be sent every 30 seconds. + - Only allowed for O(runner=lacp). + type: bool + version_added: 6.5.0 + vlanid: + description: + - This is only used with VLAN - VLAN ID in range <0-4095>. + type: int + vlandev: + description: + - This is only used with VLAN - parent device this VLAN is on, can use ifname. + type: str + flags: + description: + - This is only used with VLAN - flags. + type: str + ingress: + description: + - This is only used with VLAN - VLAN ingress priority mapping. + type: str + egress: + description: + - This is only used with VLAN - VLAN egress priority mapping. + type: str + vxlan_id: + description: + - This is only used with VXLAN - VXLAN ID. + type: int + vxlan_remote: + description: + - This is only used with VXLAN - VXLAN destination IP address. + type: str + vxlan_local: + description: + - This is only used with VXLAN - VXLAN local IP address. + type: str + ip_tunnel_dev: + description: + - This is used with GRE/IPIP/SIT - parent device this GRE/IPIP/SIT tunnel, can use ifname. + type: str + ip_tunnel_remote: + description: + - This is used with GRE/IPIP/SIT - GRE/IPIP/SIT destination IP address. + type: str + ip_tunnel_local: + description: + - This is used with GRE/IPIP/SIT - GRE/IPIP/SIT local IP address. + type: str + ip_tunnel_input_key: + description: + - The key used for tunnel input packets. + - Only used when O(type=gre). + type: str + version_added: 3.6.0 + ip_tunnel_output_key: + description: + - The key used for tunnel output packets. + - Only used when O(type=gre). + type: str + version_added: 3.6.0 + zone: + description: + - The trust level of the connection. + - When updating this property on a currently activated connection, the change takes effect immediately. + type: str + version_added: 2.0.0 + wifi_sec: + description: + - The security configuration of the WiFi connection. + - Note the list of suboption attributes may vary depending on which version of NetworkManager/nmcli is installed on the host. + - 'An up-to-date list of supported attributes can be found here: U(https://networkmanager.dev/docs/api/latest/settings-802-11-wireless-security.html).' + - 'For instance to use common WPA-PSK auth with a password: V({key-mgmt: wpa-psk, psk: my_password}).' + type: dict + suboptions: + auth-alg: description: - - The interface to bind the connection to. - - The connection will only be applicable to this interface name. - - A special value of V('*') can be used for interface-independent connections. - - The ifname argument is mandatory for all connection types except bond, team, bridge, vlan and vpn. - - This parameter defaults to O(conn_name) when left unset for all connection types except vpn that removes it. + - When WEP is used (that is, if O(wifi_sec.key-mgmt) is V(none) or V(ieee8021x)) indicate the 802.11 authentication algorithm required + by the AP here. + - One of V(open) for Open System, V(shared) for Shared Key, or V(leap) for Cisco LEAP. + - When using Cisco LEAP (that is, if O(wifi_sec.key-mgmt=ieee8021x) and O(wifi_sec.auth-alg=leap)) the O(wifi_sec.leap-username) and + O(wifi_sec.leap-password) properties must be specified. type: str - type: + choices: [open, shared, leap] + fils: description: - - This is the type of device or network connection that you wish to create or modify. - - Type V(dummy) is added in community.general 3.5.0. - - Type V(gsm) is added in community.general 3.7.0. - - Type V(infiniband) is added in community.general 2.0.0. - - Type V(loopback) is added in community.general 8.1.0. - - Type V(macvlan) is added in community.general 6.6.0. - - Type V(ovs-bridge) is added in community.general 8.6.0. - - Type V(ovs-interface) is added in community.general 8.6.0. - - Type V(ovs-port) is added in community.general 8.6.0. - - Type V(wireguard) is added in community.general 4.3.0. - - Type V(vpn) is added in community.general 5.1.0. - - Using V(bond-slave), V(bridge-slave), or V(team-slave) implies V(ethernet) connection type with corresponding O(slave_type) option. - - If you want to control non-ethernet connection attached to V(bond), V(bridge), or V(team) consider using O(slave_type) option. - type: str - choices: [ bond, bond-slave, bridge, bridge-slave, dummy, ethernet, generic, gre, infiniband, ipip, macvlan, sit, team, team-slave, vlan, vxlan, - wifi, gsm, wireguard, ovs-bridge, ovs-port, ovs-interface, vpn, loopback ] - mode: + - Indicates whether Fast Initial Link Setup (802.11ai) must be enabled for the connection. + - One of V(0) (use global default value), V(1) (disable FILS), V(2) (enable FILS if the supplicant and the access point support it) + or V(3) (enable FILS and fail if not supported). + - When set to V(0) and no global default is set, FILS will be optionally enabled. + type: int + choices: [0, 1, 2, 3] + default: 0 + group: description: - - This is the type of device or network connection that you wish to create for a bond or bridge. - type: str - choices: [ 802.3ad, active-backup, balance-alb, balance-rr, balance-tlb, balance-xor, broadcast ] - default: balance-rr - transport_mode: - description: - - This option sets the connection type of Infiniband IPoIB devices. - type: str - choices: [ datagram, connected ] - version_added: 5.8.0 - slave_type: - description: - - Type of the device of this slave's master connection (for example V(bond)). - - Type V(ovs-port) is added in community.general 8.6.0. - type: str - choices: [ 'bond', 'bridge', 'team', 'ovs-port' ] - version_added: 7.0.0 - master: - description: - - Master