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

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

* Update plugins/modules/netcup_dns.py

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

* netcup_dns: change type of RV(records)

From complex to list of dicts.

---------

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

View File

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

View File

@ -8,107 +8,104 @@
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = '''
---
DOCUMENTATION = r"""
module: memset_memstore_info
author: "Simon Weald (@glitchcrab)"
short_description: Retrieve Memstore product usage information
notes:
- An API key generated via the Memset customer control panel is needed with the
following minimum scope - C(memstore.usage).
- An API key generated using the Memset customer control panel is needed with the following minimum scope - C(memstore.usage).
description:
- Retrieve Memstore product usage information.
- Retrieve Memstore product usage information.
extends_documentation_fragment:
- community.general.attributes
- community.general.attributes.info_module
- community.general.attributes
- community.general.attributes.info_module
attributes:
check_mode:
version_added: 3.3.0
# This was backported to 2.5.4 and 1.3.11 as well, since this was a bugfix
check_mode:
version_added: 3.3.0
# This was backported to 2.5.4 and 1.3.11 as well, since this was a bugfix
options:
api_key:
required: true
type: str
description:
- The API key obtained from the Memset control panel.
name:
required: true
type: str
description:
- The Memstore product name (that is, C(mstestyaa1)).
'''
api_key:
required: true
type: str
description:
- The API key obtained from the Memset control panel.
name:
required: true
type: str
description:
- The Memstore product name (that is, V(mstestyaa1)).
"""
EXAMPLES = '''
EXAMPLES = r"""
- name: Get usage for mstestyaa1
community.general.memset_memstore_info:
name: mstestyaa1
api_key: 5eb86c9896ab03919abcf03857163741
delegate_to: localhost
'''
"""
RETURN = '''
---
RETURN = r"""
memset_api:
description: Info from the Memset API
description: Info from the Memset API.
returned: always
type: complex
contains:
cdn_bandwidth:
description: Dictionary of CDN bandwidth facts
description: Dictionary of CDN bandwidth facts.
returned: always
type: complex
contains:
bytes_out:
description: Outbound CDN bandwidth for the last 24 hours in bytes
description: Outbound CDN bandwidth for the last 24 hours in bytes.
returned: always
type: int
sample: 1000
requests:
description: Number of requests in the last 24 hours
description: Number of requests in the last 24 hours.
returned: always
type: int
sample: 10
bytes_in:
description: Inbound CDN bandwidth for the last 24 hours in bytes
description: Inbound CDN bandwidth for the last 24 hours in bytes.
returned: always
type: int
sample: 1000
containers:
description: Number of containers
description: Number of containers.
returned: always
type: int
sample: 10
bytes:
description: Space used in bytes
description: Space used in bytes.
returned: always
type: int
sample: 3860997965
objs:
description: Number of objects
description: Number of objects.
returned: always
type: int
sample: 1000
bandwidth:
description: Dictionary of CDN bandwidth facts
description: Dictionary of CDN bandwidth facts.
returned: always
type: complex
contains:
bytes_out:
description: Outbound bandwidth for the last 24 hours in bytes
description: Outbound bandwidth for the last 24 hours in bytes.
returned: always
type: int
sample: 1000
requests:
description: Number of requests in the last 24 hours
description: Number of requests in the last 24 hours.
returned: always
type: int
sample: 10
bytes_in:
description: Inbound bandwidth for the last 24 hours in bytes
description: Inbound bandwidth for the last 24 hours in bytes.
returned: always
type: int
sample: 1000
'''
"""
from ansible.module_utils.basic import AnsibleModule
from ansible_collections.community.general.plugins.module_utils.memset import memset_api_call

View File

@ -8,48 +8,45 @@
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = '''
---
DOCUMENTATION = r"""
module: memset_server_info
author: "Simon Weald (@glitchcrab)"
short_description: Retrieve server information
notes:
- An API key generated via the Memset customer control panel is needed with the
following minimum scope - C(server.info).
- An API key generated using the Memset customer control panel is needed with the following minimum scope - C(server.info).
description:
- Retrieve server information.
- Retrieve server information.
extends_documentation_fragment:
- community.general.attributes
- community.general.attributes.info_module
- community.general.attributes
- community.general.attributes.info_module
attributes:
check_mode:
version_added: 3.3.0
# This was backported to 2.5.4 and 1.3.11 as well, since this was a bugfix
check_mode:
version_added: 3.3.0
# This was backported to 2.5.4 and 1.3.11 as well, since this was a bugfix
options:
api_key:
required: true
type: str
description:
- The API key obtained from the Memset control panel.
name:
required: true
type: str
description:
- The server product name (that is, C(testyaa1)).
'''
api_key:
required: true
type: str
description:
- The API key obtained from the Memset control panel.
name:
required: true
type: str
description:
- The server product name (that is, C(testyaa1)).
"""
EXAMPLES = '''
EXAMPLES = r"""
- name: Get details for testyaa1
community.general.memset_server_info:
name: testyaa1
api_key: 5eb86c9896ab03919abcf03857163741
delegate_to: localhost
'''
"""
RETURN = '''
---
RETURN = r"""
memset_api:
description: Info from the Memset API
description: Info from the Memset API.
returned: always
type: complex
contains:
@ -59,7 +56,7 @@ memset_api:
type: bool
sample: true
control_panel:
description: Whether the server has a control panel (i.e. cPanel).
description: Whether the server has a control panel (for example cPanel).
returned: always
type: str
sample: 'cpanel'
@ -103,7 +100,7 @@ memset_api:
}
}
firewall_type:
description: The type of firewall the server has (i.e. self-managed, managed).
description: The type of firewall the server has (for example self-managed, managed).
returned: always
type: str
sample: 'managed'
@ -113,7 +110,7 @@ memset_api:
type: str
sample: 'testyaa1.miniserver.com'
ignore_monitoring_off:
description: When true, Memset won't remind the customer that monitoring is disabled.
description: When true, Memset does not remind the customer that monitoring is disabled.
returned: always
type: bool
sample: true
@ -136,7 +133,7 @@ memset_api:
type: bool
sample: true
monitoring_level:
description: The server's monitoring level (i.e. basic).
description: The server's monitoring level (for example V(basic)).
returned: always
type: str
sample: 'basic'
@ -149,7 +146,7 @@ memset_api:
description: The network zone(s) the server is in.
returned: always
type: list
sample: [ 'reading' ]
sample: ['reading']
nickname:
description: Customer-set nickname for the server.
returned: always
@ -196,7 +193,7 @@ memset_api:
type: str
sample: 'GBP'
renewal_price_vat:
description: VAT rate for renewal payments
description: VAT rate for renewal payments.
returned: always
type: str
sample: '20'
@ -206,7 +203,7 @@ memset_api:
type: str
sample: '2013-04-10'
status:
description: Current status of the server (i.e. live, onhold).
description: Current status of the server (for example live, onhold).
returned: always
type: str
sample: 'LIVE'
@ -216,7 +213,7 @@ memset_api:
type: str
sample: 'managed'
type:
description: What this server is (i.e. dedicated)
description: What this server is (for example V(dedicated)).
returned: always
type: str
sample: 'miniserver'
@ -233,7 +230,7 @@ memset_api:
returned: always
type: str
sample: 'basic'
'''
"""
from ansible.module_utils.basic import AnsibleModule
from ansible_collections.community.general.plugins.module_utils.memset import memset_api_call

View File

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

View File

