[mem ... n]*.py: normalize docs (#9388)

* [mem ... n]*.py: normalize docs

* Update plugins/modules/netcup_dns.py

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

* netcup_dns: change type of RV(records)

From complex to list of dicts.

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
pull/8676/merge
Alexei Znamensky 2024-12-27 01:41:54 +13:00 committed by GitHub
parent a9fca56374
commit 6aadcc72d1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
25 changed files with 2245 additions and 2342 deletions

View File

@ -8,18 +8,15 @@
from __future__ import (absolute_import, division, print_function) from __future__ import (absolute_import, division, print_function)
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = r"""
---
module: memset_dns_reload module: memset_dns_reload
author: "Simon Weald (@glitchcrab)" author: "Simon Weald (@glitchcrab)"
short_description: Request reload of Memset's DNS infrastructure, short_description: Request reload of Memset's DNS infrastructure,
notes: notes:
- DNS reload requests are a best-effort service provided by Memset; these generally - DNS reload requests are a best-effort service provided by Memset; these generally happen every 15 minutes by default, however you can request
happen every 15 minutes by default, however you can request an immediate reload if an immediate reload if later tasks rely on the records being created. An API key generated using the Memset customer control panel is required
later tasks rely on the records being created. An API key generated via the 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)
Memset customer control panel is required with the following minimum scope - is also required.
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: description:
- Request a reload of Memset's DNS infrastructure, and optionally poll until it finishes. - Request a reload of Memset's DNS infrastructure, and optionally poll until it finishes.
extends_documentation_fragment: extends_documentation_fragment:
@ -39,22 +36,19 @@ options:
default: false default: false
type: bool type: bool
description: description:
- Boolean value, if set will poll the reload job's status and return - 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
when the job has completed (unless the 30 second timeout is reached first). first). If the timeout is reached then the task will not be marked as failed, but stderr will indicate that the polling failed.
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 - name: Submit DNS reload and poll
community.general.memset_dns_reload: community.general.memset_dns_reload:
api_key: 5eb86c9196ab03919abcf03857163741 api_key: 5eb86c9196ab03919abcf03857163741
poll: true poll: true
delegate_to: localhost delegate_to: localhost
''' """
RETURN = ''' RETURN = r"""
---
memset_api: memset_api:
description: Raw response from the Memset API. description: Raw response from the Memset API.
returned: always returned: always
@ -85,7 +79,7 @@ memset_api:
returned: always returned: always
type: str type: str
sample: "dns" sample: "dns"
''' """
from time import sleep from time import sleep

View File

@ -8,14 +8,12 @@
from __future__ import (absolute_import, division, print_function) from __future__ import (absolute_import, division, print_function)
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = r"""
---
module: memset_memstore_info module: memset_memstore_info
author: "Simon Weald (@glitchcrab)" author: "Simon Weald (@glitchcrab)"
short_description: Retrieve Memstore product usage information short_description: Retrieve Memstore product usage information
notes: notes:
- An API key generated via the Memset customer control panel is needed with the - An API key generated using the Memset customer control panel is needed with the following minimum scope - C(memstore.usage).
following minimum scope - C(memstore.usage).
description: description:
- Retrieve Memstore product usage information. - Retrieve Memstore product usage information.
extends_documentation_fragment: extends_documentation_fragment:
@ -35,80 +33,79 @@ options:
required: true required: true
type: str type: str
description: description:
- The Memstore product name (that is, C(mstestyaa1)). - The Memstore product name (that is, V(mstestyaa1)).
''' """
EXAMPLES = ''' EXAMPLES = r"""
- name: Get usage for mstestyaa1 - name: Get usage for mstestyaa1
community.general.memset_memstore_info: community.general.memset_memstore_info:
name: mstestyaa1 name: mstestyaa1
api_key: 5eb86c9896ab03919abcf03857163741 api_key: 5eb86c9896ab03919abcf03857163741
delegate_to: localhost delegate_to: localhost
''' """
RETURN = ''' RETURN = r"""
---
memset_api: memset_api:
description: Info from the Memset API description: Info from the Memset API.
returned: always returned: always
type: complex type: complex
contains: contains:
cdn_bandwidth: cdn_bandwidth:
description: Dictionary of CDN bandwidth facts description: Dictionary of CDN bandwidth facts.
returned: always returned: always
type: complex type: complex
contains: contains:
bytes_out: 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 returned: always
type: int type: int
sample: 1000 sample: 1000
requests: requests:
description: Number of requests in the last 24 hours description: Number of requests in the last 24 hours.
returned: always returned: always
type: int type: int
sample: 10 sample: 10
bytes_in: 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 returned: always
type: int type: int
sample: 1000 sample: 1000
containers: containers:
description: Number of containers description: Number of containers.
returned: always returned: always
type: int type: int
sample: 10 sample: 10
bytes: bytes:
description: Space used in bytes description: Space used in bytes.
returned: always returned: always
type: int type: int
sample: 3860997965 sample: 3860997965
objs: objs:
description: Number of objects description: Number of objects.
returned: always returned: always
type: int type: int
sample: 1000 sample: 1000
bandwidth: bandwidth:
description: Dictionary of CDN bandwidth facts description: Dictionary of CDN bandwidth facts.
returned: always returned: always
type: complex type: complex
contains: contains:
bytes_out: bytes_out:
description: Outbound bandwidth for the last 24 hours in bytes description: Outbound bandwidth for the last 24 hours in bytes.
returned: always returned: always
type: int type: int
sample: 1000 sample: 1000
requests: requests:
description: Number of requests in the last 24 hours description: Number of requests in the last 24 hours.
returned: always returned: always
type: int type: int
sample: 10 sample: 10
bytes_in: bytes_in:
description: Inbound bandwidth for the last 24 hours in bytes description: Inbound bandwidth for the last 24 hours in bytes.
returned: always returned: always
type: int type: int
sample: 1000 sample: 1000
''' """
from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.basic import AnsibleModule
from ansible_collections.community.general.plugins.module_utils.memset import memset_api_call from ansible_collections.community.general.plugins.module_utils.memset import memset_api_call

View File

@ -8,14 +8,12 @@
from __future__ import (absolute_import, division, print_function) from __future__ import (absolute_import, division, print_function)
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = r"""
---
module: memset_server_info module: memset_server_info
author: "Simon Weald (@glitchcrab)" author: "Simon Weald (@glitchcrab)"
short_description: Retrieve server information short_description: Retrieve server information
notes: notes:
- An API key generated via the Memset customer control panel is needed with the - An API key generated using the Memset customer control panel is needed with the following minimum scope - C(server.info).
following minimum scope - C(server.info).
description: description:
- Retrieve server information. - Retrieve server information.
extends_documentation_fragment: extends_documentation_fragment:
@ -36,20 +34,19 @@ options:
type: str type: str
description: description:
- The server product name (that is, C(testyaa1)). - The server product name (that is, C(testyaa1)).
''' """
EXAMPLES = ''' EXAMPLES = r"""
- name: Get details for testyaa1 - name: Get details for testyaa1
community.general.memset_server_info: community.general.memset_server_info:
name: testyaa1 name: testyaa1
api_key: 5eb86c9896ab03919abcf03857163741 api_key: 5eb86c9896ab03919abcf03857163741
delegate_to: localhost delegate_to: localhost
''' """
RETURN = ''' RETURN = r"""
---
memset_api: memset_api:
description: Info from the Memset API description: Info from the Memset API.
returned: always returned: always
type: complex type: complex
contains: contains:
@ -59,7 +56,7 @@ memset_api:
type: bool type: bool
sample: true sample: true
control_panel: 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 returned: always
type: str type: str
sample: 'cpanel' sample: 'cpanel'
@ -103,7 +100,7 @@ memset_api:
} }
} }
firewall_type: 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 returned: always
type: str type: str
sample: 'managed' sample: 'managed'
@ -113,7 +110,7 @@ memset_api:
type: str type: str
sample: 'testyaa1.miniserver.com' sample: 'testyaa1.miniserver.com'
ignore_monitoring_off: 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 returned: always
type: bool type: bool
sample: true sample: true
@ -136,7 +133,7 @@ memset_api:
type: bool type: bool
sample: true sample: true
monitoring_level: monitoring_level:
description: The server's monitoring level (i.e. basic). description: The server's monitoring level (for example V(basic)).
returned: always returned: always
type: str type: str
sample: 'basic' sample: 'basic'
@ -196,7 +193,7 @@ memset_api:
type: str type: str
sample: 'GBP' sample: 'GBP'
renewal_price_vat: renewal_price_vat:
description: VAT rate for renewal payments description: VAT rate for renewal payments.
returned: always returned: always
type: str type: str
sample: '20' sample: '20'
@ -206,7 +203,7 @@ memset_api:
type: str type: str
sample: '2013-04-10' sample: '2013-04-10'
status: status:
description: Current status of the server (i.e. live, onhold). description: Current status of the server (for example live, onhold).
returned: always returned: always
type: str type: str
sample: 'LIVE' sample: 'LIVE'
@ -216,7 +213,7 @@ memset_api:
type: str type: str
sample: 'managed' sample: 'managed'
type: type:
description: What this server is (i.e. dedicated) description: What this server is (for example V(dedicated)).
returned: always returned: always
type: str type: str
sample: 'miniserver' sample: 'miniserver'
@ -233,7 +230,7 @@ memset_api:
returned: always returned: always
type: str type: str
sample: 'basic' sample: 'basic'
''' """
from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.basic import AnsibleModule
from ansible_collections.community.general.plugins.module_utils.memset import memset_api_call from ansible_collections.community.general.plugins.module_utils.memset import memset_api_call

View File

@ -8,16 +8,13 @@
from __future__ import (absolute_import, division, print_function) from __future__ import (absolute_import, division, print_function)
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = r"""
---
module: memset_zone module: memset_zone
author: "Simon Weald (@glitchcrab)" author: "Simon Weald (@glitchcrab)"
short_description: Creates and deletes Memset DNS zones short_description: Creates and deletes Memset DNS zones
notes: notes:
- Zones can be thought of as a logical group of domains, all of which share the - 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
same DNS records (i.e. they point to the same IP). An API key generated via the 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).
Memset customer control panel is needed with the following minimum scope -
C(dns.zone_create), C(dns.zone_delete), C(dns.zone_list).
description: description:
- Manage DNS zones in a Memset account. - Manage DNS zones in a Memset account.
extends_documentation_fragment: extends_documentation_fragment:
@ -42,14 +39,12 @@ options:
name: name:
required: true required: true
description: description:
- The zone nickname; usually the same as the main domain. Ensure this - The zone nickname; usually the same as the main domain. Ensure this value has at most 250 characters.
value has at most 250 characters.
type: str type: str
aliases: [nickname] aliases: [nickname]
ttl: ttl:
description: description:
- The default TTL for all records created in the zone. This must be a - 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).
valid int from U(https://www.memset.com/apidocs/methods_dns.html#dns.zone_create).
type: int type: int
default: 0 default: 0
choices: [0, 300, 600, 900, 1800, 3600, 7200, 10800, 21600, 43200, 86400] choices: [0, 300, 600, 900, 1800, 3600, 7200, 10800, 21600, 43200, 86400]
@ -59,9 +54,9 @@ options:
type: bool type: bool
description: description:
- Forces deletion of a zone and all zone domains/zone records it contains. - Forces deletion of a zone and all zone domains/zone records it contains.
''' """
EXAMPLES = ''' EXAMPLES = r"""
# Create the zone 'test' # Create the zone 'test'
- name: Create zone - name: Create zone
community.general.memset_zone: community.general.memset_zone:
@ -79,40 +74,40 @@ EXAMPLES = '''
api_key: 5eb86c9196ab03919abcf03857163741 api_key: 5eb86c9196ab03919abcf03857163741
force: true force: true
delegate_to: localhost delegate_to: localhost
''' """
RETURN = ''' RETURN = r"""
memset_api: memset_api:
description: Zone info from the Memset API description: Zone info from the Memset API.
returned: when state == present returned: when state == present
type: complex type: complex
contains: contains:
domains: domains:
description: List of domains in this zone description: List of domains in this zone.
returned: always returned: always
type: list type: list
sample: [] sample: []
id: id:
description: Zone id description: Zone id.
returned: always returned: always
type: str type: str
sample: "b0bb1ce851aeea6feeb2dc32fe83bf9c" sample: "b0bb1ce851aeea6feeb2dc32fe83bf9c"
nickname: nickname:
description: Zone name description: Zone name.
returned: always returned: always
type: str type: str
sample: "example.com" sample: "example.com"
records: records:
description: List of DNS records for domains in this zone description: List of DNS records for domains in this zone.
returned: always returned: always
type: list type: list
sample: [] sample: []
ttl: ttl:
description: Default TTL for domains in this zone description: Default TTL for domains in this zone.
returned: always returned: always
type: int type: int
sample: 300 sample: 300
''' """
from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.basic import AnsibleModule
from ansible_collections.community.general.plugins.module_utils.memset import check_zone from ansible_collections.community.general.plugins.module_utils.memset import check_zone

View File

@ -8,18 +8,15 @@
from __future__ import (absolute_import, division, print_function) from __future__ import (absolute_import, division, print_function)
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = r"""
---
module: memset_zone_domain module: memset_zone_domain
author: "Simon Weald (@glitchcrab)" author: "Simon Weald (@glitchcrab)"
short_description: Create and delete domains in Memset DNS zones short_description: Create and delete domains in Memset DNS zones
notes: notes:
- Zone domains can be thought of as a collection of domains, all of which share the - 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
same DNS records (i.e. they point to the same IP). An API key generated via the 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),
Memset customer control panel is needed with the following minimum scope - C(dns.zone_domain_list).
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).
- Currently this module can only create one domain at a time. Multiple domains should
be created using C(loop).
description: description:
- Manage DNS zone domains in a Memset account. - Manage DNS zone domains in a Memset account.
extends_documentation_fragment: extends_documentation_fragment:
@ -52,9 +49,9 @@ options:
description: description:
- The zone to add the domain to (this must already exist). - The zone to add the domain to (this must already exist).
type: str type: str
''' """
EXAMPLES = ''' EXAMPLES = r"""
# Create the zone domain 'test.com' # Create the zone domain 'test.com'
- name: Create zone domain - name: Create zone domain
community.general.memset_zone_domain: community.general.memset_zone_domain:
@ -63,25 +60,25 @@ EXAMPLES = '''
state: present state: present
api_key: 5eb86c9196ab03919abcf03857163741 api_key: 5eb86c9196ab03919abcf03857163741
delegate_to: localhost delegate_to: localhost
''' """
RETURN = ''' RETURN = r"""
memset_api: memset_api:
description: Domain info from the Memset API description: Domain info from the Memset API.
returned: when changed or state == present returned: when changed or state == present
type: complex type: complex
contains: contains:
domain: domain:
description: Domain name description: Domain name.
returned: always returned: always
type: str type: str
sample: "example.com" sample: "example.com"
id: id:
description: Domain ID description: Domain ID.
returned: always returned: always
type: str type: str
sample: "b0bb1ce851aeea6feeb2dc32fe83bf9c" sample: "b0bb1ce851aeea6feeb2dc32fe83bf9c"
''' """
from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.basic import AnsibleModule
from ansible_collections.community.general.plugins.module_utils.memset import get_zone_id from ansible_collections.community.general.plugins.module_utils.memset import get_zone_id

View File

@ -8,18 +8,14 @@
from __future__ import (absolute_import, division, print_function) from __future__ import (absolute_import, division, print_function)
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = r"""
---
module: memset_zone_record module: memset_zone_record
author: "Simon Weald (@glitchcrab)" author: "Simon Weald (@glitchcrab)"
short_description: Create and delete records in Memset DNS zones short_description: Create and delete records in Memset DNS zones
notes: notes:
- Zones can be thought of as a logical group of domains, all of which share the - 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
same DNS records (i.e. they point to the same IP). An API key generated via the 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).
Memset customer control panel is needed with the following minimum scope - - Currently this module can only create one DNS record at a time. Multiple records should be created using C(loop).
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: description:
- Manage DNS records in a Memset account. - Manage DNS records in a Memset account.
extends_documentation_fragment: extends_documentation_fragment:
@ -68,12 +64,11 @@ options:
type: bool type: bool
default: false default: false
description: description:
- If set then the current domain is added onto the address field for C(CNAME), C(MX), C(NS) - If set then the current domain is added onto the address field for C(CNAME), C(MX), C(NS) and C(SRV)record types.
and C(SRV)record types.
ttl: ttl:
description: description:
- The record's TTL in seconds (will inherit zone's TTL if not explicitly set). This must be a - The record's TTL in seconds (will inherit zone's TTL if not explicitly set). This must be a valid int from
valid int from U(https://www.memset.com/apidocs/methods_dns.html#dns.zone_record_create). U(https://www.memset.com/apidocs/methods_dns.html#dns.zone_record_create).
default: 0 default: 0
choices: [0, 300, 600, 900, 1800, 3600, 7200, 10800, 21600, 43200, 86400] choices: [0, 300, 600, 900, 1800, 3600, 7200, 10800, 21600, 43200, 86400]
type: int type: int
@ -82,9 +77,9 @@ options:
description: description:
- The name of the zone to which to add the record to. - The name of the zone to which to add the record to.
type: str type: str
''' """
EXAMPLES = ''' EXAMPLES = r"""
# Create DNS record for www.domain.com # Create DNS record for www.domain.com
- name: Create DNS record - name: Create DNS record
community.general.memset_zone_record: community.general.memset_zone_record:
@ -120,9 +115,9 @@ EXAMPLES = '''
with_items: with_items:
- {'zone': 'domain1.com', 'type': 'A', 'record': 'www', 'address': '1.2.3.4'} - {'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': 'domain2.com', 'type': 'A', 'record': 'mail', 'address': '4.3.2.1'}
''' """
RETURN = ''' RETURN = r"""
memset_api: memset_api:
description: Record info from the Memset API. description: Record info from the Memset API.
returned: when state == present returned: when state == present
@ -168,7 +163,7 @@ memset_api:
returned: always returned: always
type: str type: str
sample: "b0bb1ce851aeea6feeb2dc32fe83bf9c" sample: "b0bb1ce851aeea6feeb2dc32fe83bf9c"
''' """
from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.basic import AnsibleModule
from ansible_collections.community.general.plugins.module_utils.memset import get_zone_id from ansible_collections.community.general.plugins.module_utils.memset import get_zone_id

View File

@ -10,8 +10,7 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = """ DOCUMENTATION = r"""
---
author: Kairo Araujo (@kairoaraujo) author: Kairo Araujo (@kairoaraujo)
module: mksysb module: mksysb
short_description: Generates AIX mksysb rootvg backups short_description: Generates AIX mksysb rootvg backups
@ -63,7 +62,7 @@ options:
name: name:
type: str type: str
description: description:
- Backup name - Backup name.
required: true required: true
new_image_data: new_image_data:
description: description:
@ -87,8 +86,7 @@ options:
default: false default: false
""" """
EXAMPLES = """ EXAMPLES = r"""
---
- name: Running a backup image mksysb - name: Running a backup image mksysb
community.general.mksysb: community.general.mksysb:
name: myserver name: myserver
@ -97,8 +95,7 @@ EXAMPLES = """
exclude_wpar_files: true exclude_wpar_files: true
""" """
RETURN = """ RETURN = r"""
---
changed: changed:
description: Return changed for mksysb actions as true or false. description: Return changed for mksysb actions as true or false.
returned: always returned: always

View File

@ -8,8 +8,7 @@
from __future__ import absolute_import, division, print_function from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = r"""
---
module: modprobe module: modprobe
short_description: Load or unload kernel modules short_description: Load or unload kernel modules
author: author:
@ -51,16 +50,16 @@ options:
- Persistency between reboots for configured module. - 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. - 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(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 - 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
loaded on next reboot. 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. - 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 - 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
kernel modules themselves instead of configuration like this. in the kernel modules themselves instead of configuration like this.
- In fact, most modern kernel modules are prepared for automatic loading already. - 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)." - 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 - name: Add the 802.1q module
community.general.modprobe: community.general.modprobe:
name: 8021q name: 8021q
@ -78,7 +77,7 @@ EXAMPLES = '''
state: present state: present
params: 'numdummies=2' params: 'numdummies=2'
persistent: present persistent: present
''' """
import os.path import os.path
import platform import platform

View File

@ -9,12 +9,11 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = r"""
---
module: monit 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: description:
- Manage the state of a program monitored via Monit. - Manage the state of a program monitored using Monit.
extends_documentation_fragment: extends_documentation_fragment:
- community.general.attributes - community.general.attributes
attributes: attributes:
@ -36,22 +35,21 @@ options:
type: str type: str
timeout: timeout:
description: description:
- If there are pending actions for the service monitored by monit, then Ansible will 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
for up to this many seconds to verify the requested action has been performed. action has been performed. Ansible will sleep for five seconds between each check.
Ansible will sleep for five seconds between each check.
default: 300 default: 300
type: int type: int
author: author:
- Darryl Stoflet (@dstoflet) - Darryl Stoflet (@dstoflet)
- Simon Kelly (@snopoke) - Simon Kelly (@snopoke)
''' """
EXAMPLES = ''' EXAMPLES = r"""
- name: Manage the state of program httpd to be in started state - name: Manage the state of program httpd to be in started state
community.general.monit: community.general.monit:
name: httpd name: httpd
state: started state: started
''' """
import time import time
import re import re

View File

@ -9,8 +9,7 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = r"""
---
module: mqtt module: mqtt
short_description: Publish a message on an MQTT topic for the IoT short_description: Publish a message on an MQTT topic for the IoT
description: description:
@ -26,12 +25,12 @@ options:
server: server:
type: str type: str
description: description:
- MQTT broker address/name - MQTT broker address/name.
default: localhost default: localhost
port: port:
type: int type: int
description: description:
- MQTT broker port number - MQTT broker port number.
default: 1883 default: 1883
username: username:
type: str type: str
@ -44,76 +43,67 @@ options:
client_id: client_id:
type: str type: str
description: description:
- MQTT client identifier - MQTT client identifier.
- If not specified, a value C(hostname + pid) will be used. - If not specified, a value C(hostname + pid) will be used.
topic: topic:
type: str type: str
description: description:
- MQTT topic name - MQTT topic name.
required: true required: true
payload: payload:
type: str type: str
description: description:
- Payload. The special string V("None") may be used to send a NULL - 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)
(that is, empty) payload which is useful to simply notify with the O(topic)
or to clear previously retained messages. or to clear previously retained messages.
required: true required: true
qos: qos:
type: str type: str
description: description:
- QoS (Quality of Service) - QoS (Quality of Service).
default: "0" default: "0"
choices: ["0", "1", "2"] choices: ["0", "1", "2"]
retain: retain:
description: description:
- Setting this flag causes the broker to retain (i.e. keep) the message so that - Setting this flag causes the broker to retain (in other words keep) the message so that applications that subsequently subscribe to the topic can
applications that subsequently subscribe to the topic can received the last received the last retained message immediately.
retained message immediately.
type: bool type: bool
default: false default: false
ca_cert: ca_cert:
type: path type: path
description: description:
- The path to the Certificate Authority certificate files that are to be - 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
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
then the client will operate in a similar manner to a web browser. That by the Certificate Authorities in ca_certs and will communicate using TLS v1, but will not attempt any form of authentication. This provides
is to say it will require the broker to have a certificate signed by the basic network encryption but may not be sufficient depending on how the broker is configured.
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] aliases: [ca_certs]
client_cert: client_cert:
type: path type: path
description: description:
- The path pointing to the PEM encoded client certificate. If this is not - 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.
None it will be used as client information for TLS based Support for this feature is broker dependent.
authentication. Support for this feature is broker dependent.
aliases: [certfile] aliases: [certfile]
client_key: client_key:
type: path type: path
description: description:
- The path pointing to the PEM encoded client private key. If this is not - 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.
None it will be used as client information for TLS based Support for this feature is broker dependent.
authentication. Support for this feature is broker dependent.
aliases: [keyfile] aliases: [keyfile]
tls_version: tls_version:
description: description:
- Specifies the version of the SSL/TLS protocol to be used. - Specifies the version of the SSL/TLS protocol to be used.
- By default (if the python version supports it) the highest TLS version is - By default (if the python version supports it) the highest TLS version is detected. If unavailable, TLS v1 is used.
detected. If unavailable, TLS v1 is used.
type: str type: str
choices: choices:
- tlsv1.1 - tlsv1.1
- tlsv1.2 - tlsv1.2
requirements: [mosquitto] requirements: [mosquitto]
notes: notes:
- This module requires a connection to an MQTT broker such as Mosquitto - This module requires a connection to an MQTT broker such as Mosquitto U(http://mosquitto.org) and the I(Paho) C(mqtt)
U(http://mosquitto.org) and the I(Paho) C(mqtt) Python client (U(https://pypi.org/project/paho-mqtt/)). Python client (U(https://pypi.org/project/paho-mqtt/)).
author: "Jan-Piet Mens (@jpmens)" author: "Jan-Piet Mens (@jpmens)"
''' """
EXAMPLES = ''' EXAMPLES = r"""
- name: Publish a message on an MQTT topic - name: Publish a message on an MQTT topic
community.general.mqtt: community.general.mqtt:
topic: 'service/ansible/{{ ansible_hostname }}' topic: 'service/ansible/{{ ansible_hostname }}'
@ -122,7 +112,7 @@ EXAMPLES = '''
retain: false retain: false
client_id: ans001 client_id: ans001
delegate_to: localhost delegate_to: localhost
''' """
# =========================================== # ===========================================
# MQTT module support methods. # MQTT module support methods.

View File

@ -10,8 +10,7 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = r"""
---
module: mssql_db module: mssql_db
short_description: Add or remove MSSQL databases from a remote host short_description: Add or remove MSSQL databases from a remote host
description: description:
@ -26,56 +25,54 @@ attributes:
options: options:
name: name:
description: description:
- name of the database to add or remove - Name of the database to add or remove.
required: true required: true
aliases: [db] aliases: [db]
type: str type: str
login_user: login_user:
description: description:
- The username used to authenticate with - The username used to authenticate with.
type: str type: str
default: '' default: ''
login_password: login_password:
description: description:
- The password used to authenticate with - The password used to authenticate with.
type: str type: str
default: '' default: ''
login_host: login_host:
description: description:
- Host running the database - Host running the database.
type: str type: str
required: true required: true
login_port: login_port:
description: 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' default: '1433'
type: str type: str
state: state:
description: description:
- The database state - The database state.
default: present default: present
choices: ["present", "absent", "import"] choices: ["present", "absent", "import"]
type: str type: str
target: target:
description: description:
- Location, on the remote host, of the dump file to read from or write to. Uncompressed SQL - Location, on the remote host, of the dump file to read from or write to. Uncompressed SQL files (C(.sql)) files are supported.
files (C(.sql)) files are supported.
type: str type: str
autocommit: autocommit:
description: 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 - Automatically commit the change only if the import succeed. Sometimes it is necessary to use autocommit=true, since some content can not
within a transaction. be changed within a transaction.
type: bool type: bool
default: false default: false
notes: notes:
- Requires the pymssql Python package on the remote host. For Ubuntu, this - Requires the pymssql Python package on the remote host. For Ubuntu, this is as easy as pip install pymssql (See M(ansible.builtin.pip)).
is as easy as pip install pymssql (See M(ansible.builtin.pip).)
requirements: requirements:
- pymssql - pymssql
author: Vedit Firat Arig (@vedit) author: Vedit Firat Arig (@vedit)
''' """
EXAMPLES = ''' EXAMPLES = r"""
- name: Create a new database with name 'jackdata' - name: Create a new database with name 'jackdata'
community.general.mssql_db: community.general.mssql_db:
name: jackdata name: jackdata
@ -92,11 +89,11 @@ EXAMPLES = '''
name: my_db name: my_db
state: import state: import
target: /tmp/dump.sql target: /tmp/dump.sql
''' """
RETURN = ''' RETURN = r"""
# #
''' """
import os import os
import traceback import traceback

View File

@ -7,8 +7,7 @@
from __future__ import (absolute_import, division, print_function) from __future__ import (absolute_import, division, print_function)
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = r''' DOCUMENTATION = r"""
---
module: mssql_script module: mssql_script
short_description: Execute SQL scripts on a MSSQL database short_description: Execute SQL scripts on a MSSQL database
@ -17,7 +16,6 @@ version_added: "4.0.0"
description: description:
- Execute SQL scripts on a MSSQL database. - Execute SQL scripts on a MSSQL database.
extends_documentation_fragment: extends_documentation_fragment:
- community.general.attributes - community.general.attributes
@ -58,8 +56,7 @@ options:
type: str type: str
transaction: transaction:
description: description:
- If transactional mode is requested, start a transaction and commit the change only if the script succeed. - If transactional mode is requested, start a transaction and commit the change only if the script succeed. Otherwise, rollback the transaction.
Otherwise, rollback the transaction.
- If transactional mode is not requested (default), automatically commit the change. - If transactional mode is not requested (default), automatically commit the change.
type: bool type: bool
default: false default: false
@ -73,21 +70,20 @@ options:
default: 'default' default: 'default'
type: str type: str
params: params:
description: | description: |-
Parameters passed to the script as SQL parameters. Parameters passed to the script as SQL parameters.
(Query V('SELECT %(name\)s"') with V(example: '{"name": "John Doe"}).)' (Query V('SELECT %(name\)s"') with V(example: '{"name": "John Doe"}).)'.
type: dict type: dict
notes: notes:
- Requires the pymssql Python package on the remote host. For Ubuntu, this - 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)).
is as easy as C(pip install pymssql) (See M(ansible.builtin.pip).)
requirements: requirements:
- pymssql - pymssql
author: author:
- Kris Budde (@kbudde) - Kris Budde (@kbudde)
''' """
EXAMPLES = r''' EXAMPLES = r"""
- name: Check DB connection - name: Check DB connection
community.general.mssql_script: community.general.mssql_script:
login_user: "{{ mssql_login_user }}" login_user: "{{ mssql_login_user }}"
@ -165,9 +161,9 @@ EXAMPLES = r'''
- result_batches_dict.query_results_dict[0] | length == 2 # two selects in first batch - 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] | 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[0][0][0]['b0s0'] == 'Batch 0 - Select 0' # column 'b0s0' of first row
''' """
RETURN = r''' RETURN = r"""
query_results: query_results:
description: List of batches (queries separated by V(GO) keyword). description: List of batches (queries separated by V(GO) keyword).
type: list type: list
@ -205,8 +201,8 @@ query_results_dict:
queries: queries:
description: description:
- List of result sets of each query. - 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. - 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
Use 'GO' keyword to separate queries. to separate queries.
type: list type: list
elements: list elements: list
contains: contains:
@ -222,7 +218,7 @@ query_results_dict:
type: dict type: dict
example: {"col_name": "Batch 0 - Select 0"} example: {"col_name": "Batch 0 - Select 0"}
returned: success, if output is dict returned: success, if output is dict
''' """
from ansible.module_utils.basic import AnsibleModule, missing_required_lib from ansible.module_utils.basic import AnsibleModule, missing_required_lib
import traceback import traceback

View File

@ -14,20 +14,19 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = r"""
---
module: nagios module: nagios
short_description: Perform common tasks in Nagios related to downtime and notifications short_description: Perform common tasks in Nagios related to downtime and notifications
description: 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. - 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 - 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. 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). - 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), - When specifying what service to handle there is a special service value, O(host), which will handle alerts/downtime/acknowledge for the I(host
for example O(services=host). This keyword may not be given with other services at the same time. itself), for example O(services=host). This keyword may not be given with other services at the same time. B(Setting alerts/downtime/acknowledge
B(Setting alerts/downtime/acknowledge for a host does not affect alerts/downtime/acknowledge for any of the services running on it.) 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
To schedule downtime for all services on particular host use keyword "all", for example O(services=all). host use keyword "all", for example O(services=all).
extends_documentation_fragment: extends_documentation_fragment:
- community.general.attributes - community.general.attributes
attributes: attributes:
@ -41,9 +40,8 @@ options:
- Action to take. - Action to take.
- The V(acknowledge) and V(forced_check) actions were added in community.general 1.2.0. - The V(acknowledge) and V(forced_check) actions were added in community.general 1.2.0.
required: true required: true
choices: [ "downtime", "delete_downtime", "enable_alerts", "disable_alerts", "silence", "unsilence", choices: ["downtime", "delete_downtime", "enable_alerts", "disable_alerts", "silence", "unsilence", "silence_nagios", "unsilence_nagios",
"silence_nagios", "unsilence_nagios", "command", "servicegroup_service_downtime", "command", "servicegroup_service_downtime", "servicegroup_host_downtime", "acknowledge", "forced_check"]
"servicegroup_host_downtime", "acknowledge", "forced_check" ]
type: str type: str
host: host:
description: description:
@ -51,13 +49,11 @@ options:
type: str type: str
cmdfile: cmdfile:
description: description:
- Path to the nagios I(command file) (FIFO pipe). - Path to the nagios I(command file) (FIFO pipe). Only required if auto-detection fails.
Only required if auto-detection fails.
type: str type: str
author: author:
description: description:
- Author to leave downtime comments as. - Author to leave downtime comments as. Only used when O(action) is V(downtime) or V(acknowledge).
Only used when O(action) is V(downtime) or V(acknowledge).
type: str type: str
default: Ansible default: Ansible
comment: comment:
@ -79,7 +75,7 @@ options:
services: services:
description: description:
- What to manage downtime/alerts for. Separate multiple services with commas. - 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)." - 'B(Required) option when O(action) is one of: V(downtime), V(acknowledge), V(forced_check), V(enable_alerts), V(disable_alerts).'
aliases: ["service"] aliases: ["service"]
type: str type: str
servicegroup: servicegroup:
@ -94,9 +90,9 @@ options:
type: str type: str
author: "Tim Bielawa (@tbielawa)" author: "Tim Bielawa (@tbielawa)"
''' """
EXAMPLES = ''' EXAMPLES = r"""
- name: Set 30 minutes of apache downtime - name: Set 30 minutes of apache downtime
community.general.nagios: community.general.nagios:
action: downtime action: downtime
@ -245,7 +241,7 @@ EXAMPLES = '''
community.general.nagios: community.general.nagios:
action: command action: command
command: DISABLE_FAILURE_PREDICTION command: DISABLE_FAILURE_PREDICTION
''' """
import time import time
import os.path import os.path

View File

@ -9,13 +9,12 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = r"""
---
module: netcup_dns module: netcup_dns
notes: [] notes: []
short_description: Manage Netcup DNS records short_description: Manage Netcup DNS records
description: 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: extends_documentation_fragment:
- community.general.attributes - community.general.attributes
attributes: attributes:
@ -26,12 +25,12 @@ attributes:
options: options:
api_key: api_key:
description: 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 required: true
type: str type: str
api_password: api_password:
description: 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 required: true
type: str type: str
customer_id: customer_id:
@ -91,10 +90,9 @@ options:
requirements: requirements:
- "nc-dnsapi >= 0.1.3" - "nc-dnsapi >= 0.1.3"
author: "Nicolai Buchwitz (@nbuchwitz)" author: "Nicolai Buchwitz (@nbuchwitz)"
"""
''' EXAMPLES = r"""
EXAMPLES = '''
- name: Create a record of type A - name: Create a record of type A
community.general.netcup_dns: community.general.netcup_dns:
api_key: "..." api_key: "..."
@ -156,41 +154,41 @@ EXAMPLES = '''
type: "A" type: "A"
value: "127.0.0.1" value: "127.0.0.1"
timeout: 30 timeout: 30
"""
''' RETURN = r"""
RETURN = '''
records: records:
description: list containing all records description: List containing all records.
returned: success returned: success
type: complex type: list
elements: dict
contains: contains:
name: name:
description: the record name description: The record name.
returned: success returned: success
type: str type: str
sample: fancy-hostname sample: fancy-hostname
type: type:
description: the record type description: The record type.
returned: success returned: success
type: str type: str
sample: A sample: A
value: value:
description: the record destination description: The record destination.
returned: success returned: success
type: str type: str
sample: 127.0.0.1 sample: 127.0.0.1
priority: priority:
description: the record priority (only relevant if type=MX) description: The record priority (only relevant if RV(records[].type=MX)).
returned: success returned: success
type: int type: int
sample: 0 sample: 0
id: id:
description: internal id of the record description: Internal id of the record.
returned: success returned: success
type: int type: int
sample: 12345 sample: 12345
''' """
import traceback import traceback

View File

@ -9,13 +9,12 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = r"""
---
module: newrelic_deployment module: newrelic_deployment
author: "Matt Coddington (@mcodd)" author: "Matt Coddington (@mcodd)"
short_description: Notify New Relic about app deployments short_description: Notify New Relic about app deployments
description: 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: extends_documentation_fragment:
- community.general.attributes - community.general.attributes
attributes: attributes:
@ -44,49 +43,48 @@ options:
changelog: changelog:
type: str type: str
description: description:
- A list of changes for this deployment - A list of changes for this deployment.
required: false required: false
description: description:
type: str type: str
description: description:
- Text annotation for the deployment - notes for you - Text annotation for the deployment - notes for you.
required: false required: false
revision: revision:
type: str type: str
description: description:
- A revision number (e.g., git commit SHA) - A revision number (for example, git commit SHA).
required: true required: true
user: user:
type: str type: str
description: description:
- The name of the user/process that triggered this deployment - The name of the user/process that triggered this deployment.
required: false required: false
validate_certs: validate_certs:
description: description:
- If V(false), SSL certificates will not be validated. This should only be used - If V(false), SSL certificates will not be validated. This should only be used on personally controlled sites using self-signed certificates.
on personally controlled sites using self-signed certificates.
required: false required: false
default: true default: true
type: bool type: bool
app_name_exact_match: app_name_exact_match:
type: bool type: bool
description: description:
- If this flag is set to V(true) then the application ID lookup by name would only work for an exact match. - 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
If set to V(false) it returns the first result. the first result.
required: false required: false
default: false default: false
version_added: 7.5.0 version_added: 7.5.0
requirements: [] requirements: []
''' """
EXAMPLES = ''' EXAMPLES = r"""
- name: Notify New Relic about an app deployment - name: Notify New Relic about an app deployment
community.general.newrelic_deployment: community.general.newrelic_deployment:
token: AAAAAA token: AAAAAA
app_name: myapp app_name: myapp
user: ansible deployment user: ansible deployment
revision: '1.0' revision: '1.0'
''' """
from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.urls import fetch_url from ansible.module_utils.urls import fetch_url

View File

@ -9,11 +9,11 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = r"""
module: nexmo module: nexmo
short_description: Send a SMS via nexmo short_description: Send a SMS using nexmo
description: description:
- Send a SMS message via nexmo - Send a SMS message using nexmo.
author: "Matt Martz (@sivel)" author: "Matt Martz (@sivel)"
attributes: attributes:
check_mode: check_mode:
@ -24,42 +24,40 @@ options:
api_key: api_key:
type: str type: str
description: description:
- Nexmo API Key - Nexmo API Key.
required: true required: true
api_secret: api_secret:
type: str type: str
description: description:
- Nexmo API Secret - Nexmo API Secret.
required: true required: true
src: src:
type: int type: int
description: description:
- Nexmo Number to send from - Nexmo Number to send from.
required: true required: true
dest: dest:
type: list type: list
elements: int elements: int
description: description:
- Phone number(s) to send SMS message to - Phone number(s) to send SMS message to.
required: true required: true
msg: msg:
type: str type: str
description: description:
- Message to text to send. Messages longer than 160 characters will be - Message to text to send. Messages longer than 160 characters will be split into multiple messages.
split into multiple messages
required: true required: true
validate_certs: validate_certs:
description: description:
- If V(false), SSL certificates will not be validated. This should only be used - If V(false), SSL certificates will not be validated. This should only be used on personally controlled sites using self-signed certificates.
on personally controlled sites using self-signed certificates.
type: bool type: bool
default: true default: true
extends_documentation_fragment: extends_documentation_fragment:
- ansible.builtin.url - ansible.builtin.url
- community.general.attributes - community.general.attributes
''' """
EXAMPLES = """ EXAMPLES = r"""
- name: Send notification message via Nexmo - name: Send notification message via Nexmo
community.general.nexmo: community.general.nexmo:
api_key: 640c8a53 api_key: 640c8a53

View File

@ -9,8 +9,7 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = r''' DOCUMENTATION = r"""
---
module: nginx_status_info module: nginx_status_info
short_description: Retrieve information on nginx status short_description: Retrieve information on nginx status
description: description:
@ -34,9 +33,9 @@ options:
notes: notes:
- See U(http://nginx.org/en/docs/http/ngx_http_stub_status_module.html) for more information. - 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 # Gather status info from nginx on localhost
- name: Get current http stats - name: Get current http stats
community.general.nginx_status_info: community.general.nginx_status_info:
@ -49,10 +48,9 @@ EXAMPLES = r'''
url: http://localhost/nginx_status url: http://localhost/nginx_status
timeout: 20 timeout: 20
register: result register: result
''' """
RETURN = r''' RETURN = r"""
---
active_connections: active_connections:
description: Active connections. description: Active connections.
returned: success returned: success
@ -64,7 +62,8 @@ accepts:
type: int type: int
sample: 81769947 sample: 81769947
handled: 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 returned: success
type: int type: int
sample: 81769947 sample: 81769947
@ -93,7 +92,7 @@ data:
returned: success returned: success
type: str type: str
sample: "Active connections: 2340 \nserver accepts handled requests\n 81769947 81769947 144332345 \nReading: 0 Writing: 241 Waiting: 2092 \n" sample: "Active connections: 2340 \nserver accepts handled requests\n 81769947 81769947 144332345 \nReading: 0 Writing: 241 Waiting: 2092 \n"
''' """
import re import re
from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.basic import AnsibleModule

View File

@ -8,8 +8,7 @@
from __future__ import absolute_import, division, print_function from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = r''' DOCUMENTATION = r"""
---
module: nictagadm module: nictagadm
short_description: Manage nic tags on SmartOS systems short_description: Manage nic tags on SmartOS systems
description: description:
@ -56,9 +55,9 @@ options:
type: str type: str
choices: [absent, present] choices: [absent, present]
default: present default: present
''' """
EXAMPLES = r''' EXAMPLES = r"""
- name: Create 'storage0' on '00:1b:21:a3:f5:4d' - name: Create 'storage0' on '00:1b:21:a3:f5:4d'
community.general.nictagadm: community.general.nictagadm:
name: storage0 name: storage0
@ -70,11 +69,11 @@ EXAMPLES = r'''
community.general.nictagadm: community.general.nictagadm:
name: storage0 name: storage0
state: absent state: absent
''' """
RETURN = r''' RETURN = r"""
name: name:
description: nic tag name description: Nic tag name.
returned: always returned: always
type: str type: str
sample: storage0 sample: storage0
@ -84,26 +83,26 @@ mac:
type: str type: str
sample: 00:1b:21:a3:f5:4d sample: 00:1b:21:a3:f5:4d
etherstub: 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 returned: always
type: bool type: bool
sample: false sample: false
mtu: 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 returned: always
type: int type: int
sample: 1500 sample: 1500
force: 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 returned: always
type: bool type: bool
sample: false sample: false
state: state:
description: state of the target description: State of the target.
returned: always returned: always
type: str type: str
sample: present sample: present
''' """
from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.common.network import is_mac from ansible.module_utils.common.network import is_mac

View File

@ -9,8 +9,7 @@
from __future__ import absolute_import, division, print_function from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = r''' DOCUMENTATION = r"""
---
module: nmcli module: nmcli
author: author:
- Chris Long (@alcamie101) - Chris Long (@alcamie101)
@ -20,10 +19,10 @@ requirements:
extends_documentation_fragment: extends_documentation_fragment:
- community.general.attributes - community.general.attributes
description: description:
- 'Manage the network devices. Create, modify and manage various connection and device type e.g., ethernet, teams, bonds, vlans etc.' - 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 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 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 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.' - 'On openSUSE, the requirements can be met by installing the following packages: NetworkManager.'
attributes: attributes:
check_mode: check_mode:
@ -35,19 +34,20 @@ options:
description: description:
- Whether the device should exist or not, taking action if the state is different from what is stated. - 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=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. - 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 type: str
required: true required: true
choices: [absent, present, up, down] choices: [absent, present, up, down]
autoconnect: autoconnect:
description: description:
- Whether the connection should start on boot. - Whether the connection should start on boot.
- Whether the connection profile can be automatically activated - Whether the connection profile can be automatically activated.
type: bool type: bool
default: true default: true
conn_name: conn_name:
description: description:
- The name used to call the connection. Pattern is <type>[-<ifname>][-<num>]. - The name used to call the connection. Pattern is V(<type>[-<ifname>][-<num>]).
type: str type: str
required: true required: true
conn_reload: conn_reload:
@ -61,7 +61,7 @@ options:
description: description:
- The interface to bind the connection to. - The interface to bind the connection to.
- The connection will only be applicable to this interface name. - The connection will only be applicable to this interface name.
- A special value of V('*') can be used for interface-independent connections. - 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. - 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. - This parameter defaults to O(conn_name) when left unset for all connection types except vpn that removes it.
type: str type: str
@ -323,7 +323,7 @@ options:
version_added: 3.2.0 version_added: 3.2.0
method6: method6:
description: description:
- Configuration method to be used for IPv6 - 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. - 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. - V(disabled) was added in community.general 3.3.0.
type: str type: str
@ -344,8 +344,8 @@ options:
version_added: 4.2.0 version_added: 4.2.0
mtu: mtu:
description: description:
- The connection MTU, e.g. 9000. This can't be applied when creating the interface and is done once the interface has been created. - 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) - Can be used when modifying Team, VLAN, Ethernet (Future plans to implement wifi, gsm, pppoe, infiniband).
- This parameter defaults to V(1500) when unset. - This parameter defaults to V(1500) when unset.
type: int type: int
dhcp_client_id: dhcp_client_id:
@ -424,13 +424,13 @@ options:
default: 32 default: 32
path_cost: path_cost:
description: description:
- This is only used with 'bridge-slave' - [<1-65535>] - STP port cost for destinations via this slave. - This is only used with 'bridge-slave' - [<1-65535>] - STP port cost for destinations using this slave.
type: int type: int
default: 100 default: 100
hairpin: hairpin:
description: 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 - 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
frame was received on. was received on.
- The default change to V(false) in community.general 7.0.0. It used to be V(true) before. - The default change to V(false) in community.general 7.0.0. It used to be V(true) before.
type: bool type: bool
default: false default: false
@ -443,16 +443,14 @@ options:
version_added: 3.4.0 version_added: 3.4.0
runner_hwaddr_policy: runner_hwaddr_policy:
description: description:
- This defines the policy of how hardware addresses of team device and port devices - This defines the policy of how hardware addresses of team device and port devices should be set during the team lifetime.
should be set during the team lifetime.
type: str type: str
choices: [same_all, by_active, only_active] choices: [same_all, by_active, only_active]
version_added: 3.4.0 version_added: 3.4.0
runner_fast_rate: runner_fast_rate:
description: description:
- Option specifies the rate at which our link partner is asked to transmit LACPDU - 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
packets. If this is V(true) then packets will be sent once per second. Otherwise they once per second. Otherwise they will be sent every 30 seconds.
will be sent every 30 seconds.
- Only allowed for O(runner=lacp). - Only allowed for O(runner=lacp).
type: bool type: bool
version_added: 6.5.0 version_added: 6.5.0
@ -522,35 +520,32 @@ options:
description: description:
- The security configuration of the WiFi connection. - 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. - 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: - '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).'
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}).'
- 'For instance to use common WPA-PSK auth with a password:
V({key-mgmt: wpa-psk, psk: my_password}).'
type: dict type: dict
suboptions: suboptions:
auth-alg: auth-alg:
description: description:
- When WEP is used (that is, if O(wifi_sec.key-mgmt) is V(none) or V(ieee8021x)) indicate the 802.11 - 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
authentication algorithm required by the AP here. by the AP here.
- One of V(open) for Open System, V(shared) for Shared Key, or V(leap) for Cisco LEAP. - 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)) - 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
the O(wifi_sec.leap-username) and O(wifi_sec.leap-password) properties O(wifi_sec.leap-password) properties must be specified.
must be specified.
type: str type: str
choices: [open, shared, leap] choices: [open, shared, leap]
fils: fils:
description: description:
- Indicates whether Fast Initial Link Setup (802.11ai) must be enabled for the connection. - 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) - 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)
(enable FILS and fail if not supported). 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. - When set to V(0) and no global default is set, FILS will be optionally enabled.
type: int type: int
choices: [0, 1, 2, 3] choices: [0, 1, 2, 3]
default: 0 default: 0
group: group:
description: description:
- A list of group/broadcast encryption algorithms which prevents connections to Wi-Fi networks that do not utilize one of the algorithms in - A list of group/broadcast encryption algorithms which prevents connections to Wi-Fi networks that do not utilize one of the algorithms
the list. in the list.
- For maximum compatibility leave this property empty. - For maximum compatibility leave this property empty.
type: list type: list
elements: str elements: str
@ -558,8 +553,9 @@ options:
key-mgmt: key-mgmt:
description: description:
- Key management used for the connection. - Key management used for the connection.
- One of V(none) (WEP or no password protection), V(ieee8021x) (Dynamic WEP), V(owe) (Opportunistic Wireless Encryption), V(wpa-psk) (WPA2 - One of V(none) (WEP or no password protection), V(ieee8021x) (Dynamic WEP), V(owe) (Opportunistic Wireless Encryption), V(wpa-psk)
+ WPA3 personal), V(sae) (WPA3 personal only), V(wpa-eap) (WPA2 + WPA3 enterprise) or V(wpa-eap-suite-b-192) (WPA3 enterprise only). (WPA2 + WPA3 personal), V(sae) (WPA3 personal only), V(wpa-eap) (WPA2 + WPA3 enterprise) or V(wpa-eap-suite-b-192) (WPA3 enterprise
only).
- This property must be set for any Wi-Fi connection that uses security. - This property must be set for any Wi-Fi connection that uses security.
type: str type: str
choices: [none, ieee8021x, owe, wpa-psk, sae, wpa-eap, wpa-eap-suite-b-192] choices: [none, ieee8021x, owe, wpa-psk, sae, wpa-eap, wpa-eap-suite-b-192]
@ -575,8 +571,8 @@ options:
type: str type: str
pairwise: pairwise:
description: description:
- A list of pairwise encryption algorithms which prevents connections to Wi-Fi networks that do not utilize one of the algorithms in the - A list of pairwise encryption algorithms which prevents connections to Wi-Fi networks that do not utilize one of the algorithms in
list. the list.
- For maximum compatibility leave this property empty. - For maximum compatibility leave this property empty.
type: list type: list
elements: str elements: str
@ -584,8 +580,8 @@ options:
pmf: pmf:
description: description:
- Indicates whether Protected Management Frames (802.11w) must be enabled for the connection. - Indicates whether Protected Management Frames (802.11w) must be enabled for the connection.
- One of V(0) (use global default value), V(1) (disable PMF), V(2) (enable PMF if the - One of V(0) (use global default value), V(1) (disable PMF), V(2) (enable PMF if the supplicant and the access point support it) or
supplicant and the access point support it) or V(3) (enable PMF and fail if not supported). V(3) (enable PMF and fail if not supported).
- When set to V(0) and no global default is set, PMF will be optionally enabled. - When set to V(0) and no global default is set, PMF will be optionally enabled.
type: int type: int
choices: [0, 1, 2, 3] choices: [0, 1, 2, 3]
@ -605,23 +601,21 @@ options:
psk: psk:
description: description:
- Pre-Shared-Key for WPA networks. - Pre-Shared-Key for WPA networks.
- For WPA-PSK, it is either an ASCII passphrase of 8 to 63 characters that is - For WPA-PSK, it is either an ASCII passphrase of 8 to 63 characters that is (as specified in the 802.11i standard) hashed to derive
(as specified in the 802.11i standard) hashed to derive the the actual key, or the key in form of 64 hexadecimal character.
actual key, or the key in form of 64 hexadecimal character.
- The WPA3-Personal networks use a passphrase of any length for SAE authentication. - The WPA3-Personal networks use a passphrase of any length for SAE authentication.
type: str type: str
wep-key-flags: wep-key-flags:
description: description:
- Flags indicating how to handle the O(wifi_sec.wep-key0), O(wifi_sec.wep-key1), - Flags indicating how to handle the O(wifi_sec.wep-key0), O(wifi_sec.wep-key1), O(wifi_sec.wep-key2), and O(wifi_sec.wep-key3) properties.
O(wifi_sec.wep-key2), and O(wifi_sec.wep-key3) properties.
type: list type: list
elements: int elements: int
wep-key-type: wep-key-type:
description: description:
- Controls the interpretation of WEP keys. - Controls the interpretation of WEP keys.
- Allowed values are V(1), in which case the key is either a 10- or 26-character hexadecimal string, or a 5- or 13-character ASCII - Allowed values are V(1), in which case the key is either a 10- or 26-character hexadecimal string, or a 5- or 13-character ASCII password;
password; or V(2), in which case the passphrase is provided as a string and will be hashed using the de-facto MD5 method to derive the or V(2), in which case the passphrase is provided as a string and will be hashed using the de-facto MD5 method to derive the actual
actual WEP key. WEP key.
type: int type: int
choices: [1, 2] choices: [1, 2]
wep-key0: wep-key0:
@ -646,8 +640,8 @@ options:
type: str type: str
wep-tx-keyidx: wep-tx-keyidx:
description: description:
- When static WEP is used (that is, if O(wifi_sec.key-mgmt=none)) and a non-default WEP key index - When static WEP is used (that is, if O(wifi_sec.key-mgmt=none)) and a non-default WEP key index is used by the AP, put that WEP key
is used by the AP, put that WEP key index here. index here.
- Valid values are V(0) (default key) through V(3). - Valid values are V(0) (default key) through V(3).
- Note that some consumer access points (like the Linksys WRT54G) number the keys V(1) to V(4). - Note that some consumer access points (like the Linksys WRT54G) number the keys V(1) to V(4).
type: int type: int
@ -656,8 +650,8 @@ options:
wps-method: wps-method:
description: description:
- Flags indicating which mode of WPS is to be used if any. - Flags indicating which mode of WPS is to be used if any.
- There is little point in changing the default setting as NetworkManager will automatically determine whether it is feasible to start WPS - There is little point in changing the default setting as NetworkManager will automatically determine whether it is feasible to start
enrollment from the Access Point capabilities. WPS enrollment from the Access Point capabilities.
- WPS can be disabled by setting this property to a value of V(1). - WPS can be disabled by setting this property to a value of V(1).
type: int type: int
default: 0 default: 0
@ -671,10 +665,8 @@ options:
description: description:
- The configuration of the WiFi connection. - The 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. - 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: - 'An up-to-date list of supported attributes can be found here: U(https://networkmanager.dev/docs/api/latest/settings-802-11-wireless.html).'
U(https://networkmanager.dev/docs/api/latest/settings-802-11-wireless.html).' - 'For instance to create a hidden AP mode WiFi connection: V({hidden: true, mode: ap}).'
- 'For instance to create a hidden AP mode WiFi connection:
V({hidden: true, mode: ap}).'
type: dict type: dict
suboptions: suboptions:
ap-isolation: ap-isolation:
@ -683,7 +675,7 @@ options:
- This property can be set to a value different from V(-1) only when the interface is configured in AP mode. - This property can be set to a value different from V(-1) only when the interface is configured in AP mode.
- If set to V(1), devices are not able to communicate with each other. This increases security because it protects devices against attacks - If set to V(1), devices are not able to communicate with each other. This increases security because it protects devices against attacks
from other clients in the network. At the same time, it prevents devices to access resources on the same wireless networks as file from other clients in the network. At the same time, it prevents devices to access resources on the same wireless networks as file
shares, printers, etc. shares, printers, and so on.
- If set to V(0), devices can talk to each other. - If set to V(0), devices can talk to each other.
- When set to V(-1), the global default is used; in case the global default is unspecified it is assumed to be V(0). - When set to V(-1), the global default is used; in case the global default is unspecified it is assumed to be V(0).
type: int type: int
@ -701,8 +693,8 @@ options:
description: description:
- 802.11 frequency band of the network. - 802.11 frequency band of the network.
- One of V(a) for 5GHz 802.11a or V(bg) for 2.4GHz 802.11. - One of V(a) for 5GHz 802.11a or V(bg) for 2.4GHz 802.11.
- This will lock associations to the Wi-Fi network to the specific band, so for example, if V(a) is specified, the device will not - This will lock associations to the Wi-Fi network to the specific band, so for example, if V(a) is specified, the device will not associate
associate with the same network in the 2.4GHz band even if the network's settings are compatible. with the same network in the 2.4GHz band even if the network's settings are compatible.
- This setting depends on specific driver capability and may not work with all drivers. - This setting depends on specific driver capability and may not work with all drivers.
type: str type: str
choices: [a, bg] choices: [a, bg]
@ -721,39 +713,39 @@ options:
default: 0 default: 0
cloned-mac-address: cloned-mac-address:
description: description:
- This D-Bus field is deprecated in favor of O(wifi.assigned-mac-address) which is more flexible and allows specifying special variants like - This D-Bus field is deprecated in favor of O(wifi.assigned-mac-address) which is more flexible and allows specifying special variants
V(random). like V(random).
- For libnm and nmcli, this field is called C(cloned-mac-address). - For libnm and nmcli, this field is called C(cloned-mac-address).
type: str type: str
generate-mac-address-mask: generate-mac-address-mask:
description: description:
- With O(wifi.cloned-mac-address) setting V(random) or V(stable), by default all bits of the MAC address are scrambled and a - With O(wifi.cloned-mac-address) setting V(random) or V(stable), by default all bits of the MAC address are scrambled and a locally-administered,
locally-administered, unicast MAC address is created. This property allows to specify that certain bits are fixed. unicast MAC address is created. This property allows to specify that certain bits are fixed.
- Note that the least significant bit of the first MAC address will always be unset to create a unicast MAC address. - Note that the least significant bit of the first MAC address will always be unset to create a unicast MAC address.
- If the property is V(null), it is eligible to be overwritten by a default connection setting. - If the property is V(null), it is eligible to be overwritten by a default connection setting.
- If the value is still V(null) or an empty string, the default is to create a locally-administered, unicast MAC address. - If the value is still V(null) or an empty string, the default is to create a locally-administered, unicast MAC address.
- If the value contains one MAC address, this address is used as mask. The set bits of the mask are to be filled with the current MAC - If the value contains one MAC address, this address is used as mask. The set bits of the mask are to be filled with the current MAC
address of the device, while the unset bits are subject to randomization. address of the device, while the unset bits are subject to randomization.
- Setting V(FE:FF:FF:00:00:00) means to preserve the OUI of the current MAC address and only randomize the lower 3 bytes using the - Setting V(FE:FF:FF:00:00:00) means to preserve the OUI of the current MAC address and only randomize the lower 3 bytes using the V(random)
V(random) or V(stable) algorithm. or V(stable) algorithm.
- If the value contains one additional MAC address after the mask, this address is used instead of the current MAC address to fill the bits - If the value contains one additional MAC address after the mask, this address is used instead of the current MAC address to fill the
that shall not be randomized. bits that shall not be randomized.
- For example, a value of V(FE:FF:FF:00:00:00 68:F7:28:00:00:00) will set the OUI of the MAC address to 68:F7:28, while the lower bits are - For example, a value of V(FE:FF:FF:00:00:00 68:F7:28:00:00:00) will set the OUI of the MAC address to 68:F7:28, while the lower bits
randomized. are randomized.
- A value of V(02:00:00:00:00:00 00:00:00:00:00:00) will create a fully scrambled globally-administered, burned-in MAC address. - A value of V(02:00:00:00:00:00 00:00:00:00:00:00) will create a fully scrambled globally-administered, burned-in MAC address.
- If the value contains more than one additional MAC addresses, one of them is chosen randomly. For example, - If the value contains more than one additional MAC addresses, one of them is chosen randomly. For example, V(02:00:00:00:00:00 00:00:00:00:00:00
V(02:00:00:00:00:00 00:00:00:00:00:00 02:00:00:00:00:00) will create a fully scrambled MAC address, randomly locally or globally 02:00:00:00:00:00) will create a fully scrambled MAC address, randomly locally or globally administered.
administered.
type: str type: str
hidden: hidden:
description: description:
- If V(true), indicates that the network is a non-broadcasting network that hides its SSID. This works both in infrastructure and AP mode. - If V(true), indicates that the network is a non-broadcasting network that hides its SSID. This works both in infrastructure and AP
- In infrastructure mode, various workarounds are used for a more reliable discovery of hidden networks, such as probe-scanning the SSID. mode.
However, these workarounds expose inherent insecurities with hidden SSID networks, and thus hidden SSID networks should be used with - In infrastructure mode, various workarounds are used for a more reliable discovery of hidden networks, such as probe-scanning the
caution. SSID. However, these workarounds expose inherent insecurities with hidden SSID networks, and thus hidden SSID networks should be used
with caution.
- In AP mode, the created network does not broadcast its SSID. - In AP mode, the created network does not broadcast its SSID.
- Note that marking the network as hidden may be a privacy issue for you (in infrastructure mode) or client stations (in AP mode), as the - Note that marking the network as hidden may be a privacy issue for you (in infrastructure mode) or client stations (in AP mode), as
explicit probe-scans are distinctly recognizable on the air. the explicit probe-scans are distinctly recognizable on the air.
type: bool type: bool
default: false default: false
mac-address-blacklist: mac-address-blacklist:
@ -786,8 +778,8 @@ options:
default: 0 default: 0
powersave: powersave:
description: description:
- One of V(2) (disable Wi-Fi power saving), V(3) (enable Wi-Fi power saving), V(1) (don't touch currently configure setting) or V(0) (use - One of V(2) (disable Wi-Fi power saving), V(3) (enable Wi-Fi power saving), V(1) (do not touch currently configure setting) or V(0)
the globally configured value). (use the globally configured value).
- All other values are reserved. - All other values are reserved.
type: int type: int
default: 0 default: 0
@ -812,8 +804,8 @@ options:
- May be any combination of C(NM_SETTING_WIRELESS_WAKE_ON_WLAN_ANY) (V(0x2)), C(NM_SETTING_WIRELESS_WAKE_ON_WLAN_DISCONNECT) (V(0x4)), - May be any combination of C(NM_SETTING_WIRELESS_WAKE_ON_WLAN_ANY) (V(0x2)), C(NM_SETTING_WIRELESS_WAKE_ON_WLAN_DISCONNECT) (V(0x4)),
C(NM_SETTING_WIRELESS_WAKE_ON_WLAN_MAGIC) (V(0x8)), C(NM_SETTING_WIRELESS_WAKE_ON_WLAN_GTK_REKEY_FAILURE) (V(0x10)), C(NM_SETTING_WIRELESS_WAKE_ON_WLAN_MAGIC) (V(0x8)), C(NM_SETTING_WIRELESS_WAKE_ON_WLAN_GTK_REKEY_FAILURE) (V(0x10)),
C(NM_SETTING_WIRELESS_WAKE_ON_WLAN_EAP_IDENTITY_REQUEST) (V(0x20)), C(NM_SETTING_WIRELESS_WAKE_ON_WLAN_4WAY_HANDSHAKE) (V(0x40)), C(NM_SETTING_WIRELESS_WAKE_ON_WLAN_EAP_IDENTITY_REQUEST) (V(0x20)), C(NM_SETTING_WIRELESS_WAKE_ON_WLAN_4WAY_HANDSHAKE) (V(0x40)),
C(NM_SETTING_WIRELESS_WAKE_ON_WLAN_RFKILL_RELEASE) (V(0x80)), C(NM_SETTING_WIRELESS_WAKE_ON_WLAN_TCP) (V(0x100)) or the special values C(NM_SETTING_WIRELESS_WAKE_ON_WLAN_RFKILL_RELEASE) (V(0x80)), C(NM_SETTING_WIRELESS_WAKE_ON_WLAN_TCP) (V(0x100)) or the special values V(0x1)
V(0x1) (to use global settings) and V(0x8000) (to disable management of Wake-on-LAN in NetworkManager). (to use global settings) and V(0x8000) (to disable management of Wake-on-LAN in NetworkManager).
- Note the option values' sum must be specified in order to combine multiple options. - Note the option values' sum must be specified in order to combine multiple options.
type: int type: int
default: 1 default: 1
@ -829,23 +821,21 @@ options:
description: description:
- The configuration of the GSM connection. - The configuration of the GSM connection.
- Note the list of suboption attributes may vary depending on which version of NetworkManager/nmcli is installed on the host. - 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: - 'An up-to-date list of supported attributes can be found here: U(https://networkmanager.dev/docs/api/latest/settings-gsm.html).'
U(https://networkmanager.dev/docs/api/latest/settings-gsm.html).' - 'For instance to use apn, pin, username and password: V({apn: provider.apn, pin: 1234, username: apn.username, password: apn.password}).'
- 'For instance to use apn, pin, username and password:
V({apn: provider.apn, pin: 1234, username: apn.username, password: apn.password}).'
type: dict type: dict
version_added: 3.7.0 version_added: 3.7.0
suboptions: suboptions:
apn: apn:
description: description:
- The GPRS Access Point Name specifying the APN used when establishing a data session with the GSM-based network. - The GPRS Access Point Name specifying the APN used when establishing a data session with the GSM-based network.
- The APN often determines how the user will be billed for their network usage and whether the user has access to the Internet or - The APN often determines how the user will be billed for their network usage and whether the user has access to the Internet or just
just a provider-specific walled-garden, so it is important to use the correct APN for the user's mobile broadband plan. a provider-specific walled-garden, so it is important to use the correct APN for the user's mobile broadband plan.
- The APN may only be composed of the characters a-z, 0-9, ., and - per GSM 03.60 Section 14.9. - The APN may only be composed of the characters a-z, 0-9, ., and - per GSM 03.60 Section 14.9.
type: str type: str
auto-config: auto-config:
description: When V(true), the settings such as O(gsm.apn), O(gsm.username), or O(gsm.password) will default to values that match the network description: When V(true), the settings such as O(gsm.apn), O(gsm.username), or O(gsm.password) will default to values that match the
the modem will register to in the Mobile Broadband Provider database. network the modem will register to in the Mobile Broadband Provider database.
type: bool type: bool
default: false default: false
device-id: device-id:
@ -881,13 +871,11 @@ options:
password-flags: password-flags:
description: description:
- NMSettingSecretFlags indicating how to handle the O(gsm.password) property. - NMSettingSecretFlags indicating how to handle the O(gsm.password) property.
- 'Following choices are allowed: - 'Following choices are allowed: V(0) B(NONE): The system is responsible for providing and storing this secret (default), V(1) B(AGENT_OWNED):
V(0) B(NONE): The system is responsible for providing and storing this secret (default), A user secret agent is responsible for providing and storing this secret; when it is required agents will be asked to retrieve it
V(1) B(AGENT_OWNED): A user secret agent is responsible for providing and storing this secret; when it is required agents will be V(2) B(NOT_SAVED): This secret should not be saved, but should be requested from the user each time it is needed V(4) B(NOT_REQUIRED):
asked to retrieve it In situations where it cannot be automatically determined that the secret is required (some VPNs and PPP providers do not require
V(2) B(NOT_SAVED): This secret should not be saved, but should be requested from the user each time it is needed all secrets) this flag indicates that the specific secret is not required.'
V(4) B(NOT_REQUIRED): In situations where it cannot be automatically determined that the secret is required
(some VPNs and PPP providers do not require all secrets) this flag indicates that the specific secret is not required.'
type: int type: int
choices: [0, 1, 2, 4] choices: [0, 1, 2, 4]
default: 0 default: 0
@ -906,14 +894,13 @@ options:
sim-id: sim-id:
description: description:
- The SIM card unique identifier (as given by the C(WWAN) management service) which this connection applies to. - The SIM card unique identifier (as given by the C(WWAN) management service) which this connection applies to.
- 'If given, the connection will apply to any device also allowed by O(gsm.device-id) which contains a SIM card matching - If given, the connection will apply to any device also allowed by O(gsm.device-id) which contains a SIM card matching the given identifier.
the given identifier.'
type: str type: str
sim-operator-id: sim-operator-id:
description: description:
- A MCC/MNC string like V(310260) or V(21601I) identifying the specific mobile network operator which this connection applies to. - A MCC/MNC string like V(310260) or V(21601I) identifying the specific mobile network operator which this connection applies to.
- 'If given, the connection will apply to any device also allowed by O(gsm.device-id) and O(gsm.sim-id) which contains a SIM card - If given, the connection will apply to any device also allowed by O(gsm.device-id) and O(gsm.sim-id) which contains a SIM card provisioned
provisioned by the given operator.' by the given operator.
type: str type: str
username: username:
description: description:
@ -924,24 +911,21 @@ options:
description: description:
- The configuration of the MAC VLAN connection. - The configuration of the MAC VLAN connection.
- Note the list of suboption attributes may vary depending on which version of NetworkManager/nmcli is installed on the host. - 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: - 'An up-to-date list of supported attributes can be found here: U(https://networkmanager.dev/docs/api/latest/settings-macvlan.html).'
U(https://networkmanager.dev/docs/api/latest/settings-macvlan.html).'
type: dict type: dict
version_added: 6.6.0 version_added: 6.6.0
suboptions: suboptions:
mode: mode:
description: description:
- The macvlan mode, which specifies the communication mechanism between multiple macvlans on the same lower device. - The macvlan mode, which specifies the communication mechanism between multiple macvlans on the same lower device.
- 'Following choices are allowed: V(1) B(vepa), V(2) B(bridge), V(3) B(private), V(4) B(passthru) - 'Following choices are allowed: V(1) B(vepa), V(2) B(bridge), V(3) B(private), V(4) B(passthru) and V(5) B(source).'
and V(5) B(source)'
type: int type: int
choices: [1, 2, 3, 4, 5] choices: [1, 2, 3, 4, 5]
required: true required: true
parent: parent:
description: description:
- If given, specifies the parent interface name or parent connection UUID from which this MAC-VLAN interface should - If given, specifies the parent interface name or parent connection UUID from which this MAC-VLAN interface should be created. If this
be created. If this property is not specified, the connection must contain an "802-3-ethernet" setting with a property is not specified, the connection must contain an "802-3-ethernet" setting with a "mac-address" property.
"mac-address" property.
type: str type: str
required: true required: true
promiscuous: promiscuous:
@ -956,10 +940,8 @@ options:
description: description:
- The configuration of the Wireguard connection. - The configuration of the Wireguard connection.
- Note the list of suboption attributes may vary depending on which version of NetworkManager/nmcli is installed on the host. - 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: - 'An up-to-date list of supported attributes can be found here: U(https://networkmanager.dev/docs/api/latest/settings-wireguard.html).'
U(https://networkmanager.dev/docs/api/latest/settings-wireguard.html).' - 'For instance to configure a listen port: V({listen-port: 12345}).'
- 'For instance to configure a listen port:
V({listen-port: 12345}).'
type: dict type: dict
version_added: 4.3.0 version_added: 4.3.0
suboptions: suboptions:
@ -972,24 +954,23 @@ options:
ip4-auto-default-route: ip4-auto-default-route:
description: description:
- Whether to enable special handling of the IPv4 default route. - Whether to enable special handling of the IPv4 default route.
- If enabled, the IPv4 default route from O(wireguard.peer-routes) will be placed to a dedicated routing-table and two policy - If enabled, the IPv4 default route from O(wireguard.peer-routes) will be placed to a dedicated routing-table and two policy routing
routing rules will be added. rules will be added.
- The fwmark number is also used as routing-table for the default-route, and if fwmark is zero, an unused fwmark/table is chosen - The fwmark number is also used as routing-table for the default-route, and if fwmark is zero, an unused fwmark/table is chosen automatically.
automatically. This corresponds to what wg-quick does with Table=auto and what WireGuard calls "Improved Rule-based Routing" This corresponds to what wg-quick does with Table=auto and what WireGuard calls "Improved Rule-based Routing".
type: bool type: bool
ip6-auto-default-route: ip6-auto-default-route:
description: description:
- Like O(wireguard.ip4-auto-default-route), but for the IPv6 default route. - Like O(wireguard.ip4-auto-default-route), but for the IPv6 default route.
type: bool type: bool
listen-port: listen-port:
description: The WireGuard connection listen-port. If not specified, the port will be chosen randomly when the description: The WireGuard connection listen-port. If not specified, the port will be chosen randomly when the interface comes up.
interface comes up.
type: int type: int
mtu: mtu:
description: description:
- If non-zero, only transmit packets of the specified size or smaller, breaking larger packets up into multiple fragments. - If non-zero, only transmit packets of the specified size or smaller, breaking larger packets up into multiple fragments.
- If zero a default MTU is used. Note that contrary to wg-quick's MTU setting, this does not take into account the current routes - If zero a default MTU is used. Note that contrary to wg-quick's MTU setting, this does not take into account the current routes at
at the time of activation. the time of activation.
type: int type: int
peer-routes: peer-routes:
description: description:
@ -998,8 +979,8 @@ options:
C(ipv6.route-table). Usually you want this automatism enabled. C(ipv6.route-table). Usually you want this automatism enabled.
- If V(false), no such routes are added automatically. In this case, the user may want to configure static routes in C(ipv4.routes) - If V(false), no such routes are added automatically. In this case, the user may want to configure static routes in C(ipv4.routes)
and C(ipv6.routes), respectively. and C(ipv6.routes), respectively.
- Note that if the peer's AllowedIPs is V(0.0.0.0/0) or V(::/0) and the profile's C(ipv4.never-default) or C(ipv6.never-default) - Note that if the peer's AllowedIPs is V(0.0.0.0/0) or V(::/0) and the profile's C(ipv4.never-default) or C(ipv6.never-default) setting
setting is enabled, the peer route for this peer won't be added automatically. is enabled, the peer route for this peer will not be added automatically.
type: bool type: bool
private-key: private-key:
description: The 256 bit private-key in base64 encoding. description: The 256 bit private-key in base64 encoding.
@ -1011,8 +992,8 @@ options:
vpn: vpn:
description: description:
- Configuration of a VPN connection (PPTP and L2TP). - Configuration of a VPN connection (PPTP and L2TP).
- In order to use L2TP you need to be sure that C(network-manager-l2tp) - and C(network-manager-l2tp-gnome) - In order to use L2TP you need to be sure that C(network-manager-l2tp) - and C(network-manager-l2tp-gnome) if host has UI - are installed
if host has UI - are installed on the host. on the host.
type: dict type: dict
version_added: 5.1.0 version_added: 5.1.0
suboptions: suboptions:
@ -1025,20 +1006,17 @@ options:
type: str type: str
required: true required: true
gateway: gateway:
description: The gateway to connection. It can be an IP address (for example V(192.0.2.1)) description: The gateway to connection. It can be an IP address (for example V(192.0.2.1)) or a FQDN address (for example V(vpn.example.com)).
or a FQDN address (for example V(vpn.example.com)).
type: str type: str
required: true required: true
password-flags: password-flags:
description: description:
- NMSettingSecretFlags indicating how to handle the C(vpn.password) property. - NMSettingSecretFlags indicating how to handle the C(vpn.password) property.
- 'Following choices are allowed: - 'Following choices are allowed: V(0) B(NONE): The system is responsible for providing and storing this secret (default); V(1) B(AGENT_OWNED):
V(0) B(NONE): The system is responsible for providing and storing this secret (default); A user secret agent is responsible for providing and storing this secret; when it is required agents will be asked to retrieve it;
V(1) B(AGENT_OWNED): A user secret agent is responsible for providing and storing this secret; when it is required agents will be V(2) B(NOT_SAVED): This secret should not be saved, but should be requested from the user each time it is needed; V(4) B(NOT_REQUIRED):
asked to retrieve it; In situations where it cannot be automatically determined that the secret is required (some VPNs and PPP providers do not require
V(2) B(NOT_SAVED): This secret should not be saved, but should be requested from the user each time it is needed; all secrets) this flag indicates that the specific secret is not required.'
V(4) B(NOT_REQUIRED): In situations where it cannot be automatically determined that the secret is required
(some VPNs and PPP providers do not require all secrets) this flag indicates that the specific secret is not required.'
type: int type: int
choices: [0, 1, 2, 4] choices: [0, 1, 2, 4]
default: 0 default: 0
@ -1054,8 +1032,7 @@ options:
ipsec-psk: ipsec-psk:
description: description:
- The pre-shared key in base64 encoding. - The pre-shared key in base64 encoding.
- > - "You can encode using this Ansible jinja2 expression: V(\"0s{{ '[YOUR PRE-SHARED KEY]' | ansible.builtin.b64encode }}\")."
You can encode using this Ansible jinja2 expression: V("0s{{ '[YOUR PRE-SHARED KEY]' | ansible.builtin.b64encode }}").
- This is only used when O(vpn.ipsec-enabled=true). - This is only used when O(vpn.ipsec-enabled=true).
type: str type: str
sriov: sriov:
@ -1090,9 +1067,9 @@ options:
- 'Virtual function descriptors in the form: V(INDEX [ATTR=VALUE[ ATTR=VALUE]...]).' - 'Virtual function descriptors in the form: V(INDEX [ATTR=VALUE[ ATTR=VALUE]...]).'
- Multiple VFs can be specified using a comma as separator, for example V(2 mac=00:11:22:33:44:55 spoof-check=true,3 vlans=100). - Multiple VFs can be specified using a comma as separator, for example V(2 mac=00:11:22:33:44:55 spoof-check=true,3 vlans=100).
type: str type: str
''' """
EXAMPLES = r''' EXAMPLES = r"""
# These examples are using the following inventory: # These examples are using the following inventory:
# #
# ## Directory layout: # ## Directory layout:
@ -1203,7 +1180,6 @@ EXAMPLES = r'''
## playbook-add.yml example ## playbook-add.yml example
---
- hosts: openstack-stage - hosts: openstack-stage
remote_user: root remote_user: root
tasks: tasks:
@ -1595,7 +1571,7 @@ EXAMPLES = r'''
slave_type: ovs-port slave_type: ovs-port
type: ethernet type: ethernet
state: present state: present
''' """
RETURN = r"""# RETURN = r"""#
""" """

View File

@ -8,8 +8,7 @@
from __future__ import absolute_import, division, print_function from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = r"""
---
module: nomad_job module: nomad_job
author: FERREIRA Christophe (@chris93111) author: FERREIRA Christophe (@chris93111)
version_added: "1.3.0" version_added: "1.3.0"
@ -17,7 +16,7 @@ short_description: Launch a Nomad Job
description: description:
- Launch a Nomad job. - Launch a Nomad job.
- Stop a Nomad job. - Stop a Nomad job.
- Force start a Nomad job - Force start a Nomad job.
requirements: requirements:
- python-nomad - python-nomad
extends_documentation_fragment: extends_documentation_fragment:
@ -61,9 +60,9 @@ seealso:
- name: Nomad jobs documentation - name: Nomad jobs documentation
description: Complete documentation for Nomad API jobs. description: Complete documentation for Nomad API jobs.
link: https://www.nomadproject.io/api-docs/jobs/ link: https://www.nomadproject.io/api-docs/jobs/
''' """
EXAMPLES = ''' EXAMPLES = r"""
- name: Create job - name: Create job
community.general.nomad_job: community.general.nomad_job:
host: localhost host: localhost
@ -92,7 +91,7 @@ EXAMPLES = '''
name: api name: api
timeout: 120 timeout: 120
force_start: true force_start: true
''' """
import json import json

View File

@ -8,8 +8,7 @@
from __future__ import absolute_import, division, print_function from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = r"""
---
module: nomad_job_info module: nomad_job_info
author: FERREIRA Christophe (@chris93111) author: FERREIRA Christophe (@chris93111)
version_added: "1.3.0" version_added: "1.3.0"
@ -33,9 +32,9 @@ seealso:
- name: Nomad jobs documentation - name: Nomad jobs documentation
description: Complete documentation for Nomad API jobs. description: Complete documentation for Nomad API jobs.
link: https://www.nomadproject.io/api-docs/jobs/ link: https://www.nomadproject.io/api-docs/jobs/
''' """
EXAMPLES = ''' EXAMPLES = r"""
- name: Get info for job awx - name: Get info for job awx
community.general.nomad_job_info: community.general.nomad_job_info:
host: localhost host: localhost
@ -46,10 +45,9 @@ EXAMPLES = '''
community.general.nomad_job_info: community.general.nomad_job_info:
host: localhost host: localhost
register: result register: result
"""
''' RETURN = r"""
RETURN = '''
result: result:
description: List with dictionary contains jobs info description: List with dictionary contains jobs info
returned: success returned: success
@ -264,7 +262,7 @@ result:
} }
] ]
''' """
from ansible.module_utils.basic import AnsibleModule, missing_required_lib from ansible.module_utils.basic import AnsibleModule, missing_required_lib
from ansible.module_utils.common.text.converters import to_native from ansible.module_utils.common.text.converters import to_native

View File

@ -9,8 +9,7 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = r"""
---
module: nomad_token module: nomad_token
author: Pedro Nascimento (@apecnascimento) author: Pedro Nascimento (@apecnascimento)
version_added: "8.1.0" version_added: "8.1.0"
@ -60,9 +59,9 @@ seealso:
- name: Nomad ACL documentation - name: Nomad ACL documentation
description: Complete documentation for Nomad API ACL. description: Complete documentation for Nomad API ACL.
link: https://developer.hashicorp.com/nomad/api-docs/acl/tokens link: https://developer.hashicorp.com/nomad/api-docs/acl/tokens
''' """
EXAMPLES = ''' EXAMPLES = r"""
- name: Create boostrap token - name: Create boostrap token
community.general.nomad_token: community.general.nomad_token:
host: localhost host: localhost
@ -95,9 +94,9 @@ EXAMPLES = '''
host: localhost host: localhost
name: "Dev token" name: "Dev token"
state: absent state: absent
''' """
RETURN = ''' RETURN = r"""
result: result:
description: Result returned by nomad. description: Result returned by nomad.
returned: always returned: always
@ -119,7 +118,7 @@ result:
"secret_id": "12e878ab-e1f6-e103-b4c4-3b5173bb4cea", "secret_id": "12e878ab-e1f6-e103-b4c4-3b5173bb4cea",
"type": "client" "type": "client"
} }
''' """
from ansible.module_utils.basic import AnsibleModule, missing_required_lib from ansible.module_utils.basic import AnsibleModule, missing_required_lib
from ansible.module_utils.common.text.converters import to_native from ansible.module_utils.common.text.converters import to_native

View File

@ -9,8 +9,7 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = r"""
---
module: nosh module: nosh
author: author:
- "Thomas Caravia (@tacatac)" - "Thomas Caravia (@tacatac)"
@ -36,40 +35,35 @@ options:
required: false required: false
choices: [started, stopped, reset, restarted, reloaded] choices: [started, stopped, reset, restarted, reloaded]
description: description:
- V(started)/V(stopped) are idempotent actions that will not run - V(started)/V(stopped) are idempotent actions that will not run commands unless necessary.
commands unless necessary. - V(restarted) will always bounce the service.
V(restarted) will always bounce the service. - V(reloaded) will send a SIGHUP or start the service.
V(reloaded) will send a SIGHUP or start the service. - V(reset) will start or stop the service according to whether it is enabled or not.
V(reset) will start or stop the service according to whether it is
enabled or not.
enabled: enabled:
required: false required: false
type: bool type: bool
description: description:
- Enable or disable the service, independently of C(*.preset) file - Enable or disable the service, independently of C(*.preset) file preference or running state. Mutually exclusive with O(preset). Will
preference or running state. Mutually exclusive with O(preset). Will take take effect prior to O(state=reset).
effect prior to O(state=reset).
preset: preset:
required: false required: false
type: bool type: bool
description: description:
- Enable or disable the service according to local preferences in C(*.preset) files. - Enable or disable the service according to local preferences in C(*.preset) files. Mutually exclusive with O(enabled). Only has an effect
Mutually exclusive with O(enabled). Only has an effect if set to true. Will take if set to true. Will take effect prior to O(state=reset).
effect prior to O(state=reset).
user: user:
required: false required: false
default: false default: false
type: bool type: bool
description: description:
- Run system-control talking to the calling user's service manager, rather than - Run system-control talking to the calling user's service manager, rather than the system-wide service manager.
the system-wide service manager.
requirements: requirements:
- A system with an active nosh service manager, see Notes for further information. - A system with an active nosh service manager, see Notes for further information.
notes: notes:
- Information on the nosh utilities suite may be found at U(https://jdebp.eu/Softwares/nosh/). - Information on the nosh utilities suite may be found at U(https://jdebp.eu/Softwares/nosh/).
''' """
EXAMPLES = ''' EXAMPLES = r"""
- name: Start dnscache if not running - name: Start dnscache if not running
community.general.nosh: community.general.nosh:
name: dnscache name: dnscache
@ -122,36 +116,36 @@ EXAMPLES = '''
ansible.builtin.fail: ansible.builtin.fail:
msg: "The {{ result.name }} service is running" msg: "The {{ result.name }} service is running"
when: result.status and result.status['DaemontoolsEncoreState'] == "running" when: result.status and result.status['DaemontoolsEncoreState'] == "running"
''' """
RETURN = ''' RETURN = r"""
name: name:
description: name used to find the service description: Name used to find the service.
returned: success returned: success
type: str type: str
sample: "sshd" sample: "sshd"
service_path: service_path:
description: resolved path for the service description: Resolved path for the service.
returned: success returned: success
type: str type: str
sample: "/var/sv/sshd" sample: "/var/sv/sshd"
enabled: enabled:
description: whether the service is enabled at system bootstrap description: Whether the service is enabled at system bootstrap.
returned: success returned: success
type: bool type: bool
sample: true sample: true
preset: preset:
description: whether the enabled status reflects the one set in the relevant C(*.preset) file description: Whether the enabled status reflects the one set in the relevant C(*.preset) file.
returned: success returned: success
type: bool type: bool
sample: 'False' sample: 'False'
state: state:
description: service process run state, V(none) if the service is not loaded and will not be started description: Service process run state, V(none) if the service is not loaded and will not be started.
returned: if state option is used returned: if state option is used
type: str type: str
sample: "reloaded" sample: "reloaded"
status: status:
description: A dictionary with the key=value pairs returned by C(system-control show-json) or V(none) if the service is not loaded description: A dictionary with the key=value pairs returned by C(system-control show-json) or V(none) if the service is not loaded.
returned: success returned: success
type: complex type: complex
contains: contains:
@ -326,11 +320,11 @@ status:
type: list type: list
sample: ["/etc/service-bundles/targets/basic", "../sshdgenkeys"] sample: ["/etc/service-bundles/targets/basic", "../sshdgenkeys"]
user: user:
description: whether the user-level service manager is called description: Whether the user-level service manager is called.
returned: success returned: success
type: bool type: bool
sample: false sample: false
''' """
import json import json

View File

@ -8,8 +8,7 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = r''' DOCUMENTATION = r"""
---
module: npm module: npm
short_description: Manage node.js packages with npm short_description: Manage node.js packages with npm
description: description:
@ -104,9 +103,9 @@ options:
version_added: 9.5.0 version_added: 9.5.0
requirements: requirements:
- npm installed in bin path (recommended /usr/local/bin) - npm installed in bin path (recommended /usr/local/bin)
''' """
EXAMPLES = r''' EXAMPLES = r"""
- name: Install "coffee-script" node.js package. - name: Install "coffee-script" node.js package.
community.general.npm: community.general.npm:
name: coffee-script name: coffee-script
@ -153,7 +152,7 @@ EXAMPLES = r'''
path: /app/location path: /app/location
executable: /opt/nvm/v0.10.1/bin/npm executable: /opt/nvm/v0.10.1/bin/npm
state: present state: present
''' """
import json import json
import os import os

View File

@ -14,13 +14,12 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = r"""
---
module: nsupdate module: nsupdate
short_description: Manage DNS records short_description: Manage DNS records
description: description:
- Create, update and remove DNS records using DDNS updates - Create, update and remove DNS records using DDNS updates.
requirements: requirements:
- dnspython - dnspython
author: "Loic Blot (@nerzhul)" author: "Loic Blot (@nerzhul)"
@ -50,17 +49,16 @@ options:
type: int type: int
key_name: key_name:
description: description:
- Use TSIG key name to authenticate against DNS O(server) - Use TSIG key name to authenticate against DNS O(server).
type: str type: str
key_secret: key_secret:
description: description:
- Use TSIG key secret, associated with O(key_name), to authenticate against O(server) - Use TSIG key secret, associated with O(key_name), to authenticate against O(server).
type: str type: str
key_algorithm: key_algorithm:
description: description:
- Specify key algorithm used by O(key_secret). - Specify key algorithm used by O(key_secret).
choices: ['HMAC-MD5.SIG-ALG.REG.INT', 'hmac-md5', 'hmac-sha1', 'hmac-sha224', 'hmac-sha256', 'hmac-sha384', choices: ['HMAC-MD5.SIG-ALG.REG.INT', 'hmac-md5', 'hmac-sha1', 'hmac-sha224', 'hmac-sha256', 'hmac-sha384', 'hmac-sha512']
'hmac-sha512']
default: 'hmac-md5' default: 'hmac-md5'
type: str type: str
zone: zone:
@ -94,9 +92,9 @@ options:
default: 'tcp' default: 'tcp'
choices: ['tcp', 'udp'] choices: ['tcp', 'udp']
type: str type: str
''' """
EXAMPLES = ''' EXAMPLES = r"""
- name: Add or modify ansible.example.org A to 192.168.1.1" - name: Add or modify ansible.example.org A to 192.168.1.1"
community.general.nsupdate: community.general.nsupdate:
key_name: "nsupdate" key_name: "nsupdate"
@ -143,49 +141,49 @@ EXAMPLES = '''
record: "1.1.168.192.in-addr.arpa." record: "1.1.168.192.in-addr.arpa."
type: "PTR" type: "PTR"
state: absent state: absent
''' """
RETURN = ''' RETURN = r"""
changed: changed:
description: If module has modified record description: If module has modified record.
returned: success returned: success
type: str type: str
record: record:
description: DNS record description: DNS record.
returned: success returned: success
type: str type: str
sample: 'ansible' sample: 'ansible'
ttl: ttl:
description: DNS record TTL description: DNS record TTL.
returned: success returned: success
type: int type: int
sample: 86400 sample: 86400
type: type:
description: DNS record type description: DNS record type.
returned: success returned: success
type: str type: str
sample: 'CNAME' sample: 'CNAME'
value: value:
description: DNS record value(s) description: DNS record value(s).
returned: success returned: success
type: list type: list
sample: '192.168.1.1' sample: '192.168.1.1'
zone: zone:
description: DNS record zone description: DNS record zone.
returned: success returned: success
type: str type: str
sample: 'example.org.' sample: 'example.org.'
dns_rc: dns_rc:
description: dnspython return code description: C(dnspython) return code.
returned: always returned: always
type: int type: int
sample: 4 sample: 4
dns_rc_str: dns_rc_str:
description: dnspython return code (string representation) description: C(dnspython) return code (string representation).
returned: always returned: always
type: str type: str
sample: 'REFUSED' sample: 'REFUSED'
''' """
import traceback import traceback