[PR #9388/6aadcc72 backport][stable-10] [mem ... n]*.py: normalize docs (#9406)

[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>
(cherry picked from commit 6aadcc72d1)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
pull/9412/head
patchback[bot] 2024-12-26 17:06:05 +01:00 committed by GitHub
parent 03f3b74934
commit 7732d64abb
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,53 +8,47 @@
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:
- community.general.attributes - community.general.attributes
attributes: attributes:
check_mode: check_mode:
support: none support: none
diff_mode: diff_mode:
support: none support: none
options: options:
api_key: api_key:
required: true required: true
type: str type: str
description: description:
- The API key obtained from the Memset control panel. - The API key obtained from the Memset control panel.
poll: poll:
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,107 +8,104 @@
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:
- community.general.attributes - community.general.attributes
- community.general.attributes.info_module - community.general.attributes.info_module
attributes: attributes:
check_mode: check_mode:
version_added: 3.3.0 version_added: 3.3.0
# This was backported to 2.5.4 and 1.3.11 as well, since this was a bugfix # This was backported to 2.5.4 and 1.3.11 as well, since this was a bugfix
options: options:
api_key: api_key:
required: true required: true
type: str type: str
description: description:
- The API key obtained from the Memset control panel. - The API key obtained from the Memset control panel.
name: name:
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,48 +8,45 @@
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:
- community.general.attributes - community.general.attributes
- community.general.attributes.info_module - community.general.attributes.info_module
attributes: attributes:
check_mode: check_mode:
version_added: 3.3.0 version_added: 3.3.0
# This was backported to 2.5.4 and 1.3.11 as well, since this was a bugfix # This was backported to 2.5.4 and 1.3.11 as well, since this was a bugfix
options: options:
api_key: api_key:
required: true required: true
type: str type: str
description: description:
- The API key obtained from the Memset control panel. - The API key obtained from the Memset control panel.
name: name:
required: true required: true
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'
@ -149,7 +146,7 @@ memset_api:
description: The network zone(s) the server is in. description: The network zone(s) the server is in.
returned: always returned: always
type: list type: list
sample: [ 'reading' ] sample: ['reading']
nickname: nickname:
description: Customer-set nickname for the server. description: Customer-set nickname for the server.
returned: always returned: always
@ -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,60 +8,55 @@
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:
- community.general.attributes - community.general.attributes
attributes: attributes:
check_mode: check_mode:
support: full support: full
diff_mode: diff_mode:
support: none support: none
options: options:
state: state:
required: true required: true
description: description:
- Indicates desired state of resource. - Indicates desired state of resource.
type: str type: str
choices: [ absent, present ] choices: [absent, present]
api_key: api_key:
required: true required: true
description: description:
- The API key obtained from the Memset control panel. - The API key obtained from the Memset control panel.
type: str type: str
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 valid int from U(https://www.memset.com/apidocs/methods_dns.html#dns.zone_create).
- The default TTL for all records created in the zone. This must be a type: int
valid int from U(https://www.memset.com/apidocs/methods_dns.html#dns.zone_create). default: 0
type: int choices: [0, 300, 600, 900, 1800, 3600, 7200, 10800, 21600, 43200, 86400]
default: 0 force:
choices: [ 0, 300, 600, 900, 1800, 3600, 7200, 10800, 21600, 43200, 86400 ] required: false
force: default: false
required: false type: bool
default: false description:
type: bool - Forces deletion of a zone and all zone domains/zone records it contains.
description: """
- 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,53 +8,50 @@
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:
- community.general.attributes - community.general.attributes
attributes: attributes:
check_mode: check_mode:
support: full support: full
diff_mode: diff_mode:
support: none support: none
options: options:
state: state:
default: present default: present
description: description:
- Indicates desired state of resource. - Indicates desired state of resource.
type: str type: str
choices: [ absent, present ] choices: [absent, present]
api_key: api_key:
required: true required: true
description: description:
- The API key obtained from the Memset control panel. - The API key obtained from the Memset control panel.
type: str type: str
domain: domain:
required: true required: true
description: description:
- The zone domain name. Ensure this value has at most 250 characters. - The zone domain name. Ensure this value has at most 250 characters.
type: str type: str
aliases: ['name'] aliases: ['name']
zone: zone:
required: true required: true
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,83 +8,78 @@
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:
- community.general.attributes - community.general.attributes
attributes: attributes:
check_mode: check_mode:
support: full support: full
diff_mode: diff_mode:
support: none support: none
options: options:
state: state:
default: present default: present
description: description:
- Indicates desired state of resource. - Indicates desired state of resource.
type: str type: str
choices: [ absent, present ] choices: [absent, present]
api_key: api_key:
required: true required: true
description: description:
- The API key obtained from the Memset control panel. - The API key obtained from the Memset control panel.
type: str type: str
address: address:
required: true required: true
description: description:
- The address for this record (can be IP or text string depending on record type). - The address for this record (can be IP or text string depending on record type).
type: str type: str
aliases: [ ip, data ] aliases: [ip, data]
priority: priority:
description: description:
- C(SRV) and C(TXT) record priority, in the range 0 > 999 (inclusive). - C(SRV) and C(TXT) record priority, in the range 0 > 999 (inclusive).
type: int type: int
default: 0 default: 0
record: record:
required: false required: false
description: description:
- The subdomain to create. - The subdomain to create.
type: str type: str
default: '' default: ''
type: type:
required: true required: true
description: description:
- The type of DNS record to create. - The type of DNS record to create.
choices: [ A, AAAA, CNAME, MX, NS, SRV, TXT ] choices: [A, AAAA, CNAME, MX, NS, SRV, TXT]
type: str type: str
relative: relative:
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 valid int from
- The record's TTL in seconds (will inherit zone's TTL if not explicitly set). This must be a U(https://www.memset.com/apidocs/methods_dns.html#dns.zone_record_create).
valid int from 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 zone:
zone: required: true
required: true 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:
@ -118,11 +113,11 @@ EXAMPLES = '''
address: "{{ item.address }}" address: "{{ item.address }}"
delegate_to: localhost delegate_to: localhost
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,20 +10,19 @@ 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
description: description:
- This module manages a basic AIX mksysb (image) of rootvg. - This module manages a basic AIX mksysb (image) of rootvg.
seealso: seealso:
- name: C(mksysb) command manual page - name: C(mksysb) command manual page
description: Manual page for the command. description: Manual page for the command.
link: https://www.ibm.com/docs/en/aix/7.3?topic=m-mksysb-command link: https://www.ibm.com/docs/en/aix/7.3?topic=m-mksysb-command
extends_documentation_fragment: extends_documentation_fragment:
- community.general.attributes - community.general.attributes
attributes: attributes:
check_mode: check_mode:
support: full support: full
@ -32,63 +31,62 @@ attributes:
options: options:
backup_crypt_files: backup_crypt_files:
description: description:
- Backup encrypted files. - Backup encrypted files.
type: bool type: bool
default: true default: true
backup_dmapi_fs: backup_dmapi_fs:
description: description:
- Back up DMAPI filesystem files. - Back up DMAPI filesystem files.
type: bool type: bool
default: true default: true
create_map_files: create_map_files:
description: description:
- Creates a new MAP files. - Creates a new MAP files.
type: bool type: bool
default: false default: false
exclude_files: exclude_files:
description: description:
- Excludes files using C(/etc/rootvg.exclude). - Excludes files using C(/etc/rootvg.exclude).
type: bool type: bool
default: false default: false
exclude_wpar_files: exclude_wpar_files:
description: description:
- Excludes WPAR files. - Excludes WPAR files.
type: bool type: bool
default: false default: false
extended_attrs: extended_attrs:
description: description:
- Backup extended attributes. - Backup extended attributes.
type: bool type: bool
default: true default: true
name: name:
type: str type: str
description: description:
- Backup name - Backup name.
required: true required: true
new_image_data: new_image_data:
description: description:
- Creates a new file data. - Creates a new file data.
type: bool type: bool
default: true default: true
software_packing: software_packing:
description: description:
- Exclude files from packing option listed in C(/etc/exclude_packing.rootvg). - Exclude files from packing option listed in C(/etc/exclude_packing.rootvg).
type: bool type: bool
default: false default: false
storage_path: storage_path:
type: str type: str
description: description:
- Storage path where the mksysb will stored. - Storage path where the mksysb will stored.
required: true required: true
use_snapshot: use_snapshot:
description: description:
- Creates backup using snapshots. - Creates backup using snapshots.
type: bool type: bool
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,59 +8,58 @@
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:
- David Stygstra (@stygstra) - David Stygstra (@stygstra)
- Julien Dauphant (@jdauphant) - Julien Dauphant (@jdauphant)
- Matt Jeffery (@mattjeffery) - Matt Jeffery (@mattjeffery)
description: description:
- Load or unload kernel modules. - Load or unload kernel modules.
extends_documentation_fragment: extends_documentation_fragment:
- community.general.attributes - community.general.attributes
attributes: attributes:
check_mode: check_mode:
support: full support: full
diff_mode: diff_mode:
support: none support: none
options: options:
name: name:
type: str type: str
required: true required: true
description: description:
- Name of kernel module to manage. - Name of kernel module to manage.
state: state:
type: str type: str
description: description:
- Whether the module should be present or absent. - Whether the module should be present or absent.
choices: [ absent, present ] choices: [absent, present]
default: present default: present
params: params:
type: str type: str
description: description:
- Modules parameters. - Modules parameters.
default: '' default: ''
persistent: persistent:
type: str type: str
choices: [ disabled, absent, present ] choices: [disabled, absent, present]
default: disabled default: disabled
version_added: 7.0.0 version_added: 7.0.0
description: description:
- 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,14 +9,13 @@ 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:
check_mode: check_mode:
support: full support: full
@ -32,26 +31,25 @@ options:
description: description:
- The state of service. - The state of service.
required: true required: true
choices: [ "present", "started", "stopped", "restarted", "monitored", "unmonitored", "reloaded" ] choices: ["present", "started", "stopped", "restarted", "monitored", "unmonitored", "reloaded"]
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, aliases: [ca_certs]
but will not attempt any form of authentication. This provides basic
network encryption but may not be sufficient depending on how the broker
is configured.
aliases: [ ca_certs ]
client_cert: 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,77 +16,74 @@ 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
attributes: attributes:
check_mode: check_mode:
support: partial support: partial
details: details:
- The script will not be executed in check mode. - The script will not be executed in check mode.
diff_mode: diff_mode:
support: none support: none
options: options:
name: name:
description: Database to run script against. description: Database to run script against.
aliases: [ db ] aliases: [db]
default: '' default: ''
type: str type: str
login_user: login_user:
description: The username used to authenticate with. description: The username used to authenticate with.
type: str type: str
login_password: login_password:
description: The password used to authenticate with. description: The password used to authenticate with.
type: str type: str
login_host: login_host:
description: Host running the database. description: Host running the database.
type: str type: str
required: true required: true
login_port: login_port:
description: Port of the MSSQL server. Requires O(login_host) be defined as well. description: Port of the MSSQL server. Requires O(login_host) be defined as well.
default: 1433 default: 1433
type: int type: int
script: script:
description: description:
- The SQL script to be executed. - The SQL script to be executed.
- Script can contain multiple SQL statements. Multiple Batches can be separated by V(GO) command. - Script can contain multiple SQL statements. Multiple Batches can be separated by V(GO) command.
- Each batch must return at least one result set. - Each batch must return at least one result set.
required: true required: true
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 version_added: 8.4.0
version_added: 8.4.0 output:
output: description:
description: - With V(default) each row will be returned as a list of values. See RV(query_results).
- With V(default) each row will be returned as a list of values. See RV(query_results). - Output format V(dict) will return dictionary with the column names as keys. See RV(query_results_dict).
- Output format V(dict) will return dictionary with the column names as keys. See RV(query_results_dict). - V(dict) requires named columns to be returned by each query otherwise an error is thrown.
- V(dict) requires named columns to be returned by each query otherwise an error is thrown. choices: ["dict", "default"]
choices: [ "dict", "default" ] 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 }}"
@ -140,11 +136,11 @@ EXAMPLES = r'''
register: result_batches register: result_batches
- assert: - assert:
that: that:
- result_batches.query_results | length == 2 # two batch results - result_batches.query_results | length == 2 # two batch results
- result_batches.query_results[0] | length == 2 # two selects in first batch - result_batches.query_results[0] | length == 2 # two selects in first batch
- result_batches.query_results[0][0] | length == 1 # one row in first select - result_batches.query_results[0][0] | length == 1 # one row in first select
- result_batches.query_results[0][0][0] | length == 1 # one column in first row - result_batches.query_results[0][0][0] | length == 1 # one column in first row
- result_batches.query_results[0][0][0][0] == 'Batch 0 - Select 0' # each row contains a list of values. - result_batches.query_results[0][0][0][0] == 'Batch 0 - Select 0' # each row contains a list of values.
- name: two batches with dict output - name: two batches with dict output
community.general.mssql_script: community.general.mssql_script:
@ -161,68 +157,68 @@ EXAMPLES = r'''
register: result_batches_dict register: result_batches_dict
- assert: - assert:
that: that:
- result_batches_dict.query_results_dict | length == 2 # two batch results - result_batches_dict.query_results_dict | length == 2 # two batch results
- result_batches_dict.query_results_dict[0] | length == 2 # two selects in first batch - result_batches_dict.query_results_dict[0] | 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
elements: list elements: list
returned: success and O(output=default) returned: success and O(output=default)
sample: [[[["Batch 0 - Select 0"]], [["Batch 0 - Select 1"]]], [[["Batch 1 - Select 0"]]]] sample: [[[["Batch 0 - Select 0"]], [["Batch 0 - Select 1"]]], [[["Batch 1 - Select 0"]]]]
contains: contains:
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 the V(GO) keyword in O(script) to separate queries. - Use the V(GO) keyword in O(script) to separate queries.
type: list type: list
elements: list elements: list
contains: contains:
rows: rows:
description: List of rows returned by query. description: List of rows returned by query.
type: list type: list
elements: list elements: list
contains: contains:
column_value: column_value:
description: description:
- List of column values. - List of column values.
- Any non-standard JSON type is converted to string. - Any non-standard JSON type is converted to string.
type: list type: list
example: ["Batch 0 - Select 0"] example: ["Batch 0 - Select 0"]
returned: success, if output is default returned: success, if output is default
query_results_dict: query_results_dict:
description: List of batches (queries separated by V(GO) keyword). description: List of batches (queries separated by V(GO) keyword).
type: list type: list
elements: list elements: list
returned: success and O(output=dict) returned: success and O(output=dict)
sample: [[[["Batch 0 - Select 0"]], [["Batch 0 - Select 1"]]], [[["Batch 1 - Select 0"]]]] sample: [[[["Batch 0 - Select 0"]], [["Batch 0 - Select 1"]]], [[["Batch 1 - Select 0"]]]]
contains: contains:
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:
rows: rows:
description: List of rows returned by query. description: List of rows returned by query.
type: list type: list
elements: list elements: list
contains: contains:
column_dict: column_dict:
description: description:
- Dictionary of column names and values. - Dictionary of column names and values.
- Any non-standard JSON type is converted to string. - Any non-standard JSON type is converted to string.
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,18 +49,16 @@ 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:
description: description:
- Comment when O(action) is V(downtime) or V(acknowledge). - Comment when O(action) is V(downtime) or V(acknowledge).
type: str type: str
default: Scheduling downtime default: Scheduling downtime
start: start:
@ -79,8 +75,8 @@ 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:
description: description:
@ -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:
@ -48,7 +47,7 @@ options:
description: description:
- Record to add or delete, supports wildcard (V(*)). Default is V(@) (that is, the zone name). - Record to add or delete, supports wildcard (V(*)). Default is V(@) (that is, the zone name).
default: "@" default: "@"
aliases: [ name ] aliases: [name]
type: str type: str
type: type:
description: description:
@ -80,7 +79,7 @@ options:
- Whether the record should exist or not. - Whether the record should exist or not.
required: false required: false
default: present default: present
choices: [ 'present', 'absent' ] choices: ['present', 'absent']
type: str type: str
timeout: timeout:
description: description:
@ -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
contains: elements: dict
name: contains:
description: the record name name:
returned: success description: The record name.
type: str returned: success
sample: fancy-hostname type: str
type: sample: fancy-hostname
description: the record type type:
returned: success description: The record type.
type: str returned: success
sample: A type: str
value: sample: A
description: the record destination value:
returned: success description: The record destination.
type: str returned: success
sample: 127.0.0.1 type: str
priority: sample: 127.0.0.1
description: the record priority (only relevant if type=MX) priority:
returned: success description: The record priority (only relevant if RV(records[].type=MX)).
type: int returned: success
sample: 0 type: int
id: sample: 0
description: internal id of the record id:
returned: success description: Internal id of the record.
type: int returned: success
sample: 12345 type: int
''' 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:
@ -26,39 +25,39 @@ attributes:
options: options:
name: name:
description: description:
- Name of the nic tag. - Name of the nic tag.
required: true required: true
type: str type: str
mac: mac:
description: description:
- Specifies the O(mac) address to attach the nic tag to when not creating an O(etherstub). - Specifies the O(mac) address to attach the nic tag to when not creating an O(etherstub).
- Parameters O(mac) and O(etherstub) are mutually exclusive. - Parameters O(mac) and O(etherstub) are mutually exclusive.
type: str type: str
etherstub: etherstub:
description: description:
- Specifies that the nic tag will be attached to a created O(etherstub). - Specifies that the nic tag will be attached to a created O(etherstub).
- Parameter O(etherstub) is mutually exclusive with both O(mtu), and O(mac). - Parameter O(etherstub) is mutually exclusive with both O(mtu), and O(mac).
type: bool type: bool
default: false default: false
mtu: mtu:
description: description:
- Specifies the size of the O(mtu) of the desired nic tag. - Specifies the size of the O(mtu) of the desired nic tag.
- Parameters O(mtu) and O(etherstub) are mutually exclusive. - Parameters O(mtu) and O(etherstub) are mutually exclusive.
type: int type: int
force: force:
description: description:
- When O(state=absent) this switch will use the C(-f) parameter and delete the nic tag regardless of existing VMs. - When O(state=absent) this switch will use the C(-f) parameter and delete the nic tag regardless of existing VMs.
type: bool type: bool
default: false default: false
state: state:
description: description:
- Create or delete a SmartOS nic tag. - Create or delete a SmartOS nic tag.
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

File diff suppressed because it is too large Load Diff

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,53 +16,53 @@ 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:
- community.general.nomad - community.general.nomad
- community.general.attributes - community.general.attributes
attributes: attributes:
check_mode: check_mode:
support: full support: full
diff_mode: diff_mode:
support: none support: none
options: options:
name: name:
description: description:
- Name of job for delete, stop and start job without source. - Name of job for delete, stop and start job without source.
- Name of job for delete, stop and start job without source. - Name of job for delete, stop and start job without source.
- Either this or O(content) must be specified. - Either this or O(content) must be specified.
type: str type: str
state: state:
description: description:
- Deploy or remove job. - Deploy or remove job.
choices: ["present", "absent"] choices: ["present", "absent"]
required: true required: true
type: str type: str
force_start: force_start:
description: description:
- Force job to started. - Force job to started.
type: bool type: bool
default: false default: false
content: content:
description: description:
- Content of Nomad job. - Content of Nomad job.
- Either this or O(name) must be specified. - Either this or O(name) must be specified.
type: str type: str
content_format: content_format:
description: description:
- Type of content of Nomad job. - Type of content of Nomad job.
choices: ["hcl", "json"] choices: ["hcl", "json"]
default: hcl default: hcl
type: str type: str
seealso: 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,15 +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: 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"
short_description: Get Nomad Jobs info short_description: Get Nomad Jobs info
description: description:
- Get info for one Nomad job. - Get info for one Nomad job.
- List Nomad jobs. - List Nomad jobs.
requirements: requirements:
- python-nomad - python-nomad
extends_documentation_fragment: extends_documentation_fragment:
@ -24,18 +23,18 @@ extends_documentation_fragment:
- community.general.attributes - community.general.attributes
- community.general.attributes.info_module - community.general.attributes.info_module
options: options:
name: name:
description: description:
- Name of job for Get info. - Name of job for Get info.
- If not specified, lists all jobs. - If not specified, lists all jobs.
type: str type: str
seealso: 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,60 +9,59 @@ 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"
short_description: Manage Nomad ACL tokens short_description: Manage Nomad ACL tokens
description: description:
- This module allows to create Bootstrap tokens, create ACL tokens, update ACL tokens, and delete ACL tokens. - This module allows to create Bootstrap tokens, create ACL tokens, update ACL tokens, and delete ACL tokens.
requirements: requirements:
- python-nomad - python-nomad
extends_documentation_fragment: extends_documentation_fragment:
- community.general.nomad - community.general.nomad
- community.general.attributes - community.general.attributes
attributes: attributes:
check_mode: check_mode:
support: none support: none
diff_mode: diff_mode:
support: none support: none
options: options:
name: name:
description: description:
- Name of ACL token to create. - Name of ACL token to create.
type: str type: str
token_type: token_type:
description: description:
- The type of the token can be V(client), V(management), or V(bootstrap). - The type of the token can be V(client), V(management), or V(bootstrap).
choices: ["client", "management", "bootstrap"] choices: ["client", "management", "bootstrap"]
type: str type: str
default: "client" default: "client"
policies: policies:
description: description:
- A list of the policies assigned to the token. - A list of the policies assigned to the token.
type: list type: list
elements: str elements: str
default: [] default: []
global_replicated: global_replicated:
description: description:
- Indicates whether or not the token was created with the C(--global). - Indicates whether or not the token was created with the C(--global).
type: bool type: bool
default: false default: false
state: state:
description: description:
- Create or remove ACL token. - Create or remove ACL token.
choices: ["present", "absent"] choices: ["present", "absent"]
required: true required: true
type: str type: str
seealso: 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
@ -75,7 +74,7 @@ EXAMPLES = '''
name: "Dev token" name: "Dev token"
token_type: client token_type: client
policies: policies:
- readonly - readonly
global_replicated: false global_replicated: false
state: absent state: absent
@ -85,8 +84,8 @@ EXAMPLES = '''
name: "Dev token" name: "Dev token"
token_type: client token_type: client
policies: policies:
- readonly - readonly
- devpolicy - devpolicy
global_replicated: false global_replicated: false
state: absent state: absent
@ -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,67 +9,61 @@ 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)"
short_description: Manage services with nosh short_description: Manage services with nosh
description: description:
- Control running and enabled state for system-wide or user services. - Control running and enabled state for system-wide or user services.
- BSD and Linux systems are supported. - BSD and Linux systems are supported.
extends_documentation_fragment: extends_documentation_fragment:
- community.general.attributes - community.general.attributes
attributes: attributes:
check_mode: check_mode:
support: full support: full
diff_mode: diff_mode:
support: none support: none
options: options:
name: name:
type: str type: str
required: true required: true
description: description:
- Name of the service to manage. - Name of the service to manage.
state: state:
type: str type: str
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:
enabled or not. required: false
enabled: type: bool
required: false description:
type: bool - Enable or disable the service, independently of C(*.preset) file preference or running state. Mutually exclusive with O(preset). Will
description: take effect prior to O(state=reset).
- Enable or disable the service, independently of C(*.preset) file preset:
preference or running state. Mutually exclusive with O(preset). Will take required: false
effect prior to O(state=reset). type: bool
preset: description:
required: false - Enable or disable the service according to local preferences in C(*.preset) files. Mutually exclusive with O(enabled). Only has an effect
type: bool if set to true. Will take effect prior to O(state=reset).
description: user:
- Enable or disable the service according to local preferences in C(*.preset) files. required: false
Mutually exclusive with O(enabled). Only has an effect if set to true. Will take default: false
effect prior to O(state=reset). type: bool
user: description:
required: false - Run system-control talking to the calling user's service manager, rather than the system-wide service manager.
default: false
type: bool
description:
- Run system-control talking to the calling user's service manager, rather than
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,215 +116,215 @@ 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:
After: After:
description: [] # FIXME description: [] # FIXME
returned: success returned: success
type: list type: list
sample: ["/etc/service-bundles/targets/basic","../sshdgenkeys", "log"] sample: ["/etc/service-bundles/targets/basic", "../sshdgenkeys", "log"]
Before: Before:
description: [] # FIXME description: [] # FIXME
returned: success returned: success
type: list type: list
sample: ["/etc/service-bundles/targets/shutdown"] sample: ["/etc/service-bundles/targets/shutdown"]
Conflicts: Conflicts:
description: [] # FIXME description: [] # FIXME
returned: success returned: success
type: list type: list
sample: [] sample: []
DaemontoolsEncoreState: DaemontoolsEncoreState:
description: [] # FIXME description: [] # FIXME
returned: success returned: success
type: str type: str
sample: "running" sample: "running"
DaemontoolsState: DaemontoolsState:
description: [] # FIXME description: [] # FIXME
returned: success returned: success
type: str type: str
sample: "up" sample: "up"
Enabled: Enabled:
description: [] # FIXME description: [] # FIXME
returned: success returned: success
type: bool type: bool
sample: true sample: true
LogService: LogService:
description: [] # FIXME description: [] # FIXME
returned: success returned: success
type: str type: str
sample: "../cyclog@sshd" sample: "../cyclog@sshd"
MainPID: MainPID:
description: [] # FIXME description: [] # FIXME
returned: success returned: success
type: int type: int
sample: 661 sample: 661
Paused: Paused:
description: [] # FIXME description: [] # FIXME
returned: success returned: success
type: bool type: bool
sample: 'False' sample: 'False'
ReadyAfterRun: ReadyAfterRun:
description: [] # FIXME description: [] # FIXME
returned: success returned: success
type: bool type: bool
sample: 'False' sample: 'False'
RemainAfterExit: RemainAfterExit:
description: [] # FIXME description: [] # FIXME
returned: success returned: success
type: bool type: bool
sample: 'False' sample: 'False'
Required-By: Required-By:
description: [] # FIXME description: [] # FIXME
returned: success returned: success
type: list type: list
sample: [] sample: []
RestartExitStatusCode: RestartExitStatusCode:
description: [] # FIXME description: [] # FIXME
returned: success returned: success
type: int type: int
sample: '0' sample: '0'
RestartExitStatusNumber: RestartExitStatusNumber:
description: [] # FIXME description: [] # FIXME
returned: success returned: success
type: int type: int
sample: '0' sample: '0'
RestartTimestamp: RestartTimestamp:
description: [] # FIXME description: [] # FIXME
returned: success returned: success
type: int type: int
sample: 4611686019935648081 sample: 4611686019935648081
RestartUTCTimestamp: RestartUTCTimestamp:
description: [] # FIXME description: [] # FIXME
returned: success returned: success
type: int type: int
sample: 1508260140 sample: 1508260140
RunExitStatusCode: RunExitStatusCode:
description: [] # FIXME description: [] # FIXME
returned: success returned: success
type: int type: int
sample: '0' sample: '0'
RunExitStatusNumber: RunExitStatusNumber:
description: [] # FIXME description: [] # FIXME
returned: success returned: success
type: int type: int
sample: '0' sample: '0'
RunTimestamp: RunTimestamp:
description: [] # FIXME description: [] # FIXME
returned: success returned: success
type: int type: int
sample: 4611686019935648081 sample: 4611686019935648081
RunUTCTimestamp: RunUTCTimestamp:
description: [] # FIXME description: [] # FIXME
returned: success returned: success
type: int type: int
sample: 1508260140 sample: 1508260140
StartExitStatusCode: StartExitStatusCode:
description: [] # FIXME description: [] # FIXME
returned: success returned: success
type: int type: int
sample: 1 sample: 1
StartExitStatusNumber: StartExitStatusNumber:
description: [] # FIXME description: [] # FIXME
returned: success returned: success
type: int type: int
sample: '0' sample: '0'
StartTimestamp: StartTimestamp:
description: [] # FIXME description: [] # FIXME
returned: success returned: success
type: int type: int
sample: 4611686019935648081 sample: 4611686019935648081
StartUTCTimestamp: StartUTCTimestamp:
description: [] # FIXME description: [] # FIXME
returned: success returned: success
type: int type: int
sample: 1508260140 sample: 1508260140
StopExitStatusCode: StopExitStatusCode:
description: [] # FIXME description: [] # FIXME
returned: success returned: success
type: int type: int
sample: '0' sample: '0'
StopExitStatusNumber: StopExitStatusNumber:
description: [] # FIXME description: [] # FIXME
returned: success returned: success
type: int type: int
sample: '0' sample: '0'
StopTimestamp: StopTimestamp:
description: [] # FIXME description: [] # FIXME
returned: success returned: success
type: int type: int
sample: 4611686019935648081 sample: 4611686019935648081
StopUTCTimestamp: StopUTCTimestamp:
description: [] # FIXME description: [] # FIXME
returned: success returned: success
type: int type: int
sample: 1508260140 sample: 1508260140
Stopped-By: Stopped-By:
description: [] # FIXME description: [] # FIXME
returned: success returned: success
type: list type: list
sample: ["/etc/service-bundles/targets/shutdown"] sample: ["/etc/service-bundles/targets/shutdown"]
Timestamp: Timestamp:
description: [] # FIXME description: [] # FIXME
returned: success returned: success
type: int type: int
sample: 4611686019935648081 sample: 4611686019935648081
UTCTimestamp: UTCTimestamp:
description: [] # FIXME description: [] # FIXME
returned: success returned: success
type: int type: int
sample: 1508260140 sample: 1508260140
Want: Want:
description: [] # FIXME description: [] # FIXME
returned: success returned: success
type: str type: str
sample: "nothing" sample: "nothing"
Wanted-By: Wanted-By:
description: [] # FIXME description: [] # FIXME
returned: success returned: success
type: list type: list
sample: ["/etc/service-bundles/targets/server","/etc/service-bundles/targets/sockets"] sample: ["/etc/service-bundles/targets/server", "/etc/service-bundles/targets/sockets"]
Wants: Wants:
description: [] # FIXME description: [] # FIXME
returned: success returned: success
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:
@ -83,7 +82,7 @@ options:
required: false required: false
type: str type: str
default: present default: present
choices: [ "present", "absent", "latest" ] choices: ["present", "absent", "latest"]
no_optional: no_optional:
description: description:
- Use the C(--no-optional) flag when installing. - Use the C(--no-optional) flag when installing.
@ -103,10 +102,10 @@ options:
default: false default: false
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,89 +14,87 @@ 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)"
extends_documentation_fragment: extends_documentation_fragment:
- community.general.attributes - community.general.attributes
attributes: attributes:
check_mode: check_mode:
support: full support: full
diff_mode: diff_mode:
support: none support: none
options: options:
state: state:
description: description:
- Manage DNS record. - Manage DNS record.
choices: ['present', 'absent'] choices: ['present', 'absent']
default: 'present' default: 'present'
type: str type: str
server: server:
description: description:
- Apply DNS modification on this server, specified by IPv4 or IPv6 address. - Apply DNS modification on this server, specified by IPv4 or IPv6 address.
required: true required: true
type: str type: str
port: port:
description: description:
- Use this TCP port when connecting to O(server). - Use this TCP port when connecting to O(server).
default: 53 default: 53
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: description:
description: - DNS record will be modified on this O(zone).
- DNS record will be modified on this O(zone). - When omitted DNS will be queried to attempt finding the correct zone.
- When omitted DNS will be queried to attempt finding the correct zone. type: str
type: str record:
record: description:
description: - Sets the DNS record to modify. When zone is omitted this has to be absolute (ending with a dot).
- Sets the DNS record to modify. When zone is omitted this has to be absolute (ending with a dot). required: true
required: true type: str
type: str type:
type: description:
description: - Sets the record type.
- Sets the record type. default: 'A'
default: 'A' type: str
type: str ttl:
ttl: description:
description: - Sets the record TTL.
- Sets the record TTL. default: 3600
default: 3600 type: int
type: int value:
value: description:
description: - Sets the record value.
- Sets the record value. type: list
type: list elements: str
elements: str protocol:
protocol: description:
description: - Sets the transport protocol (TCP or UDP). TCP is the recommended and a more robust option.
- Sets the transport protocol (TCP or UDP). TCP is the recommended and a more robust option. 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