@ -8,53 +8,50 @@
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = '''
---
DOCUMENTATION = r"""
module: memset_zone_domain
author: "Simon Weald (@glitchcrab)"
short_description: Create and delete domains in Memset DNS zones
notes:
- Zone domains can be thought of as a collection of domains, all of which share the
same DNS records (i.e. they point to the same IP). An API key generated via the
Memset customer control panel is needed with the following minimum scope -
C(dns.zone_domain_create), C(dns.zone_domain_delete), C(dns.zone_domain_list).
- Currently this module can only create one domain at a time. Multiple domains should
be created using C(loop).
- Zone domains can be thought of as a collection of domains, all of which share the same DNS records (in other words, they point to the same IP). An API
key generated using the Memset customer control panel is needed with the following minimum scope - C(dns.zone_domain_create), C(dns.zone_domain_delete),
C(dns.zone_domain_list).
- Currently this module can only create one domain at a time. Multiple domains should be created using C(loop).
description:
- Manage DNS zone domains in a Memset account.
extends_documentation_fragment:
- community.general.attributes
attributes:
check_mode:
support: full
diff_mode:
support: none
check_mode:
support: full
diff_mode:
support: none
options:
state:
default: present
description:
- Indicates desired state of resource.
type: str
choices: [ absent, present ]
api_key:
required: true
description:
- The API key obtained from the Memset control panel.
type: str
domain:
required: true
description:
- The zone domain name. Ensure this value has at most 250 characters.
type: str
aliases: ['name']
zone:
required: true
description:
- The zone to add the domain to (this must already exist).
type: str
'''
state:
default: present
description:
- Indicates desired state of resource.
type: str
choices: [absent, present]
api_key:
required: true
description:
- The API key obtained from the Memset control panel.
type: str
domain:
required: true
description:
- The zone domain name. Ensure this value has at most 250 characters.
type: str
aliases: ['name']
zone:
required: true
description:
- The zone to add the domain to (this must already exist).
type: str
"""
EXAMPLES = '''
EXAMPLES = r"""
# Create the zone domain 'test.com'
- name: Create zone domain
community.general.memset_zone_domain:
@ -63,25 +60,25 @@ EXAMPLES = '''
state: present
api_key: 5eb86c9196ab03919abcf03857163741
delegate_to: localhost
'''
"""
RETURN = '''
RETURN = r"""
memset_api:
description: Domain info from the Memset API
description: Domain info from the Memset API.
returned: when changed or state == present
type: complex
contains:
domain:
description: Domain name
description: Domain name.
returned: always
type: str
sample: "example.com"
id:
description: Domain ID
description: Domain ID.
returned: always
type: str
sample: "b0bb1ce851aeea6feeb2dc32fe83bf9c"
'''
"""
from ansible.module_utils.basic import AnsibleModule
from ansible_collections.community.general.plugins.module_utils.memset import get_zone_id

View File

@ -8,83 +8,78 @@
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = '''
---
DOCUMENTATION = r"""
module: memset_zone_record
author: "Simon Weald (@glitchcrab)"
short_description: Create and delete records in Memset DNS zones
notes:
- Zones can be thought of as a logical group of domains, all of which share the
same DNS records (i.e. they point to the same IP). An API key generated via the
Memset customer control panel is needed with the following minimum scope -
C(dns.zone_create), C(dns.zone_delete), C(dns.zone_list).
- Currently this module can only create one DNS record at a time. Multiple records
should be created using C(loop).
- Zones can be thought of as a logical group of domains, all of which share the same DNS records (in other words they point to the same IP). An API key
generated using the Memset customer control panel is needed with the following minimum scope - C(dns.zone_create), C(dns.zone_delete), C(dns.zone_list).
- Currently this module can only create one DNS record at a time. Multiple records should be created using C(loop).
description:
- Manage DNS records in a Memset account.
extends_documentation_fragment:
- community.general.attributes
attributes:
check_mode:
support: full
diff_mode:
support: none
check_mode:
support: full
diff_mode:
support: none
options:
state:
default: present
description:
- Indicates desired state of resource.
type: str
choices: [ absent, present ]
api_key:
required: true
description:
- The API key obtained from the Memset control panel.
type: str
address:
required: true
description:
- The address for this record (can be IP or text string depending on record type).
type: str
aliases: [ ip, data ]
priority:
description:
- C(SRV) and C(TXT) record priority, in the range 0 > 999 (inclusive).
type: int
default: 0
record:
required: false
description:
- The subdomain to create.
type: str
default: ''
type:
required: true
description:
- The type of DNS record to create.
choices: [ A, AAAA, CNAME, MX, NS, SRV, TXT ]
type: str
relative:
type: bool
default: false
description:
- If set then the current domain is added onto the address field for C(CNAME), C(MX), C(NS)
and C(SRV)record types.
ttl:
description:
- The record's TTL in seconds (will inherit zone's TTL if not explicitly set). This must be a
valid int from U(https://www.memset.com/apidocs/methods_dns.html#dns.zone_record_create).
default: 0
choices: [ 0, 300, 600, 900, 1800, 3600, 7200, 10800, 21600, 43200, 86400 ]
type: int
zone:
required: true
description:
- The name of the zone to which to add the record to.
type: str
'''
state:
default: present
description:
- Indicates desired state of resource.
type: str
choices: [absent, present]
api_key:
required: true
description:
- The API key obtained from the Memset control panel.
type: str
address:
required: true
description:
- The address for this record (can be IP or text string depending on record type).
type: str
aliases: [ip, data]
priority:
description:
- C(SRV) and C(TXT) record priority, in the range 0 > 999 (inclusive).
type: int
default: 0
record:
required: false
description:
- The subdomain to create.
type: str
default: ''
type:
required: true
description:
- The type of DNS record to create.
choices: [A, AAAA, CNAME, MX, NS, SRV, TXT]
type: str
relative:
type: bool
default: false
description:
- If set then the current domain is added onto the address field for C(CNAME), C(MX), C(NS) and C(SRV)record types.
ttl:
description:
- The record's TTL in seconds (will inherit zone's TTL if not explicitly set). This must be a valid int from
U(https://www.memset.com/apidocs/methods_dns.html#dns.zone_record_create).
default: 0
choices: [0, 300, 600, 900, 1800, 3600, 7200, 10800, 21600, 43200, 86400]
type: int
zone:
required: true
description:
- The name of the zone to which to add the record to.
type: str
"""
EXAMPLES = '''
EXAMPLES = r"""
# Create DNS record for www.domain.com
- name: Create DNS record
community.general.memset_zone_record:
@ -118,11 +113,11 @@ EXAMPLES = '''
address: "{{ item.address }}"
delegate_to: localhost
with_items:
- { 'zone': 'domain1.com', 'type': 'A', 'record': 'www', 'address': '1.2.3.4' }
- { 'zone': 'domain2.com', 'type': 'A', 'record': 'mail', 'address': '4.3.2.1' }
'''
- {'zone': 'domain1.com', 'type': 'A', 'record': 'www', 'address': '1.2.3.4'}
- {'zone': 'domain2.com', 'type': 'A', 'record': 'mail', 'address': '4.3.2.1'}
"""
RETURN = '''
RETURN = r"""
memset_api:
description: Record info from the Memset API.
returned: when state == present
@ -168,7 +163,7 @@ memset_api:
returned: always
type: str
sample: "b0bb1ce851aeea6feeb2dc32fe83bf9c"
'''
"""
from ansible.module_utils.basic import AnsibleModule
from ansible_collections.community.general.plugins.module_utils.memset import get_zone_id

View File

@ -10,20 +10,19 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = """
---
DOCUMENTATION = r"""
author: Kairo Araujo (@kairoaraujo)
module: mksysb
short_description: Generates AIX mksysb rootvg backups
description:
- This module manages a basic AIX mksysb (image) of rootvg.
- This module manages a basic AIX mksysb (image) of rootvg.
seealso:
- name: C(mksysb) command manual page
description: Manual page for the command.
link: https://www.ibm.com/docs/en/aix/7.3?topic=m-mksysb-command
- name: C(mksysb) command manual page
description: Manual page for the command.
link: https://www.ibm.com/docs/en/aix/7.3?topic=m-mksysb-command
extends_documentation_fragment:
- community.general.attributes
- community.general.attributes
attributes:
check_mode:
support: full
@ -32,63 +31,62 @@ attributes:
options:
backup_crypt_files:
description:
- Backup encrypted files.
- Backup encrypted files.
type: bool
default: true
backup_dmapi_fs:
description:
- Back up DMAPI filesystem files.
- Back up DMAPI filesystem files.
type: bool
default: true
create_map_files:
description:
- Creates a new MAP files.
- Creates a new MAP files.
type: bool
default: false
exclude_files:
description:
- Excludes files using C(/etc/rootvg.exclude).
- Excludes files using C(/etc/rootvg.exclude).
type: bool
default: false
exclude_wpar_files:
description:
- Excludes WPAR files.
- Excludes WPAR files.
type: bool
default: false
extended_attrs:
description:
- Backup extended attributes.
- Backup extended attributes.
type: bool
default: true
name:
type: str
description:
- Backup name
- Backup name.
required: true
new_image_data:
description:
- Creates a new file data.
- Creates a new file data.
type: bool
default: true
software_packing:
description:
- Exclude files from packing option listed in C(/etc/exclude_packing.rootvg).
- Exclude files from packing option listed in C(/etc/exclude_packing.rootvg).
type: bool
default: false
storage_path:
type: str
description:
- Storage path where the mksysb will stored.
- Storage path where the mksysb will stored.
required: true
use_snapshot:
description:
- Creates backup using snapshots.
- Creates backup using snapshots.
type: bool
default: false
"""
EXAMPLES = """
---
EXAMPLES = r"""
- name: Running a backup image mksysb
community.general.mksysb:
name: myserver
@ -97,8 +95,7 @@ EXAMPLES = """
exclude_wpar_files: true
"""
RETURN = """
---
RETURN = r"""
changed:
description: Return changed for mksysb actions as true or false.
returned: always

View File

@ -8,59 +8,58 @@
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = '''
---
DOCUMENTATION = r"""
module: modprobe
short_description: Load or unload kernel modules
author:
- David Stygstra (@stygstra)
- Julien Dauphant (@jdauphant)
- Matt Jeffery (@mattjeffery)
- David Stygstra (@stygstra)
- Julien Dauphant (@jdauphant)
- Matt Jeffery (@mattjeffery)
description:
- Load or unload kernel modules.
- Load or unload kernel modules.
extends_documentation_fragment:
- community.general.attributes
- community.general.attributes
attributes:
check_mode:
support: full
diff_mode:
support: none
check_mode:
support: full
diff_mode:
support: none
options:
name:
type: str
required: true
description:
- Name of kernel module to manage.
state:
type: str
description:
- Whether the module should be present or absent.
choices: [ absent, present ]
default: present
params:
type: str
description:
- Modules parameters.
default: ''
persistent:
type: str
choices: [ disabled, absent, present ]
default: disabled
version_added: 7.0.0
description:
- Persistency between reboots for configured module.
- This option creates files in C(/etc/modules-load.d/) and C(/etc/modprobe.d/) that make your module configuration persistent during reboots.
- If V(present), adds module name to C(/etc/modules-load.d/) and params to C(/etc/modprobe.d/) so the module will be loaded on next reboot.
- If V(absent), will comment out module name from C(/etc/modules-load.d/) and comment out params from C(/etc/modprobe.d/) so the module will not be
loaded on next reboot.
- If V(disabled), will not touch anything and leave C(/etc/modules-load.d/) and C(/etc/modprobe.d/) as it is.
- Note that it is usually a better idea to rely on the automatic module loading by PCI IDs, USB IDs, DMI IDs or similar triggers encoded in the
kernel modules themselves instead of configuration like this.
- In fact, most modern kernel modules are prepared for automatic loading already.
- "B(Note:) This option works only with distributions that use C(systemd) when set to values other than V(disabled)."
'''
name:
type: str
required: true
description:
- Name of kernel module to manage.
state:
type: str
description:
- Whether the module should be present or absent.
choices: [absent, present]
default: present
params:
type: str
description:
- Modules parameters.
default: ''
persistent:
type: str
choices: [disabled, absent, present]
default: disabled
version_added: 7.0.0
description:
- Persistency between reboots for configured module.
- This option creates files in C(/etc/modules-load.d/) and C(/etc/modprobe.d/) that make your module configuration persistent during reboots.
- If V(present), adds module name to C(/etc/modules-load.d/) and params to C(/etc/modprobe.d/) so the module will be loaded on next reboot.
- If V(absent), will comment out module name from C(/etc/modules-load.d/) and comment out params from C(/etc/modprobe.d/) so the module
will not be loaded on next reboot.
- If V(disabled), will not touch anything and leave C(/etc/modules-load.d/) and C(/etc/modprobe.d/) as it is.
- Note that it is usually a better idea to rely on the automatic module loading by PCI IDs, USB IDs, DMI IDs or similar triggers encoded
in the kernel modules themselves instead of configuration like this.
- In fact, most modern kernel modules are prepared for automatic loading already.
- B(Note:) This option works only with distributions that use C(systemd) when set to values other than V(disabled).
"""
EXAMPLES = '''
EXAMPLES = r"""
- name: Add the 802.1q module
community.general.modprobe:
name: 8021q
@ -78,7 +77,7 @@ EXAMPLES = '''
state: present
params: 'numdummies=2'
persistent: present
'''
"""
import os.path
import platform

View File

@ -9,14 +9,13 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = '''
---
DOCUMENTATION = r"""
module: monit
short_description: Manage the state of a program monitored via Monit
short_description: Manage the state of a program monitored using Monit
description:
- Manage the state of a program monitored via Monit.
- Manage the state of a program monitored using Monit.
extends_documentation_fragment:
- community.general.attributes
- community.general.attributes
attributes:
check_mode:
support: full
@ -32,26 +31,25 @@ options:
description:
- The state of service.
required: true
choices: [ "present", "started", "stopped", "restarted", "monitored", "unmonitored", "reloaded" ]
choices: ["present", "started", "stopped", "restarted", "monitored", "unmonitored", "reloaded"]
type: str
timeout:
description:
- If there are pending actions for the service monitored by monit, then Ansible will check
for up to this many seconds to verify the requested action has been performed.
Ansible will sleep for five seconds between each check.
- If there are pending actions for the service monitored by monit, then Ansible will check for up to this many seconds to verify the requested
action has been performed. Ansible will sleep for five seconds between each check.
default: 300
type: int
author:
- Darryl Stoflet (@dstoflet)
- Simon Kelly (@snopoke)
'''
- Darryl Stoflet (@dstoflet)
- Simon Kelly (@snopoke)
"""
EXAMPLES = '''
EXAMPLES = r"""
- name: Manage the state of program httpd to be in started state
community.general.monit:
name: httpd
state: started
'''
"""
import time
import re

View File

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

View File

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

View File

@ -7,8 +7,7 @@
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = r'''
---
DOCUMENTATION = r"""
module: mssql_script
short_description: Execute SQL scripts on a MSSQL database
@ -17,77 +16,74 @@ version_added: "4.0.0"
description:
- Execute SQL scripts on a MSSQL database.
extends_documentation_fragment:
- community.general.attributes
attributes:
check_mode:
support: partial
details:
- The script will not be executed in check mode.
diff_mode:
support: none
check_mode:
support: partial
details:
- The script will not be executed in check mode.
diff_mode:
support: none
options:
name:
description: Database to run script against.
aliases: [ db ]
default: ''
type: str
login_user:
description: The username used to authenticate with.
type: str
login_password:
description: The password used to authenticate with.
type: str
login_host:
description: Host running the database.
type: str
required: true
login_port:
description: Port of the MSSQL server. Requires O(login_host) be defined as well.
default: 1433
type: int
script:
description:
- The SQL script to be executed.
- Script can contain multiple SQL statements. Multiple Batches can be separated by V(GO) command.
- Each batch must return at least one result set.
required: true
type: str
transaction:
description:
- If transactional mode is requested, start a transaction and commit the change only if the script succeed.
Otherwise, rollback the transaction.
- If transactional mode is not requested (default), automatically commit the change.
type: bool
default: false
version_added: 8.4.0
output:
description:
- With V(default) each row will be returned as a list of values. See RV(query_results).
- Output format V(dict) will return dictionary with the column names as keys. See RV(query_results_dict).
- V(dict) requires named columns to be returned by each query otherwise an error is thrown.
choices: [ "dict", "default" ]
default: 'default'
type: str
params:
description: |
Parameters passed to the script as SQL parameters.
(Query V('SELECT %(name\)s"') with V(example: '{"name": "John Doe"}).)'
type: dict
name:
description: Database to run script against.
aliases: [db]
default: ''
type: str
login_user:
description: The username used to authenticate with.
type: str
login_password:
description: The password used to authenticate with.
type: str
login_host:
description: Host running the database.
type: str
required: true
login_port:
description: Port of the MSSQL server. Requires O(login_host) be defined as well.
default: 1433
type: int
script:
description:
- The SQL script to be executed.
- Script can contain multiple SQL statements. Multiple Batches can be separated by V(GO) command.
- Each batch must return at least one result set.
required: true
type: str
transaction:
description:
- If transactional mode is requested, start a transaction and commit the change only if the script succeed. Otherwise, rollback the transaction.
- If transactional mode is not requested (default), automatically commit the change.
type: bool
default: false
version_added: 8.4.0
output:
description:
- With V(default) each row will be returned as a list of values. See RV(query_results).
- Output format V(dict) will return dictionary with the column names as keys. See RV(query_results_dict).
- V(dict) requires named columns to be returned by each query otherwise an error is thrown.
choices: ["dict", "default"]
default: 'default'
type: str
params:
description: |-
Parameters passed to the script as SQL parameters.
(Query V('SELECT %(name\)s"') with V(example: '{"name": "John Doe"}).)'.
type: dict
notes:
- Requires the pymssql Python package on the remote host. For Ubuntu, this
is as easy as C(pip install pymssql) (See M(ansible.builtin.pip).)
- Requires the pymssql Python package on the remote host. For Ubuntu, this is as easy as C(pip install pymssql) (See M(ansible.builtin.pip)).
requirements:
- pymssql
- pymssql
author:
- Kris Budde (@kbudde)
'''
- Kris Budde (@kbudde)
"""
EXAMPLES = r'''
EXAMPLES = r"""
- name: Check DB connection
community.general.mssql_script:
login_user: "{{ mssql_login_user }}"
@ -140,11 +136,11 @@ EXAMPLES = r'''
register: result_batches
- assert:
that:
- result_batches.query_results | length == 2 # two batch results
- result_batches.query_results[0] | length == 2 # two selects in first batch
- result_batches.query_results[0][0] | length == 1 # one row in first select
- result_batches.query_results[0][0][0] | length == 1 # one column in first row
- result_batches.query_results[0][0][0][0] == 'Batch 0 - Select 0' # each row contains a list of values.
- result_batches.query_results | length == 2 # two batch results
- result_batches.query_results[0] | length == 2 # two selects in first batch
- result_batches.query_results[0][0] | length == 1 # one row in first select
- result_batches.query_results[0][0][0] | length == 1 # one column in first row
- result_batches.query_results[0][0][0][0] == 'Batch 0 - Select 0' # each row contains a list of values.
- name: two batches with dict output
community.general.mssql_script:
@ -161,68 +157,68 @@ EXAMPLES = r'''
register: result_batches_dict
- assert:
that:
- result_batches_dict.query_results_dict | length == 2 # two batch results
- result_batches_dict.query_results_dict[0] | length == 2 # two selects in first batch
- result_batches_dict.query_results_dict[0][0] | length == 1 # one row in first select
- result_batches_dict.query_results_dict[0][0][0]['b0s0'] == 'Batch 0 - Select 0' # column 'b0s0' of first row
'''
- result_batches_dict.query_results_dict | length == 2 # two batch results
- result_batches_dict.query_results_dict[0] | length == 2 # two selects in first batch
- result_batches_dict.query_results_dict[0][0] | length == 1 # one row in first select
- result_batches_dict.query_results_dict[0][0][0]['b0s0'] == 'Batch 0 - Select 0' # column 'b0s0' of first row
"""
RETURN = r'''
RETURN = r"""
query_results:
description: List of batches (queries separated by V(GO) keyword).
type: list
elements: list
returned: success and O(output=default)
sample: [[[["Batch 0 - Select 0"]], [["Batch 0 - Select 1"]]], [[["Batch 1 - Select 0"]]]]
contains:
queries:
description:
- List of result sets of each query.
- If a query returns no results, the results of this and all the following queries will not be included in the output.
- Use the V(GO) keyword in O(script) to separate queries.
type: list
elements: list
contains:
rows:
description: List of rows returned by query.
type: list
elements: list
contains:
column_value:
description:
- List of column values.
- Any non-standard JSON type is converted to string.
type: list
example: ["Batch 0 - Select 0"]
returned: success, if output is default
description: List of batches (queries separated by V(GO) keyword).
type: list
elements: list
returned: success and O(output=default)
sample: [[[["Batch 0 - Select 0"]], [["Batch 0 - Select 1"]]], [[["Batch 1 - Select 0"]]]]
contains:
queries:
description:
- List of result sets of each query.
- If a query returns no results, the results of this and all the following queries will not be included in the output.
- Use the V(GO) keyword in O(script) to separate queries.
type: list
elements: list
contains:
rows:
description: List of rows returned by query.
type: list
elements: list
contains:
column_value:
description:
- List of column values.
- Any non-standard JSON type is converted to string.
type: list
example: ["Batch 0 - Select 0"]
returned: success, if output is default
query_results_dict:
description: List of batches (queries separated by V(GO) keyword).
type: list
elements: list
returned: success and O(output=dict)
sample: [[[["Batch 0 - Select 0"]], [["Batch 0 - Select 1"]]], [[["Batch 1 - Select 0"]]]]
contains:
queries:
description:
- List of result sets of each query.
- If a query returns no results, the results of this and all the following queries will not be included in the output.
Use 'GO' keyword to separate queries.
type: list
elements: list
contains:
rows:
description: List of rows returned by query.
type: list
elements: list
contains:
column_dict:
description:
- Dictionary of column names and values.
- Any non-standard JSON type is converted to string.
type: dict
example: {"col_name": "Batch 0 - Select 0"}
returned: success, if output is dict
'''
description: List of batches (queries separated by V(GO) keyword).
type: list
elements: list
returned: success and O(output=dict)
sample: [[[["Batch 0 - Select 0"]], [["Batch 0 - Select 1"]]], [[["Batch 1 - Select 0"]]]]
contains:
queries:
description:
- List of result sets of each query.
- If a query returns no results, the results of this and all the following queries will not be included in the output. Use 'GO' keyword
to separate queries.
type: list
elements: list
contains:
rows:
description: List of rows returned by query.
type: list
elements: list
contains:
column_dict:
description:
- Dictionary of column names and values.
- Any non-standard JSON type is converted to string.
type: dict
example: {"col_name": "Batch 0 - Select 0"}
returned: success, if output is dict
"""
from ansible.module_utils.basic import AnsibleModule, missing_required_lib
import traceback

View File

@ -14,20 +14,19 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = '''
---
DOCUMENTATION = r"""
module: nagios
short_description: Perform common tasks in Nagios related to downtime and notifications
description:
- "The C(nagios) module has two basic functions: scheduling downtime and toggling alerts for services or hosts."
- 'The C(nagios) module has two basic functions: scheduling downtime and toggling alerts for services or hosts.'
- The C(nagios) module is not idempotent.
- All actions require the O(host) parameter to be given explicitly. In playbooks you can use the C({{inventory_hostname}}) variable to refer
to the host the playbook is currently running on.
- You can specify multiple services at once by separating them with commas, .e.g. O(services=httpd,nfs,puppet).
- When specifying what service to handle there is a special service value, O(host), which will handle alerts/downtime/acknowledge for the I(host itself),
for example O(services=host). This keyword may not be given with other services at the same time.
B(Setting alerts/downtime/acknowledge for a host does not affect alerts/downtime/acknowledge for any of the services running on it.)
To schedule downtime for all services on particular host use keyword "all", for example O(services=all).
- You can specify multiple services at once by separating them with commas, for example O(services=httpd,nfs,puppet).
- When specifying what service to handle there is a special service value, O(host), which will handle alerts/downtime/acknowledge for the I(host
itself), for example O(services=host). This keyword may not be given with other services at the same time. B(Setting alerts/downtime/acknowledge
for a host does not affect alerts/downtime/acknowledge for any of the services running on it.) To schedule downtime for all services on particular
host use keyword "all", for example O(services=all).
extends_documentation_fragment:
- community.general.attributes
attributes:
@ -41,9 +40,8 @@ options:
- Action to take.
- The V(acknowledge) and V(forced_check) actions were added in community.general 1.2.0.
required: true
choices: [ "downtime", "delete_downtime", "enable_alerts", "disable_alerts", "silence", "unsilence",
"silence_nagios", "unsilence_nagios", "command", "servicegroup_service_downtime",
"servicegroup_host_downtime", "acknowledge", "forced_check" ]
choices: ["downtime", "delete_downtime", "enable_alerts", "disable_alerts", "silence", "unsilence", "silence_nagios", "unsilence_nagios",
"command", "servicegroup_service_downtime", "servicegroup_host_downtime", "acknowledge", "forced_check"]
type: str
host:
description:
@ -51,18 +49,16 @@ options:
type: str
cmdfile:
description:
- Path to the nagios I(command file) (FIFO pipe).
Only required if auto-detection fails.
- Path to the nagios I(command file) (FIFO pipe). Only required if auto-detection fails.
type: str
author:
description:
- Author to leave downtime comments as.
Only used when O(action) is V(downtime) or V(acknowledge).
- Author to leave downtime comments as. Only used when O(action) is V(downtime) or V(acknowledge).
type: str
default: Ansible
comment:
description:
- Comment when O(action) is V(downtime) or V(acknowledge).
- Comment when O(action) is V(downtime) or V(acknowledge).
type: str
default: Scheduling downtime
start:
@ -79,8 +75,8 @@ options:
services:
description:
- What to manage downtime/alerts for. Separate multiple services with commas.
- "B(Required) option when O(action) is one of: V(downtime), V(acknowledge), V(forced_check), V(enable_alerts), V(disable_alerts)."
aliases: [ "service" ]
- 'B(Required) option when O(action) is one of: V(downtime), V(acknowledge), V(forced_check), V(enable_alerts), V(disable_alerts).'
aliases: ["service"]
type: str
servicegroup:
description:
@ -94,9 +90,9 @@ options:
type: str
author: "Tim Bielawa (@tbielawa)"
'''
"""
EXAMPLES = '''
EXAMPLES = r"""
- name: Set 30 minutes of apache downtime
community.general.nagios:
action: downtime
@ -245,7 +241,7 @@ EXAMPLES = '''
community.general.nagios:
action: command
command: DISABLE_FAILURE_PREDICTION
'''
"""
import time
import os.path

View File

@ -9,13 +9,12 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = '''
---
DOCUMENTATION = r"""
module: netcup_dns
notes: []
short_description: Manage Netcup DNS records
description:
- "Manages DNS records via the Netcup API, see the docs U(https://ccp.netcup.net/run/webservice/servers/endpoint.php)."
- Manages DNS records using the Netcup API, see the docs U(https://ccp.netcup.net/run/webservice/servers/endpoint.php).
extends_documentation_fragment:
- community.general.attributes
attributes:
@ -26,12 +25,12 @@ attributes:
options:
api_key:
description:
- "API key for authentication, must be obtained via the netcup CCP (U(https://ccp.netcup.net))."
- API key for authentication, must be obtained using the netcup CCP (U(https://ccp.netcup.net)).
required: true
type: str
api_password:
description:
- "API password for authentication, must be obtained via the netcup CCP (U(https://ccp.netcup.net))."
- API password for authentication, must be obtained using the netcup CCP (U(https://ccp.netcup.net)).
required: true
type: str
customer_id:
@ -48,7 +47,7 @@ options:
description:
- Record to add or delete, supports wildcard (V(*)). Default is V(@) (that is, the zone name).
default: "@"
aliases: [ name ]
aliases: [name]
type: str
type:
description:
@ -80,7 +79,7 @@ options:
- Whether the record should exist or not.
required: false
default: present
choices: [ 'present', 'absent' ]
choices: ['present', 'absent']
type: str
timeout:
description:
@ -91,10 +90,9 @@ options:
requirements:
- "nc-dnsapi >= 0.1.3"
author: "Nicolai Buchwitz (@nbuchwitz)"
"""
'''
EXAMPLES = '''
EXAMPLES = r"""
- name: Create a record of type A
community.general.netcup_dns:
api_key: "..."
@ -156,41 +154,41 @@ EXAMPLES = '''
type: "A"
value: "127.0.0.1"
timeout: 30
"""
'''
RETURN = '''
RETURN = r"""
records:
description: list containing all records
returned: success
type: complex
contains:
name:
description: the record name
returned: success
type: str
sample: fancy-hostname
type:
description: the record type
returned: success
type: str
sample: A
value:
description: the record destination
returned: success
type: str
sample: 127.0.0.1
priority:
description: the record priority (only relevant if type=MX)
returned: success
type: int
sample: 0
id:
description: internal id of the record
returned: success
type: int
sample: 12345
'''
description: List containing all records.
returned: success
type: list
elements: dict
contains:
name:
description: The record name.
returned: success
type: str
sample: fancy-hostname
type:
description: The record type.
returned: success
type: str
sample: A
value:
description: The record destination.
returned: success
type: str
sample: 127.0.0.1
priority:
description: The record priority (only relevant if RV(records[].type=MX)).
returned: success
type: int
sample: 0
id:
description: Internal id of the record.
returned: success
type: int
sample: 12345
"""
import traceback

View File

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

View File

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

View File

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

View File

@ -8,8 +8,7 @@
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = r'''
---
DOCUMENTATION = r"""
module: nictagadm
short_description: Manage nic tags on SmartOS systems
description:
@ -26,39 +25,39 @@ attributes:
options:
name:
description:
- Name of the nic tag.
- Name of the nic tag.
required: true
type: str
mac:
description:
- Specifies the O(mac) address to attach the nic tag to when not creating an O(etherstub).
- Parameters O(mac) and O(etherstub) are mutually exclusive.
- Specifies the O(mac) address to attach the nic tag to when not creating an O(etherstub).
- Parameters O(mac) and O(etherstub) are mutually exclusive.
type: str
etherstub:
description:
- Specifies that the nic tag will be attached to a created O(etherstub).
- Parameter O(etherstub) is mutually exclusive with both O(mtu), and O(mac).
- Specifies that the nic tag will be attached to a created O(etherstub).
- Parameter O(etherstub) is mutually exclusive with both O(mtu), and O(mac).
type: bool
default: false
mtu:
description:
- Specifies the size of the O(mtu) of the desired nic tag.
- Parameters O(mtu) and O(etherstub) are mutually exclusive.
- Specifies the size of the O(mtu) of the desired nic tag.
- Parameters O(mtu) and O(etherstub) are mutually exclusive.
type: int
force:
description:
- When O(state=absent) this switch will use the C(-f) parameter and delete the nic tag regardless of existing VMs.
- When O(state=absent) this switch will use the C(-f) parameter and delete the nic tag regardless of existing VMs.
type: bool
default: false
state:
description:
- Create or delete a SmartOS nic tag.
- Create or delete a SmartOS nic tag.
type: str
choices: [ absent, present ]
choices: [absent, present]
default: present
'''
"""
EXAMPLES = r'''
EXAMPLES = r"""
- name: Create 'storage0' on '00:1b:21:a3:f5:4d'
community.general.nictagadm:
name: storage0
@ -70,11 +69,11 @@ EXAMPLES = r'''
community.general.nictagadm:
name: storage0
state: absent
'''
"""
RETURN = r'''
RETURN = r"""
name:
description: nic tag name
description: Nic tag name.
returned: always
type: str
sample: storage0
@ -84,26 +83,26 @@ mac:
type: str
sample: 00:1b:21:a3:f5:4d
etherstub:
description: specifies if the nic tag will create and attach to an etherstub.
description: Specifies if the nic tag will create and attach to an etherstub.
returned: always
type: bool
sample: false
mtu:
description: specifies which MTU size was passed during the nictagadm add command. mtu and etherstub are mutually exclusive.
description: Specifies which MTU size was passed during the nictagadm add command. mtu and etherstub are mutually exclusive.
returned: always
type: int
sample: 1500
force:
description: Shows if -f was used during the deletion of a nic tag
description: Shows if -f was used during the deletion of a nic tag.
returned: always
type: bool
sample: false
state:
description: state of the target
description: State of the target.
returned: always
type: str
sample: present
'''
"""
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.common.network import is_mac

File diff suppressed because it is too large Load Diff

View File

@ -8,8 +8,7 @@
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = '''
---
DOCUMENTATION = r"""
module: nomad_job
author: FERREIRA Christophe (@chris93111)
version_added: "1.3.0"
@ -17,53 +16,53 @@ short_description: Launch a Nomad Job
description:
- Launch a Nomad job.
- Stop a Nomad job.
- Force start a Nomad job
- Force start a Nomad job.
requirements:
- python-nomad
extends_documentation_fragment:
- community.general.nomad
- community.general.attributes
attributes:
check_mode:
support: full
diff_mode:
support: none
check_mode:
support: full
diff_mode:
support: none
options:
name:
description:
- 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.
type: str
state:
description:
- Deploy or remove job.
choices: ["present", "absent"]
required: true
type: str
force_start:
description:
- Force job to started.
type: bool
default: false
content:
description:
- Content of Nomad job.
- Either this or O(name) must be specified.
type: str
content_format:
description:
- Type of content of Nomad job.
choices: ["hcl", "json"]
default: hcl
type: str
name:
description:
- 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.
type: str
state:
description:
- Deploy or remove job.
choices: ["present", "absent"]
required: true
type: str
force_start:
description:
- Force job to started.
type: bool
default: false
content:
description:
- Content of Nomad job.
- Either this or O(name) must be specified.
type: str
content_format:
description:
- Type of content of Nomad job.
choices: ["hcl", "json"]
default: hcl
type: str
seealso:
- name: Nomad jobs documentation
description: Complete documentation for Nomad API jobs.
link: https://www.nomadproject.io/api-docs/jobs/
'''
"""
EXAMPLES = '''
EXAMPLES = r"""
- name: Create job
community.general.nomad_job:
host: localhost
@ -92,7 +91,7 @@ EXAMPLES = '''
name: api
timeout: 120
force_start: true
'''
"""
import json

View File

@ -8,15 +8,14 @@
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = '''
---
DOCUMENTATION = r"""
module: nomad_job_info
author: FERREIRA Christophe (@chris93111)
version_added: "1.3.0"
short_description: Get Nomad Jobs info
description:
- Get info for one Nomad job.
- List Nomad jobs.
- Get info for one Nomad job.
- List Nomad jobs.
requirements:
- python-nomad
extends_documentation_fragment:
@ -24,18 +23,18 @@ extends_documentation_fragment:
- community.general.attributes
- community.general.attributes.info_module
options:
name:
description:
- Name of job for Get info.
- If not specified, lists all jobs.
type: str
name:
description:
- Name of job for Get info.
- If not specified, lists all jobs.
type: str
seealso:
- name: Nomad jobs documentation
description: Complete documentation for Nomad API jobs.
link: https://www.nomadproject.io/api-docs/jobs/
'''
"""
EXAMPLES = '''
EXAMPLES = r"""
- name: Get info for job awx
community.general.nomad_job_info:
host: localhost
@ -46,10 +45,9 @@ EXAMPLES = '''
community.general.nomad_job_info:
host: localhost
register: result
"""
'''
RETURN = '''
RETURN = r"""
result:
description: List with dictionary contains jobs info
returned: success
@ -264,7 +262,7 @@ result:
}
]
'''
"""
from ansible.module_utils.basic import AnsibleModule, missing_required_lib
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
DOCUMENTATION = '''
---
DOCUMENTATION = r"""
module: nomad_token
author: Pedro Nascimento (@apecnascimento)
version_added: "8.1.0"
short_description: Manage Nomad ACL tokens
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:
- python-nomad
- python-nomad
extends_documentation_fragment:
- community.general.nomad
- community.general.attributes
- community.general.nomad
- community.general.attributes
attributes:
check_mode:
support: none
diff_mode:
support: none
check_mode:
support: none
diff_mode:
support: none
options:
name:
description:
- Name of ACL token to create.
type: str
token_type:
description:
- The type of the token can be V(client), V(management), or V(bootstrap).
choices: ["client", "management", "bootstrap"]
type: str
default: "client"
policies:
description:
- A list of the policies assigned to the token.
type: list
elements: str
default: []
global_replicated:
description:
- Indicates whether or not the token was created with the C(--global).
type: bool
default: false
state:
description:
- Create or remove ACL token.
choices: ["present", "absent"]
required: true
type: str
name:
description:
- Name of ACL token to create.
type: str
token_type:
description:
- The type of the token can be V(client), V(management), or V(bootstrap).
choices: ["client", "management", "bootstrap"]
type: str
default: "client"
policies:
description:
- A list of the policies assigned to the token.
type: list
elements: str
default: []
global_replicated:
description:
- Indicates whether or not the token was created with the C(--global).
type: bool
default: false
state:
description:
- Create or remove ACL token.
choices: ["present", "absent"]
required: true
type: str
seealso:
- name: Nomad ACL documentation
description: Complete documentation for Nomad API ACL.
link: https://developer.hashicorp.com/nomad/api-docs/acl/tokens
'''
"""
EXAMPLES = '''
EXAMPLES = r"""
- name: Create boostrap token
community.general.nomad_token:
host: localhost
@ -75,7 +74,7 @@ EXAMPLES = '''
name: "Dev token"
token_type: client
policies:
- readonly
- readonly
global_replicated: false
state: absent
@ -85,8 +84,8 @@ EXAMPLES = '''
name: "Dev token"
token_type: client
policies:
- readonly
- devpolicy
- readonly
- devpolicy
global_replicated: false
state: absent
@ -95,9 +94,9 @@ EXAMPLES = '''
host: localhost
name: "Dev token"
state: absent
'''
"""
RETURN = '''
RETURN = r"""
result:
description: Result returned by nomad.
returned: always
@ -119,7 +118,7 @@ result:
"secret_id": "12e878ab-e1f6-e103-b4c4-3b5173bb4cea",
"type": "client"
}
'''
"""
from ansible.module_utils.basic import AnsibleModule, missing_required_lib
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
DOCUMENTATION = '''
---
DOCUMENTATION = r"""
module: nosh
author:
- "Thomas Caravia (@tacatac)"
- "Thomas Caravia (@tacatac)"
short_description: Manage services with nosh
description:
- Control running and enabled state for system-wide or user services.
- BSD and Linux systems are supported.
- Control running and enabled state for system-wide or user services.
- BSD and Linux systems are supported.
extends_documentation_fragment:
- community.general.attributes
- community.general.attributes
attributes:
check_mode:
support: full
diff_mode:
support: none
check_mode:
support: full
diff_mode:
support: none
options:
name:
type: str
required: true
description:
- Name of the service to manage.
state:
type: str
required: false
choices: [ started, stopped, reset, restarted, reloaded ]
description:
- V(started)/V(stopped) are idempotent actions that will not run
commands unless necessary.
V(restarted) will always bounce 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.
enabled:
required: false
type: bool
description:
- Enable or disable the service, independently of C(*.preset) file
preference or running state. Mutually exclusive with O(preset). Will take
effect prior to O(state=reset).
preset:
required: false
type: bool
description:
- Enable or disable the service according to local preferences in C(*.preset) files.
Mutually exclusive with O(enabled). Only has an effect if set to true. Will take
effect prior to O(state=reset).
user:
required: false
default: false
type: bool
description:
- Run system-control talking to the calling user's service manager, rather than
the system-wide service manager.
name:
type: str
required: true
description:
- Name of the service to manage.
state:
type: str
required: false
choices: [started, stopped, reset, restarted, reloaded]
description:
- V(started)/V(stopped) are idempotent actions that will not run commands unless necessary.
- V(restarted) will always bounce 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.
enabled:
required: false
type: bool
description:
- Enable or disable the service, independently of C(*.preset) file preference or running state. Mutually exclusive with O(preset). Will
take effect prior to O(state=reset).
preset:
required: false
type: bool
description:
- Enable or disable the service according to local preferences in C(*.preset) files. Mutually exclusive with O(enabled). Only has an effect
if set to true. Will take effect prior to O(state=reset).
user:
required: false
default: false
type: bool
description:
- Run system-control talking to the calling user's service manager, rather than the system-wide service manager.
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:
- 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
community.general.nosh:
name: dnscache
@ -122,215 +116,215 @@ EXAMPLES = '''
ansible.builtin.fail:
msg: "The {{ result.name }} service is running"
when: result.status and result.status['DaemontoolsEncoreState'] == "running"
'''
"""
RETURN = '''
RETURN = r"""
name:
description: name used to find the service
returned: success
type: str
sample: "sshd"
description: Name used to find the service.
returned: success
type: str
sample: "sshd"
service_path:
description: resolved path for the service
returned: success
type: str
sample: "/var/sv/sshd"
description: Resolved path for the service.
returned: success
type: str
sample: "/var/sv/sshd"
enabled:
description: whether the service is enabled at system bootstrap
returned: success
type: bool
sample: true
description: Whether the service is enabled at system bootstrap.
returned: success
type: bool
sample: true
preset:
description: whether the enabled status reflects the one set in the relevant C(*.preset) file
returned: success
type: bool
sample: 'False'
description: Whether the enabled status reflects the one set in the relevant C(*.preset) file.
returned: success
type: bool
sample: 'False'
state:
description: service process run state, V(none) if the service is not loaded and will not be started
returned: if state option is used
type: str
sample: "reloaded"
description: Service process run state, V(none) if the service is not loaded and will not be started.
returned: if state option is used
type: str
sample: "reloaded"
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
returned: success
type: complex
contains:
After:
description: [] # FIXME
returned: success
type: list
sample: ["/etc/service-bundles/targets/basic","../sshdgenkeys", "log"]
Before:
description: [] # FIXME
returned: success
type: list
sample: ["/etc/service-bundles/targets/shutdown"]
Conflicts:
description: [] # FIXME
returned: success
type: list
sample: []
DaemontoolsEncoreState:
description: [] # FIXME
returned: success
type: str
sample: "running"
DaemontoolsState:
description: [] # FIXME
returned: success
type: str
sample: "up"
Enabled:
description: [] # FIXME
returned: success
type: bool
sample: true
LogService:
description: [] # FIXME
returned: success
type: str
sample: "../cyclog@sshd"
MainPID:
description: [] # FIXME
returned: success
type: int
sample: 661
Paused:
description: [] # FIXME
returned: success
type: bool
sample: 'False'
ReadyAfterRun:
description: [] # FIXME
returned: success
type: bool
sample: 'False'
RemainAfterExit:
description: [] # FIXME
returned: success
type: bool
sample: 'False'
Required-By:
description: [] # FIXME
returned: success
type: list
sample: []
RestartExitStatusCode:
description: [] # FIXME
returned: success
type: int
sample: '0'
RestartExitStatusNumber:
description: [] # FIXME
returned: success
type: int
sample: '0'
RestartTimestamp:
description: [] # FIXME
returned: success
type: int
sample: 4611686019935648081
RestartUTCTimestamp:
description: [] # FIXME
returned: success
type: int
sample: 1508260140
RunExitStatusCode:
description: [] # FIXME
returned: success
type: int
sample: '0'
RunExitStatusNumber:
description: [] # FIXME
returned: success
type: int
sample: '0'
RunTimestamp:
description: [] # FIXME
returned: success
type: int
sample: 4611686019935648081
RunUTCTimestamp:
description: [] # FIXME
returned: success
type: int
sample: 1508260140
StartExitStatusCode:
description: [] # FIXME
returned: success
type: int
sample: 1
StartExitStatusNumber:
description: [] # FIXME
returned: success
type: int
sample: '0'
StartTimestamp:
description: [] # FIXME
returned: success
type: int
sample: 4611686019935648081
StartUTCTimestamp:
description: [] # FIXME
returned: success
type: int
sample: 1508260140
StopExitStatusCode:
description: [] # FIXME
returned: success
type: int
sample: '0'
StopExitStatusNumber:
description: [] # FIXME
returned: success
type: int
sample: '0'
StopTimestamp:
description: [] # FIXME
returned: success
type: int
sample: 4611686019935648081
StopUTCTimestamp:
description: [] # FIXME
returned: success
type: int
sample: 1508260140
Stopped-By:
description: [] # FIXME
returned: success
type: list
sample: ["/etc/service-bundles/targets/shutdown"]
Timestamp:
description: [] # FIXME
returned: success
type: int
sample: 4611686019935648081
UTCTimestamp:
description: [] # FIXME
returned: success
type: int
sample: 1508260140
Want:
description: [] # FIXME
returned: success
type: str
sample: "nothing"
Wanted-By:
description: [] # FIXME
returned: success
type: list
sample: ["/etc/service-bundles/targets/server","/etc/service-bundles/targets/sockets"]
Wants:
description: [] # FIXME
returned: success
type: list
sample: ["/etc/service-bundles/targets/basic","../sshdgenkeys"]
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
type: complex
contains:
After:
description: [] # FIXME
returned: success
type: list
sample: ["/etc/service-bundles/targets/basic", "../sshdgenkeys", "log"]
Before:
description: [] # FIXME
returned: success
type: list
sample: ["/etc/service-bundles/targets/shutdown"]
Conflicts:
description: [] # FIXME
returned: success
type: list
sample: []
DaemontoolsEncoreState:
description: [] # FIXME
returned: success
type: str
sample: "running"
DaemontoolsState:
description: [] # FIXME
returned: success
type: str
sample: "up"
Enabled:
description: [] # FIXME
returned: success
type: bool
sample: true
LogService:
description: [] # FIXME
returned: success
type: str
sample: "../cyclog@sshd"
MainPID:
description: [] # FIXME
returned: success
type: int
sample: 661
Paused:
description: [] # FIXME
returned: success
type: bool
sample: 'False'
ReadyAfterRun:
description: [] # FIXME
returned: success
type: bool
sample: 'False'
RemainAfterExit:
description: [] # FIXME
returned: success
type: bool
sample: 'False'
Required-By:
description: [] # FIXME
returned: success
type: list
sample: []
RestartExitStatusCode:
description: [] # FIXME
returned: success
type: int
sample: '0'
RestartExitStatusNumber:
description: [] # FIXME
returned: success
type: int
sample: '0'
RestartTimestamp:
description: [] # FIXME
returned: success
type: int
sample: 4611686019935648081
RestartUTCTimestamp:
description: [] # FIXME
returned: success
type: int
sample: 1508260140
RunExitStatusCode:
description: [] # FIXME
returned: success
type: int
sample: '0'
RunExitStatusNumber:
description: [] # FIXME
returned: success
type: int
sample: '0'
RunTimestamp:
description: [] # FIXME
returned: success
type: int
sample: 4611686019935648081
RunUTCTimestamp:
description: [] # FIXME
returned: success
type: int
sample: 1508260140
StartExitStatusCode:
description: [] # FIXME
returned: success
type: int
sample: 1
StartExitStatusNumber:
description: [] # FIXME
returned: success
type: int
sample: '0'
StartTimestamp:
description: [] # FIXME
returned: success
type: int
sample: 4611686019935648081
StartUTCTimestamp:
description: [] # FIXME
returned: success
type: int
sample: 1508260140
StopExitStatusCode:
description: [] # FIXME
returned: success
type: int
sample: '0'
StopExitStatusNumber:
description: [] # FIXME
returned: success
type: int
sample: '0'
StopTimestamp:
description: [] # FIXME
returned: success
type: int
sample: 4611686019935648081
StopUTCTimestamp:
description: [] # FIXME
returned: success
type: int
sample: 1508260140
Stopped-By:
description: [] # FIXME
returned: success
type: list
sample: ["/etc/service-bundles/targets/shutdown"]
Timestamp:
description: [] # FIXME
returned: success
type: int
sample: 4611686019935648081
UTCTimestamp:
description: [] # FIXME
returned: success
type: int
sample: 1508260140
Want:
description: [] # FIXME
returned: success
type: str
sample: "nothing"
Wanted-By:
description: [] # FIXME
returned: success
type: list
sample: ["/etc/service-bundles/targets/server", "/etc/service-bundles/targets/sockets"]
Wants:
description: [] # FIXME
returned: success
type: list
sample: ["/etc/service-bundles/targets/basic", "../sshdgenkeys"]
user:
description: whether the user-level service manager is called
returned: success
type: bool
sample: false
'''
description: Whether the user-level service manager is called.
returned: success
type: bool
sample: false
"""
import json

View File

@ -8,8 +8,7 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = r'''
---
DOCUMENTATION = r"""
module: npm
short_description: Manage node.js packages with npm
description:
@ -83,7 +82,7 @@ options:
required: false
type: str
default: present
choices: [ "present", "absent", "latest" ]
choices: ["present", "absent", "latest"]
no_optional:
description:
- Use the C(--no-optional) flag when installing.
@ -103,10 +102,10 @@ options:
default: false
version_added: 9.5.0
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.
community.general.npm:
name: coffee-script
@ -153,7 +152,7 @@ EXAMPLES = r'''
path: /app/location
executable: /opt/nvm/v0.10.1/bin/npm
state: present
'''
"""
import json
import os

View File

@ -14,89 +14,87 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = '''
---
DOCUMENTATION = r"""
module: nsupdate
short_description: Manage DNS records
description:
- Create, update and remove DNS records using DDNS updates
- Create, update and remove DNS records using DDNS updates.
requirements:
- dnspython
author: "Loic Blot (@nerzhul)"
extends_documentation_fragment:
- community.general.attributes
attributes:
check_mode:
support: full
diff_mode:
support: none
check_mode:
support: full
diff_mode:
support: none
options:
state:
description:
- Manage DNS record.
choices: ['present', 'absent']
default: 'present'
type: str
server:
description:
- Apply DNS modification on this server, specified by IPv4 or IPv6 address.
required: true
type: str
port:
description:
- Use this TCP port when connecting to O(server).
default: 53
type: int
key_name:
description:
- Use TSIG key name to authenticate against DNS O(server)
type: str
key_secret:
description:
- Use TSIG key secret, associated with O(key_name), to authenticate against O(server)
type: str
key_algorithm:
description:
- 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',
'hmac-sha512']
default: 'hmac-md5'
type: str
zone:
description:
- DNS record will be modified on this O(zone).
- When omitted DNS will be queried to attempt finding the correct zone.
type: str
record:
description:
- Sets the DNS record to modify. When zone is omitted this has to be absolute (ending with a dot).
required: true
type: str
type:
description:
- Sets the record type.
default: 'A'
type: str
ttl:
description:
- Sets the record TTL.
default: 3600
type: int
value:
description:
- Sets the record value.
type: list
elements: str
protocol:
description:
- Sets the transport protocol (TCP or UDP). TCP is the recommended and a more robust option.
default: 'tcp'
choices: ['tcp', 'udp']
type: str
'''
state:
description:
- Manage DNS record.
choices: ['present', 'absent']
default: 'present'
type: str
server:
description:
- Apply DNS modification on this server, specified by IPv4 or IPv6 address.
required: true
type: str
port:
description:
- Use this TCP port when connecting to O(server).
default: 53
type: int
key_name:
description:
- Use TSIG key name to authenticate against DNS O(server).
type: str
key_secret:
description:
- Use TSIG key secret, associated with O(key_name), to authenticate against O(server).
type: str
key_algorithm:
description:
- 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', 'hmac-sha512']
default: 'hmac-md5'
type: str
zone:
description:
- DNS record will be modified on this O(zone).
- When omitted DNS will be queried to attempt finding the correct zone.
type: str
record:
description:
- Sets the DNS record to modify. When zone is omitted this has to be absolute (ending with a dot).
required: true
type: str
type:
description:
- Sets the record type.
default: 'A'
type: str
ttl:
description:
- Sets the record TTL.
default: 3600
type: int
value:
description:
- Sets the record value.
type: list
elements: str
protocol:
description:
- Sets the transport protocol (TCP or UDP). TCP is the recommended and a more robust option.
default: 'tcp'
choices: ['tcp', 'udp']
type: str
"""
EXAMPLES = '''
EXAMPLES = r"""
- name: Add or modify ansible.example.org A to 192.168.1.1"
community.general.nsupdate:
key_name: "nsupdate"
@ -143,49 +141,49 @@ EXAMPLES = '''
record: "1.1.168.192.in-addr.arpa."
type: "PTR"
state: absent
'''
"""
RETURN = '''
RETURN = r"""
changed:
description: If module has modified record
returned: success
type: str
description: If module has modified record.
returned: success
type: str
record:
description: DNS record
returned: success
type: str
sample: 'ansible'
description: DNS record.
returned: success
type: str
sample: 'ansible'
ttl:
description: DNS record TTL
returned: success
type: int
sample: 86400
description: DNS record TTL.
returned: success
type: int
sample: 86400
type:
description: DNS record type
returned: success
type: str
sample: 'CNAME'
description: DNS record type.
returned: success
type: str
sample: 'CNAME'
value:
description: DNS record value(s)
returned: success
type: list
sample: '192.168.1.1'
description: DNS record value(s).
returned: success
type: list
sample: '192.168.1.1'
zone:
description: DNS record zone
returned: success
type: str
sample: 'example.org.'
description: DNS record zone.
returned: success
type: str
sample: 'example.org.'
dns_rc:
description: dnspython return code
returned: always
type: int
sample: 4
description: C(dnspython) return code.
returned: always
type: int
sample: 4
dns_rc_str:
description: dnspython return code (string representation)
returned: always
type: str
sample: 'REFUSED'
'''
description: C(dnspython) return code (string representation).
returned: always
type: str
sample: 'REFUSED'
"""
import traceback