i[b-n]*.py: normalize docs (#9393)

* i[b-n]*.py: normalize docs

* Update plugins/modules/ilo_redfish_command.py

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

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
pull/9420/head
Alexei Znamensky 2024-12-27 09:52:26 +13:00 committed by GitHub
parent 61b2304f4d
commit 84655b0d0f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
25 changed files with 1036 additions and 1100 deletions

View File

@ -10,14 +10,12 @@
from __future__ import absolute_import, division, print_function from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = r"""
---
module: ibm_sa_domain module: ibm_sa_domain
short_description: Manages domains on IBM Spectrum Accelerate Family storage systems short_description: Manages domains on IBM Spectrum Accelerate Family storage systems
description: description:
- "This module can be used to add domains to or removes them from IBM Spectrum Accelerate Family storage systems." - This module can be used to add domains to or removes them from IBM Spectrum Accelerate Family storage systems.
attributes: attributes:
check_mode: check_mode:
support: none support: none
@ -34,11 +32,11 @@ options:
description: description:
- The desired state of the domain. - The desired state of the domain.
default: "present" default: "present"
choices: [ "present", "absent" ] choices: ["present", "absent"]
type: str type: str
ldap_id: ldap_id:
description: description:
- ldap id to add to the domain. - LDAP id to add to the domain.
required: false required: false
type: str type: str
size: size:
@ -93,9 +91,9 @@ extends_documentation_fragment:
author: author:
- Tzur Eliyahu (@tzure) - Tzur Eliyahu (@tzure)
''' """
EXAMPLES = ''' EXAMPLES = r"""
- name: Define new domain. - name: Define new domain.
community.general.ibm_sa_domain: community.general.ibm_sa_domain:
domain: domain_name domain: domain_name
@ -112,14 +110,14 @@ EXAMPLES = '''
username: admin username: admin
password: secret password: secret
endpoints: hostdev-system endpoints: hostdev-system
''' """
RETURN = ''' RETURN = r"""
msg: msg:
description: module return status. description: Module return status.
returned: as needed returned: as needed
type: str type: str
sample: "domain 'domain_name' created successfully." sample: "domain 'domain_name' created successfully."
''' """
from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.basic import AnsibleModule
from ansible_collections.community.general.plugins.module_utils.ibm_sa_utils import execute_pyxcli_command, \ from ansible_collections.community.general.plugins.module_utils.ibm_sa_utils import execute_pyxcli_command, \

View File

@ -10,14 +10,12 @@
from __future__ import absolute_import, division, print_function from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = r"""
---
module: ibm_sa_host module: ibm_sa_host
short_description: Adds hosts to or removes them from IBM Spectrum Accelerate Family storage systems short_description: Adds hosts to or removes them from IBM Spectrum Accelerate Family storage systems
description: description:
- "This module adds hosts to or removes them from IBM Spectrum Accelerate Family storage systems." - This module adds hosts to or removes them from IBM Spectrum Accelerate Family storage systems.
attributes: attributes:
check_mode: check_mode:
support: none support: none
@ -34,7 +32,7 @@ options:
description: description:
- Host state. - Host state.
default: "present" default: "present"
choices: [ "present", "absent" ] choices: ["present", "absent"]
type: str type: str
cluster: cluster:
description: description:
@ -43,21 +41,18 @@ options:
type: str type: str
domain: domain:
description: description:
- The domains the cluster will be attached to. - The domains the cluster will be attached to. To include more than one domain, separate domain names with commas. To
To include more than one domain, include all existing domains, use an asterisk (V(*)).
separate domain names with commas.
To include all existing domains, use an asterisk ("*").
required: false required: false
type: str type: str
iscsi_chap_name: iscsi_chap_name:
description: description:
- The host's CHAP name identifier - The host's CHAP name identifier.
required: false required: false
type: str type: str
iscsi_chap_secret: iscsi_chap_secret:
description: description:
- The password of the initiator used to - The password of the initiator used to authenticate to the system when CHAP is enable.
authenticate to the system when CHAP is enable
required: false required: false
type: str type: str
@ -67,9 +62,9 @@ extends_documentation_fragment:
author: author:
- Tzur Eliyahu (@tzure) - Tzur Eliyahu (@tzure)
''' """
EXAMPLES = ''' EXAMPLES = r"""
- name: Define new host. - name: Define new host.
community.general.ibm_sa_host: community.general.ibm_sa_host:
host: host_name host: host_name
@ -85,9 +80,9 @@ EXAMPLES = '''
username: admin username: admin
password: secret password: secret
endpoints: hostdev-system endpoints: hostdev-system
''' """
RETURN = ''' RETURN = r"""
''' """
from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.basic import AnsibleModule
from ansible_collections.community.general.plugins.module_utils.ibm_sa_utils import execute_pyxcli_command, \ from ansible_collections.community.general.plugins.module_utils.ibm_sa_utils import execute_pyxcli_command, \

View File

@ -10,15 +10,12 @@
from __future__ import absolute_import, division, print_function from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = r"""
---
module: ibm_sa_host_ports module: ibm_sa_host_ports
short_description: Add host ports on IBM Spectrum Accelerate Family storage systems short_description: Add host ports on IBM Spectrum Accelerate Family storage systems
description: description:
- "This module adds ports to or removes them from the hosts - This module adds ports to or removes them from the hosts on IBM Spectrum Accelerate Family storage systems.
on IBM Spectrum Accelerate Family storage systems."
attributes: attributes:
check_mode: check_mode:
support: none support: none
@ -35,11 +32,11 @@ options:
description: description:
- Host ports state. - Host ports state.
default: "present" default: "present"
choices: [ "present", "absent" ] choices: ["present", "absent"]
type: str type: str
iscsi_name: iscsi_name:
description: description:
- iSCSI initiator name. - The iSCSI initiator name.
required: false required: false
type: str type: str
fcaddress: fcaddress:
@ -59,9 +56,9 @@ extends_documentation_fragment:
author: author:
- Tzur Eliyahu (@tzure) - Tzur Eliyahu (@tzure)
''' """
EXAMPLES = ''' EXAMPLES = r"""
- name: Add ports for host. - name: Add ports for host.
community.general.ibm_sa_host_ports: community.general.ibm_sa_host_ports:
host: test_host host: test_host
@ -79,10 +76,9 @@ EXAMPLES = '''
password: secret password: secret
endpoints: hostdev-system endpoints: hostdev-system
state: absent state: absent
"""
''' RETURN = r"""
RETURN = ''' """
'''
from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.basic import AnsibleModule
from ansible_collections.community.general.plugins.module_utils.ibm_sa_utils import (execute_pyxcli_command, connect_ssl, from ansible_collections.community.general.plugins.module_utils.ibm_sa_utils import (execute_pyxcli_command, connect_ssl,

View File

@ -10,14 +10,12 @@
from __future__ import absolute_import, division, print_function from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = r"""
---
module: ibm_sa_pool module: ibm_sa_pool
short_description: Handles pools on IBM Spectrum Accelerate Family storage systems short_description: Handles pools on IBM Spectrum Accelerate Family storage systems
description: description:
- "This module creates or deletes pools to be used on IBM Spectrum Accelerate Family storage systems" - This module creates or deletes pools to be used on IBM Spectrum Accelerate Family storage systems.
attributes: attributes:
check_mode: check_mode:
support: none support: none
@ -34,16 +32,16 @@ options:
description: description:
- Pool state. - Pool state.
default: "present" default: "present"
choices: [ "present", "absent" ] choices: ["present", "absent"]
type: str type: str
size: size:
description: description:
- Pool size in GB - Pool size in GB.
required: false required: false
type: str type: str
snapshot_size: snapshot_size:
description: description:
- Pool snapshot size in GB - Pool snapshot size in GB.
required: false required: false
type: str type: str
domain: domain:
@ -63,9 +61,9 @@ extends_documentation_fragment:
author: author:
- Tzur Eliyahu (@tzure) - Tzur Eliyahu (@tzure)
''' """
EXAMPLES = ''' EXAMPLES = r"""
- name: Create new pool. - name: Create new pool.
community.general.ibm_sa_pool: community.general.ibm_sa_pool:
name: pool_name name: pool_name
@ -82,9 +80,9 @@ EXAMPLES = '''
username: admin username: admin
password: secret password: secret
endpoints: hostdev-system endpoints: hostdev-system
''' """
RETURN = ''' RETURN = r"""
''' """
from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.basic import AnsibleModule
from ansible_collections.community.general.plugins.module_utils.ibm_sa_utils import execute_pyxcli_command, \ from ansible_collections.community.general.plugins.module_utils.ibm_sa_utils import execute_pyxcli_command, \

View File

@ -10,14 +10,12 @@
from __future__ import absolute_import, division, print_function from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = r"""
---
module: ibm_sa_vol module: ibm_sa_vol
short_description: Handle volumes on IBM Spectrum Accelerate Family storage systems short_description: Handle volumes on IBM Spectrum Accelerate Family storage systems
description: description:
- "This module creates or deletes volumes to be used on IBM Spectrum Accelerate Family storage systems." - This module creates or deletes volumes to be used on IBM Spectrum Accelerate Family storage systems.
attributes: attributes:
check_mode: check_mode:
support: none support: none
@ -39,7 +37,7 @@ options:
description: description:
- Volume state. - Volume state.
default: "present" default: "present"
choices: [ "present", "absent" ] choices: ["present", "absent"]
type: str type: str
size: size:
description: description:
@ -53,9 +51,9 @@ extends_documentation_fragment:
author: author:
- Tzur Eliyahu (@tzure) - Tzur Eliyahu (@tzure)
''' """
EXAMPLES = ''' EXAMPLES = r"""
- name: Create a new volume. - name: Create a new volume.
community.general.ibm_sa_vol: community.general.ibm_sa_vol:
vol: volume_name vol: volume_name
@ -73,9 +71,9 @@ EXAMPLES = '''
username: admin username: admin
password: secret password: secret
endpoints: hostdev-system endpoints: hostdev-system
''' """
RETURN = ''' RETURN = r"""
''' """
from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.basic import AnsibleModule
from ansible_collections.community.general.plugins.module_utils.ibm_sa_utils import execute_pyxcli_command, \ from ansible_collections.community.general.plugins.module_utils.ibm_sa_utils import execute_pyxcli_command, \

View File

@ -10,15 +10,12 @@
from __future__ import absolute_import, division, print_function from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = r"""
---
module: ibm_sa_vol_map module: ibm_sa_vol_map
short_description: Handles volume mapping on IBM Spectrum Accelerate Family storage systems short_description: Handles volume mapping on IBM Spectrum Accelerate Family storage systems
description: description:
- "This module maps volumes to or unmaps them from the hosts on - This module maps volumes to or unmaps them from the hosts on IBM Spectrum Accelerate Family storage systems.
IBM Spectrum Accelerate Family storage systems."
attributes: attributes:
check_mode: check_mode:
support: none support: none
@ -33,10 +30,9 @@ options:
type: str type: str
state: state:
default: "present" default: "present"
choices: [ "present", "absent" ] choices: ["present", "absent"]
description: description:
- When the state is present the volume is mapped. - When the state is present the volume is mapped. When the state is absent, the volume is meant to be unmapped.
When the state is absent, the volume is meant to be unmapped.
type: str type: str
cluster: cluster:
@ -66,9 +62,9 @@ extends_documentation_fragment:
author: author:
- Tzur Eliyahu (@tzure) - Tzur Eliyahu (@tzure)
''' """
EXAMPLES = ''' EXAMPLES = r"""
- name: Map volume to host. - name: Map volume to host.
community.general.ibm_sa_vol_map: community.general.ibm_sa_vol_map:
vol: volume_name vol: volume_name
@ -96,9 +92,9 @@ EXAMPLES = '''
password: secret password: secret
endpoints: hostdev-system endpoints: hostdev-system
state: absent state: absent
''' """
RETURN = ''' RETURN = r"""
''' """
from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.basic import AnsibleModule
from ansible_collections.community.general.plugins.module_utils.ibm_sa_utils import (execute_pyxcli_command, from ansible_collections.community.general.plugins.module_utils.ibm_sa_utils import (execute_pyxcli_command,

View File

@ -13,8 +13,7 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = r"""
---
module: icinga2_feature module: icinga2_feature
short_description: Manage Icinga2 feature short_description: Manage Icinga2 feature
@ -41,11 +40,11 @@ options:
- If set to V(present) and feature is already enabled, then nothing is changed. - If set to V(present) and feature is already enabled, then nothing is changed.
- If set to V(absent) and feature is enabled, then feature is disabled. - If set to V(absent) and feature is enabled, then feature is disabled.
- If set to V(absent) and feature is already disabled, then nothing is changed. - If set to V(absent) and feature is already disabled, then nothing is changed.
choices: [ "present", "absent" ] choices: ["present", "absent"]
default: present default: present
''' """
EXAMPLES = ''' EXAMPLES = r"""
- name: Enable ido-pgsql feature - name: Enable ido-pgsql feature
community.general.icinga2_feature: community.general.icinga2_feature:
name: ido-pgsql name: ido-pgsql
@ -55,11 +54,11 @@ EXAMPLES = '''
community.general.icinga2_feature: community.general.icinga2_feature:
name: api name: api
state: absent state: absent
''' """
RETURN = ''' RETURN = r"""
# #
''' """
import re import re
from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.basic import AnsibleModule

View File

@ -11,13 +11,12 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = r"""
---
module: icinga2_host module: icinga2_host
short_description: Manage a host in Icinga2 short_description: Manage a host in Icinga2
description: description:
- "Add or remove a host to Icinga2 through the API." - Add or remove a host to Icinga2 through the API.
- "See U(https://www.icinga.com/docs/icinga2/latest/doc/12-icinga2-api/)" - See U(https://www.icinga.com/docs/icinga2/latest/doc/12-icinga2-api/).
author: "Jurgen Brand (@t794104)" author: "Jurgen Brand (@t794104)"
attributes: attributes:
check_mode: check_mode:
@ -28,17 +27,16 @@ options:
url: url:
type: str type: str
description: description:
- HTTP, HTTPS, or FTP URL in the form (http|https|ftp)://[user[:pass]]@host.domain[:port]/path - HTTP, HTTPS, or FTP URL in the form V((http|https|ftp\)://[user[:pass]]@host.domain[:port]/path).
use_proxy: use_proxy:
description: description:
- If V(false), it will not use a proxy, even if one is defined in - If V(false), it will not use a proxy, even if one is defined in an environment variable on the target hosts.
an environment variable on the target hosts.
type: bool type: bool
default: true default: 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
on personally controlled sites using self-signed certificates. self-signed certificates.
type: bool type: bool
default: true default: true
url_username: url_username:
@ -53,29 +51,26 @@ options:
- If the O(url_username) parameter is not specified, the O(url_password) parameter will not be used. - If the O(url_username) parameter is not specified, the O(url_password) parameter will not be used.
force_basic_auth: force_basic_auth:
description: description:
- httplib2, the library used by the uri module only sends authentication information when a webservice - Httplib2, the library used by the uri module only sends authentication information when a webservice responds to an
responds to an initial request with a 401 status. Since some basic auth services do not properly initial request with a 401 status. Since some basic auth services do not properly send a 401, logins will fail. This
send a 401, logins will fail. This option forces the sending of the Basic authentication header option forces the sending of the Basic authentication header upon initial request.
upon initial request.
type: bool type: bool
default: false default: false
client_cert: client_cert:
type: path type: path
description: description:
- PEM formatted certificate chain file to be used for SSL client - PEM formatted certificate chain file to be used for SSL client authentication. This file can also include the key
authentication. This file can also include the key as well, and if as well, and if the key is included, O(client_key) is not required.
the key is included, O(client_key) is not required.
client_key: client_key:
type: path type: path
description: description:
- PEM formatted file that contains your private key to be used for SSL - PEM formatted file that contains your private key to be used for SSL client authentication. If O(client_cert) contains
client authentication. If O(client_cert) contains both the certificate both the certificate and key, this option is not required.
and key, this option is not required.
state: state:
type: str type: str
description: description:
- Apply feature state. - Apply feature state.
choices: [ "present", "absent" ] choices: ["present", "absent"]
default: present default: present
name: name:
type: str type: str
@ -114,9 +109,9 @@ options:
extends_documentation_fragment: extends_documentation_fragment:
- ansible.builtin.url - ansible.builtin.url
- community.general.attributes - community.general.attributes
''' """
EXAMPLES = ''' EXAMPLES = r"""
- name: Add host to icinga - name: Add host to icinga
community.general.icinga2_host: community.general.icinga2_host:
url: "https://icinga2.example.com" url: "https://icinga2.example.com"
@ -128,18 +123,18 @@ EXAMPLES = '''
variables: variables:
foo: "bar" foo: "bar"
delegate_to: 127.0.0.1 delegate_to: 127.0.0.1
''' """
RETURN = ''' RETURN = r"""
name: name:
description: The name used to create, modify or delete the host description: The name used to create, modify or delete the host.
type: str type: str
returned: always returned: always
data: data:
description: The data structure used for create, modify or delete of the host description: The data structure used for create, modify or delete of the host.
type: dict type: dict
returned: always returned: always
''' """
import json import json

View File

@ -8,13 +8,11 @@
from __future__ import absolute_import, division, print_function from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = r"""
---
module: idrac_redfish_command module: idrac_redfish_command
short_description: Manages Out-Of-Band controllers using iDRAC OEM Redfish APIs short_description: Manages Out-Of-Band controllers using iDRAC OEM Redfish APIs
description: description:
- Builds Redfish URIs locally and sends them to remote OOB controllers to - Builds Redfish URIs locally and sends them to remote OOB controllers to perform an action.
perform an action.
- For use with Dell iDRAC operations that require Redfish OEM extensions. - For use with Dell iDRAC operations that require Redfish OEM extensions.
extends_documentation_fragment: extends_documentation_fragment:
- community.general.attributes - community.general.attributes
@ -66,10 +64,10 @@ options:
version_added: '0.2.0' version_added: '0.2.0'
author: "Jose Delarosa (@jose-delarosa)" author: "Jose Delarosa (@jose-delarosa)"
''' """
EXAMPLES = ''' EXAMPLES = r"""
- name: Create BIOS configuration job (schedule BIOS setting update) - name: Create BIOS configuration job (schedule BIOS setting update)
community.general.idrac_redfish_command: community.general.idrac_redfish_command:
category: Systems category: Systems
command: CreateBiosConfigJob command: CreateBiosConfigJob
@ -77,11 +75,11 @@ EXAMPLES = '''
baseuri: "{{ baseuri }}" baseuri: "{{ baseuri }}"
username: "{{ username }}" username: "{{ username }}"
password: "{{ password }}" password: "{{ password }}"
''' """
RETURN = ''' RETURN = r"""
msg: msg:
description: Message with action result or error description description: Message with action result or error description.
returned: always returned: always
type: str type: str
sample: "Action was successful" sample: "Action was successful"
@ -90,10 +88,8 @@ return_values:
returned: on success returned: on success
type: dict type: dict
version_added: 6.6.0 version_added: 6.6.0
sample: { sample: {"job_id": "/redfish/v1/Managers/iDRAC.Embedded.1/Jobs/JID_471269252011"}
"job_id": "/redfish/v1/Managers/iDRAC.Embedded.1/Jobs/JID_471269252011" """
}
'''
import re import re
from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.basic import AnsibleModule

View File

@ -8,14 +8,12 @@
from __future__ import absolute_import, division, print_function from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = r"""
---
module: idrac_redfish_config module: idrac_redfish_config
short_description: Manages servers through iDRAC using Dell Redfish APIs short_description: Manages servers through iDRAC using Dell Redfish APIs
description: description:
- For use with Dell iDRAC operations that require Redfish OEM extensions - For use with Dell iDRAC operations that require Redfish OEM extensions.
- Builds Redfish URIs locally and sends them to remote iDRAC controllers to - Builds Redfish URIs locally and sends them to remote iDRAC controllers to set or update a configuration attribute.
set or update a configuration attribute.
extends_documentation_fragment: extends_documentation_fragment:
- community.general.attributes - community.general.attributes
attributes: attributes:
@ -33,9 +31,8 @@ options:
required: true required: true
description: description:
- List of commands to execute on iDRAC. - List of commands to execute on iDRAC.
- V(SetManagerAttributes), V(SetLifecycleControllerAttributes) and - V(SetManagerAttributes), V(SetLifecycleControllerAttributes) and V(SetSystemAttributes) are mutually exclusive commands
V(SetSystemAttributes) are mutually exclusive commands when O(category) when O(category) is V(Manager).
is V(Manager).
type: list type: list
elements: str elements: str
baseuri: baseuri:
@ -76,10 +73,10 @@ options:
version_added: '0.2.0' version_added: '0.2.0'
author: "Jose Delarosa (@jose-delarosa)" author: "Jose Delarosa (@jose-delarosa)"
''' """
EXAMPLES = ''' EXAMPLES = r"""
- name: Enable NTP and set NTP server and Time zone attributes in iDRAC - name: Enable NTP and set NTP server and Time zone attributes in iDRAC
community.general.idrac_redfish_config: community.general.idrac_redfish_config:
category: Manager category: Manager
command: SetManagerAttributes command: SetManagerAttributes
@ -92,7 +89,7 @@ EXAMPLES = '''
username: "{{ username}}" username: "{{ username}}"
password: "{{ password }}" password: "{{ password }}"
- name: Enable Syslog and set Syslog servers in iDRAC - name: Enable Syslog and set Syslog servers in iDRAC
community.general.idrac_redfish_config: community.general.idrac_redfish_config:
category: Manager category: Manager
command: SetManagerAttributes command: SetManagerAttributes
@ -105,7 +102,7 @@ EXAMPLES = '''
username: "{{ username}}" username: "{{ username}}"
password: "{{ password }}" password: "{{ password }}"
- name: Configure SNMP community string, port, protocol and trap format - name: Configure SNMP community string, port, protocol and trap format
community.general.idrac_redfish_config: community.general.idrac_redfish_config:
category: Manager category: Manager
command: SetManagerAttributes command: SetManagerAttributes
@ -121,7 +118,7 @@ EXAMPLES = '''
username: "{{ username}}" username: "{{ username}}"
password: "{{ password }}" password: "{{ password }}"
- name: Enable CSIOR - name: Enable CSIOR
community.general.idrac_redfish_config: community.general.idrac_redfish_config:
category: Manager category: Manager
command: SetLifecycleControllerAttributes command: SetLifecycleControllerAttributes
@ -132,7 +129,7 @@ EXAMPLES = '''
username: "{{ username}}" username: "{{ username}}"
password: "{{ password }}" password: "{{ password }}"
- name: Set Power Supply Redundancy Policy to A/B Grid Redundant - name: Set Power Supply Redundancy Policy to A/B Grid Redundant
community.general.idrac_redfish_config: community.general.idrac_redfish_config:
category: Manager category: Manager
command: SetSystemAttributes command: SetSystemAttributes
@ -142,15 +139,15 @@ EXAMPLES = '''
baseuri: "{{ baseuri }}" baseuri: "{{ baseuri }}"
username: "{{ username}}" username: "{{ username}}"
password: "{{ password }}" password: "{{ password }}"
''' """
RETURN = ''' RETURN = r"""
msg: msg:
description: Message with action result or error description description: Message with action result or error description.
returned: always returned: always
type: str type: str
sample: "Action was successful" sample: "Action was successful"
''' """
from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.common.validation import ( from ansible.module_utils.common.validation import (

View File

@ -8,13 +8,11 @@
from __future__ import absolute_import, division, print_function from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = r"""
---
module: idrac_redfish_info module: idrac_redfish_info
short_description: Gather PowerEdge server information through iDRAC using Redfish APIs short_description: Gather PowerEdge server information through iDRAC using Redfish APIs
description: description:
- Builds Redfish URIs locally and sends them to remote iDRAC controllers to - Builds Redfish URIs locally and sends them to remote iDRAC controllers to get information back.
get information back.
- For use with Dell EMC iDRAC operations that require Redfish OEM extensions. - For use with Dell EMC iDRAC operations that require Redfish OEM extensions.
extends_documentation_fragment: extends_documentation_fragment:
- community.general.attributes - community.general.attributes
@ -33,8 +31,7 @@ options:
required: true required: true
description: description:
- List of commands to execute on iDRAC. - List of commands to execute on iDRAC.
- V(GetManagerAttributes) returns the list of dicts containing iDRAC, - V(GetManagerAttributes) returns the list of dicts containing iDRAC, LifecycleController and System attributes.
LifecycleController and System attributes.
type: list type: list
elements: str elements: str
baseuri: baseuri:
@ -62,10 +59,10 @@ options:
type: int type: int
author: "Jose Delarosa (@jose-delarosa)" author: "Jose Delarosa (@jose-delarosa)"
''' """
EXAMPLES = ''' EXAMPLES = r"""
- name: Get Manager attributes with a default of 20 seconds - name: Get Manager attributes with a default of 20 seconds
community.general.idrac_redfish_info: community.general.idrac_redfish_info:
category: Manager category: Manager
command: GetManagerAttributes command: GetManagerAttributes
@ -75,54 +72,56 @@ EXAMPLES = '''
timeout: 20 timeout: 20
register: result register: result
# Examples to display the value of all or a single iDRAC attribute # Examples to display the value of all or a single iDRAC attribute
- name: Store iDRAC attributes as a fact variable - name: Store iDRAC attributes as a fact variable
ansible.builtin.set_fact: ansible.builtin.set_fact:
idrac_attributes: "{{ result.redfish_facts.entries | selectattr('Id', 'defined') | selectattr('Id', 'equalto', 'iDRACAttributes') | list | first }}" idrac_attributes: "{{ result.redfish_facts.entries | selectattr('Id', 'defined') | selectattr('Id', 'equalto', 'iDRACAttributes')
| list | first }}"
- name: Display all iDRAC attributes - name: Display all iDRAC attributes
ansible.builtin.debug: ansible.builtin.debug:
var: idrac_attributes var: idrac_attributes
- name: Display the value of 'Syslog.1.SysLogEnable' iDRAC attribute - name: Display the value of 'Syslog.1.SysLogEnable' iDRAC attribute
ansible.builtin.debug: ansible.builtin.debug:
var: idrac_attributes['Syslog.1.SysLogEnable'] var: idrac_attributes['Syslog.1.SysLogEnable']
# Examples to display the value of all or a single LifecycleController attribute # Examples to display the value of all or a single LifecycleController attribute
- name: Store LifecycleController attributes as a fact variable - name: Store LifecycleController attributes as a fact variable
ansible.builtin.set_fact: ansible.builtin.set_fact:
lc_attributes: "{{ result.redfish_facts.entries | selectattr('Id', 'defined') | selectattr('Id', 'equalto', 'LCAttributes') | list | first }}" lc_attributes: "{{ result.redfish_facts.entries | selectattr('Id', 'defined') | selectattr('Id', 'equalto', 'LCAttributes')
| list | first }}"
- name: Display LifecycleController attributes - name: Display LifecycleController attributes
ansible.builtin.debug: ansible.builtin.debug:
var: lc_attributes var: lc_attributes
- name: Display the value of 'CollectSystemInventoryOnRestart' attribute - name: Display the value of 'CollectSystemInventoryOnRestart' attribute
ansible.builtin.debug: ansible.builtin.debug:
var: lc_attributes['LCAttributes.1.CollectSystemInventoryOnRestart'] var: lc_attributes['LCAttributes.1.CollectSystemInventoryOnRestart']
# Examples to display the value of all or a single System attribute # Examples to display the value of all or a single System attribute
- name: Store System attributes as a fact variable - name: Store System attributes as a fact variable
ansible.builtin.set_fact: ansible.builtin.set_fact:
system_attributes: "{{ result.redfish_facts.entries | selectattr('Id', 'defined') | selectattr('Id', 'equalto', 'SystemAttributes') | list | first }}" system_attributes: "{{ result.redfish_facts.entries | selectattr('Id', 'defined') | selectattr('Id', 'equalto', 'SystemAttributes')
| list | first }}"
- name: Display System attributes - name: Display System attributes
ansible.builtin.debug: ansible.builtin.debug:
var: system_attributes var: system_attributes
- name: Display the value of 'PSRedPolicy' - name: Display the value of 'PSRedPolicy'
ansible.builtin.debug: ansible.builtin.debug:
var: system_attributes['ServerPwr.1.PSRedPolicy'] var: system_attributes['ServerPwr.1.PSRedPolicy']
"""
''' RETURN = r"""
RETURN = '''
msg: msg:
description: different results depending on task description: Different results depending on task.
returned: always returned: always
type: dict type: dict
sample: List of Manager attributes sample: List of Manager attributes
''' """
from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.basic import AnsibleModule
from ansible_collections.community.general.plugins.module_utils.redfish_utils import RedfishUtils from ansible_collections.community.general.plugins.module_utils.redfish_utils import RedfishUtils

View File

@ -6,14 +6,12 @@
from __future__ import absolute_import, division, print_function from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = r"""
---
module: ilo_redfish_command module: ilo_redfish_command
short_description: Manages Out-Of-Band controllers using Redfish APIs short_description: Manages Out-Of-Band controllers using Redfish APIs
version_added: 6.6.0 version_added: 6.6.0
description: description:
- Builds Redfish URIs locally and sends them to remote OOB controllers to - Builds Redfish URIs locally and sends them to remote OOB controllers to perform an action.
perform an action.
attributes: attributes:
check_mode: check_mode:
support: none support: none
@ -62,19 +60,19 @@ options:
type: int type: int
author: author:
- Varni H P (@varini-hp) - Varni H P (@varini-hp)
''' """
EXAMPLES = ''' EXAMPLES = r"""
- name: Wait for iLO Reboot Completion - name: Wait for iLO Reboot Completion
community.general.ilo_redfish_command: community.general.ilo_redfish_command:
category: Systems category: Systems
command: WaitforiLORebootCompletion command: WaitforiLORebootCompletion
baseuri: "{{ baseuri }}" baseuri: "{{ baseuri }}"
username: "{{ username }}" username: "{{ username }}"
password: "{{ password }}" password: "{{ password }}"
''' """
RETURN = ''' RETURN = r"""
ilo_redfish_command: ilo_redfish_command:
description: Returns the status of the operation performed on the iLO. description: Returns the status of the operation performed on the iLO.
type: dict type: dict
@ -84,13 +82,13 @@ ilo_redfish_command:
type: dict type: dict
contains: contains:
ret: ret:
description: Return True/False based on whether the operation was performed successfully. description: Return V(true)/V(false) based on whether the operation was performed successfully.
type: bool type: bool
msg: msg:
description: Status of the operation performed on the iLO. description: Status of the operation performed on the iLO.
type: str type: str
returned: always returned: always
''' """
# More will be added as module features are expanded # More will be added as module features are expanded
CATEGORY_COMMANDS_ALL = { CATEGORY_COMMANDS_ALL = {

View File

@ -6,14 +6,12 @@
from __future__ import absolute_import, division, print_function from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = r"""
---
module: ilo_redfish_config module: ilo_redfish_config
short_description: Sets or updates configuration attributes on HPE iLO with Redfish OEM extensions short_description: Sets or updates configuration attributes on HPE iLO with Redfish OEM extensions
version_added: 4.2.0 version_added: 4.2.0
description: description:
- Builds Redfish URIs locally and sends them to iLO to - Builds Redfish URIs locally and sends them to iLO to set or update a configuration attribute.
set or update a configuration attribute.
- For use with HPE iLO operations that require Redfish OEM extensions. - For use with HPE iLO operations that require Redfish OEM extensions.
extends_documentation_fragment: extends_documentation_fragment:
- community.general.attributes - community.general.attributes
@ -69,10 +67,10 @@ options:
type: str type: str
author: author:
- "Bhavya B (@bhavya06)" - "Bhavya B (@bhavya06)"
''' """
EXAMPLES = ''' EXAMPLES = r"""
- name: Disable WINS Registration - name: Disable WINS Registration
community.general.ilo_redfish_config: community.general.ilo_redfish_config:
category: Manager category: Manager
command: SetWINSReg command: SetWINSReg
@ -81,7 +79,7 @@ EXAMPLES = '''
password: Testpass123 password: Testpass123
attribute_name: WINSRegistration attribute_name: WINSRegistration
- name: Set Time Zone - name: Set Time Zone
community.general.ilo_redfish_config: community.general.ilo_redfish_config:
category: Manager category: Manager
command: SetTimeZone command: SetTimeZone
@ -91,7 +89,7 @@ EXAMPLES = '''
attribute_name: TimeZone attribute_name: TimeZone
attribute_value: Chennai attribute_value: Chennai
- name: Set NTP Servers - name: Set NTP Servers
community.general.ilo_redfish_config: community.general.ilo_redfish_config:
category: Manager category: Manager
command: SetNTPServers command: SetNTPServers
@ -100,16 +98,15 @@ EXAMPLES = '''
password: Testpass123 password: Testpass123
attribute_name: StaticNTPServers attribute_name: StaticNTPServers
attribute_value: X.X.X.X attribute_value: X.X.X.X
"""
''' RETURN = r"""
RETURN = '''
msg: msg:
description: Message with action result or error description description: Message with action result or error description.
returned: always returned: always
type: str type: str
sample: "Action was successful" sample: "Action was successful"
''' """
CATEGORY_COMMANDS_ALL = { CATEGORY_COMMANDS_ALL = {
"Manager": ["SetTimeZone", "SetDNSserver", "SetDomainName", "SetNTPServers", "SetWINSReg"] "Manager": ["SetTimeZone", "SetDNSserver", "SetDomainName", "SetNTPServers", "SetWINSReg"]

View File

@ -6,14 +6,12 @@
from __future__ import absolute_import, division, print_function from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = r"""
---
module: ilo_redfish_info module: ilo_redfish_info
short_description: Gathers server information through iLO using Redfish APIs short_description: Gathers server information through iLO using Redfish APIs
version_added: 4.2.0 version_added: 4.2.0
description: description:
- Builds Redfish URIs locally and sends them to iLO to - Builds Redfish URIs locally and sends them to iLO to get information back.
get information back.
- For use with HPE iLO operations that require Redfish OEM extensions. - For use with HPE iLO operations that require Redfish OEM extensions.
extends_documentation_fragment: extends_documentation_fragment:
- community.general.attributes - community.general.attributes
@ -55,10 +53,10 @@ options:
type: int type: int
author: author:
- "Bhavya B (@bhavya06)" - "Bhavya B (@bhavya06)"
''' """
EXAMPLES = ''' EXAMPLES = r"""
- name: Get iLO Sessions - name: Get iLO Sessions
community.general.ilo_redfish_info: community.general.ilo_redfish_info:
category: Sessions category: Sessions
command: GetiLOSessions command: GetiLOSessions
@ -66,9 +64,9 @@ EXAMPLES = '''
username: "{{ username }}" username: "{{ username }}"
password: "{{ password }}" password: "{{ password }}"
register: result_sessions register: result_sessions
''' """
RETURN = ''' RETURN = r"""
ilo_redfish_info: ilo_redfish_info:
description: Returns iLO sessions. description: Returns iLO sessions.
type: dict type: dict
@ -98,7 +96,7 @@ ilo_redfish_info:
description: Name to use to log in to the management processor. description: Name to use to log in to the management processor.
type: str type: str
returned: always returned: always
''' """
CATEGORY_COMMANDS_ALL = { CATEGORY_COMMANDS_ALL = {
"Sessions": ["GetiLOSessions"] "Sessions": ["GetiLOSessions"]

View File

@ -8,8 +8,7 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = r''' DOCUMENTATION = r"""
---
module: imc_rest module: imc_rest
short_description: Manage Cisco IMC hardware through its REST API short_description: Manage Cisco IMC hardware through its REST API
description: description:
@ -34,13 +33,13 @@ options:
description: description:
- IP Address or hostname of Cisco IMC, resolvable by Ansible control host. - IP Address or hostname of Cisco IMC, resolvable by Ansible control host.
required: true required: true
aliases: [ host, ip ] aliases: [host, ip]
type: str type: str
username: username:
description: description:
- Username used to login to the switch. - Username used to login to the switch.
default: admin default: admin
aliases: [ user ] aliases: [user]
type: str type: str
password: password:
description: description:
@ -49,31 +48,30 @@ options:
type: str type: str
path: path:
description: description:
- Name of the absolute path of the filename that includes the body - Name of the absolute path of the filename that includes the body of the http request being sent to the Cisco IMC REST
of the http request being sent to the Cisco IMC REST API. API.
- Parameter O(path) is mutual exclusive with parameter O(content). - Parameter O(path) is mutual exclusive with parameter O(content).
aliases: [ 'src', 'config_file' ] aliases: ['src', 'config_file']
type: path type: path
content: content:
description: description:
- When used instead of O(path), sets the content of the API requests directly. - When used instead of O(path), sets the content of the API requests directly.
- This may be convenient to template simple requests, for anything complex use the M(ansible.builtin.template) module. - This may be convenient to template simple requests, for anything complex use the M(ansible.builtin.template) module.
- You can collate multiple IMC XML fragments and they will be processed sequentially in a single stream, - You can collate multiple IMC XML fragments and they will be processed sequentially in a single stream, the Cisco IMC
the Cisco IMC output is subsequently merged. output is subsequently merged.
- Parameter O(content) is mutual exclusive with parameter O(path). - Parameter O(content) is mutual exclusive with parameter O(path).
type: str type: str
protocol: protocol:
description: description:
- Connection protocol to use. - Connection protocol to use.
default: https default: https
choices: [ http, https ] choices: [http, https]
type: str type: str
timeout: timeout:
description: description:
- The socket level timeout in seconds. - The socket level timeout in seconds.
- This is the time that every single connection (every fragment) can spend. - This is the time that every single connection (every fragment) can spend. If this O(timeout) is reached, the module
If this O(timeout) is reached, the module will fail with a will fail with a C(Connection failure) indicating that C(The read operation timed out).
C(Connection failure) indicating that C(The read operation timed out).
default: 60 default: 60
type: int type: int
validate_certs: validate_certs:
@ -83,18 +81,18 @@ options:
type: bool type: bool
default: true default: true
notes: notes:
- The XML fragments don't need an authentication cookie, this is injected by the module automatically. - The XML fragments do not need an authentication cookie, this is injected by the module automatically.
- The Cisco IMC XML output is being translated to JSON using the Cobra convention. - The Cisco IMC XML output is being translated to JSON using the Cobra convention.
- Any configConfMo change requested has a return status of 'modified', even if there was no actual change - Any configConfMo change requested has a return status of C(modified), even if there was no actual change from the previous
from the previous configuration. As a result, this module will always report a change on subsequent runs. configuration. As a result, this module will always report a change on subsequent runs. In case this behaviour is fixed
In case this behaviour is fixed in a future update to Cisco IMC, this module will automatically adapt. in a future update to Cisco IMC, this module will automatically adapt.
- If you get a C(Connection failure) related to C(The read operation timed out) increase the O(timeout) - If you get a C(Connection failure) related to C(The read operation timed out) increase the O(timeout) parameter. Some
parameter. Some XML fragments can take longer than the default timeout. XML fragments can take longer than the default timeout.
- More information about the IMC REST API is available from - More information about the IMC REST API is available from
U(http://www.cisco.com/c/en/us/td/docs/unified_computing/ucs/c/sw/api/3_0/b_Cisco_IMC_api_301.html) U(http://www.cisco.com/c/en/us/td/docs/unified_computing/ucs/c/sw/api/3_0/b_Cisco_IMC_api_301.html).
''' """
EXAMPLES = r''' EXAMPLES = r"""
- name: Power down server - name: Power down server
community.general.imc_rest: community.general.imc_rest:
hostname: '{{ imc_hostname }}' hostname: '{{ imc_hostname }}'
@ -190,11 +188,11 @@ EXAMPLES = r'''
<commHttps dn="sys/svc-ext/https-svc" adminState="enabled" sessionTimeout="10800"/> <commHttps dn="sys/svc-ext/https-svc" adminState="enabled" sessionTimeout="10800"/>
</inConfig></configConfMo> </inConfig></configConfMo>
delegate_to: localhost delegate_to: localhost
''' """
RETURN = r''' RETURN = r"""
aaLogin: aaLogin:
description: Cisco IMC XML output for the login, translated to JSON using Cobra convention description: Cisco IMC XML output for the login, translated to JSON using Cobra convention.
returned: success returned: success
type: dict type: dict
sample: | sample: |
@ -208,27 +206,27 @@ aaLogin:
"response": "yes" "response": "yes"
} }
configConfMo: configConfMo:
description: Cisco IMC XML output for any configConfMo XML fragments, translated to JSON using Cobra convention description: Cisco IMC XML output for any configConfMo XML fragments, translated to JSON using Cobra convention.
returned: success returned: success
type: dict type: dict
sample: | sample: |
elapsed: elapsed:
description: Elapsed time in seconds description: Elapsed time in seconds.
returned: always returned: always
type: int type: int
sample: 31 sample: 31
response: response:
description: HTTP response message, including content length description: HTTP response message, including content length.
returned: always returned: always
type: str type: str
sample: OK (729 bytes) sample: OK (729 bytes)
status: status:
description: The HTTP response status code description: The HTTP response status code.
returned: always returned: always
type: dict type: dict
sample: 200 sample: 200
error: error:
description: Cisco IMC XML error output for last request, translated to JSON using Cobra convention description: Cisco IMC XML error output for last request, translated to JSON using Cobra convention.
returned: failed returned: failed
type: dict type: dict
sample: | sample: |
@ -240,24 +238,24 @@ error:
"response": "yes" "response": "yes"
} }
error_code: error_code:
description: Cisco IMC error code description: Cisco IMC error code.
returned: failed returned: failed
type: str type: str
sample: ERR-xml-parse-error sample: ERR-xml-parse-error
error_text: error_text:
description: Cisco IMC error message description: Cisco IMC error message.
returned: failed returned: failed
type: str type: str
sample: | sample: |
XML PARSING ERROR: Element 'computeRackUnit', attribute 'admin_Power': The attribute 'admin_Power' is not allowed. XML PARSING ERROR: Element 'computeRackUnit', attribute 'admin_Power': The attribute 'admin_Power' is not allowed.
input: input:
description: RAW XML input sent to the Cisco IMC, causing the error description: RAW XML input sent to the Cisco IMC, causing the error.
returned: failed returned: failed
type: str type: str
sample: | sample: |
<configConfMo><inConfig><computeRackUnit dn="sys/rack-unit-1" admin_Power="down"/></inConfig></configConfMo> <configConfMo><inConfig><computeRackUnit dn="sys/rack-unit-1" admin_Power="down"/></inConfig></configConfMo>
output: output:
description: RAW XML output received from the Cisco IMC, with error details description: RAW XML output received from the Cisco IMC, with error details.
returned: failed returned: failed
type: str type: str
sample: > sample: >
@ -266,7 +264,7 @@ output:
errorCode="ERR-xml-parse-error" errorCode="ERR-xml-parse-error"
invocationResult="594" invocationResult="594"
errorDescr="XML PARSING ERROR: Element 'computeRackUnit', attribute 'admin_Power': The attribute 'admin_Power' is not allowed.\n"/> errorDescr="XML PARSING ERROR: Element 'computeRackUnit', attribute 'admin_Power': The attribute 'admin_Power' is not allowed.\n"/>
''' """
import os import os
import traceback import traceback

View File

@ -9,12 +9,11 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = r"""
---
module: imgadm module: imgadm
short_description: Manage SmartOS images short_description: Manage SmartOS images
description: description:
- Manage SmartOS virtual machine images through imgadm(1M) - Manage SmartOS virtual machine images through imgadm(1M).
author: Jasper Lievisse Adriaanse (@jasperla) author: Jasper Lievisse Adriaanse (@jasperla)
extends_documentation_fragment: extends_documentation_fragment:
- community.general.attributes - community.general.attributes
@ -33,7 +32,7 @@ options:
required: false required: false
default: zones default: zones
description: description:
- zpool to import to or delete images from. - The zpool to import to or delete images from.
type: str type: str
source: source:
required: false required: false
@ -42,16 +41,15 @@ options:
type: str type: str
state: state:
required: true required: true
choices: [ present, absent, deleted, imported, updated, vacuumed ] choices: [present, absent, deleted, imported, updated, vacuumed]
description: description:
- State the object operated on should be in. V(imported) is an alias for - State the object operated on should be in. V(imported) is an alias for for V(present) and V(deleted) for V(absent).
for V(present) and V(deleted) for V(absent). When set to V(vacuumed) When set to V(vacuumed) and O(uuid=*), it will remove all unused images.
and O(uuid=*), it will remove all unused images.
type: str type: str
type: type:
required: false required: false
choices: [ imgapi, docker, dsapi ] choices: [imgapi, docker, dsapi]
default: imgapi default: imgapi
description: description:
- Type for image sources. - Type for image sources.
@ -62,9 +60,9 @@ options:
description: description:
- Image UUID. Can either be a full UUID or V(*) for all images. - Image UUID. Can either be a full UUID or V(*) for all images.
type: str type: str
''' """
EXAMPLES = ''' EXAMPLES = r"""
- name: Import an image - name: Import an image
community.general.imgadm: community.general.imgadm:
uuid: '70e3ae72-96b6-11e6-9056-9737fd4d0764' uuid: '70e3ae72-96b6-11e6-9056-9737fd4d0764'
@ -100,9 +98,9 @@ EXAMPLES = '''
community.general.imgadm: community.general.imgadm:
source: 'https://docker.io' source: 'https://docker.io'
state: absent state: absent
''' """
RETURN = ''' RETURN = r"""
source: source:
description: Source that is managed. description: Source that is managed.
returned: When not managing an image. returned: When not managing an image.
@ -118,7 +116,7 @@ state:
returned: success returned: success
type: str type: str
sample: 'present' sample: 'present'
''' """
import re import re

View File

@ -8,7 +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: infinity module: infinity
short_description: Manage Infinity IPAM using Rest API short_description: Manage Infinity IPAM using Rest API
description: description:
@ -41,10 +41,10 @@ options:
required: true required: true
action: action:
description: description:
- Action to perform - Action to perform.
type: str type: str
required: true required: true
choices: [add_network, delete_network, get_network, get_network_id, release_ip, release_network, reserve_network, reserve_next_available_ip ] choices: [add_network, delete_network, get_network, get_network_id, release_ip, release_network, reserve_network, reserve_next_available_ip]
network_id: network_id:
description: description:
- Network ID. - Network ID.
@ -55,11 +55,11 @@ options:
type: str type: str
network_address: network_address:
description: description:
- Network address with CIDR format (e.g., 192.168.310.0). - Network address with CIDR format (for example V(192.168.310.0)).
type: str type: str
network_size: network_size:
description: description:
- Network bitmask (e.g. 255.255.255.220) or CIDR format (e.g., /26). - Network bitmask (for example V(255.255.255.220) or CIDR format V(/26)).
type: str type: str
network_name: network_name:
description: description:
@ -72,20 +72,19 @@ options:
default: -1 default: -1
network_type: network_type:
description: description:
- Network type defined by Infinity - Network type defined by Infinity.
type: str type: str
choices: [ lan, shared_lan, supernet ] choices: [lan, shared_lan, supernet]
default: lan default: lan
network_family: network_family:
description: description:
- Network family defined by Infinity, e.g. IPv4, IPv6 and Dual stack - Network family defined by Infinity, for example V(IPv4), V(IPv6) and V(Dual stack).
type: str type: str
choices: [ '4', '6', dual ] choices: ['4', '6', dual]
default: '4' default: '4'
''' """
EXAMPLES = r''' EXAMPLES = r"""
---
- hosts: localhost - hosts: localhost
connection: local connection: local
strategy: debug strategy: debug
@ -102,16 +101,16 @@ EXAMPLES = r'''
network_id: 1201 network_id: 1201
network_size: /28 network_size: /28
register: infinity register: infinity
''' """
RETURN = r''' RETURN = r"""
network_id: network_id:
description: id for a given network description: Id for a given network.
returned: success returned: success
type: str type: str
sample: '1501' sample: '1501'
ip_info: ip_info:
description: when reserve next available ip address from a network, the ip address info ) is returned. description: When reserve next available ip address from a network, the ip address info ) is returned.
returned: success returned: success
type: str type: str
sample: '{"address": "192.168.10.3", "hostname": "", "FQDN": "", "domainname": "", "id": 3229}' sample: '{"address": "192.168.10.3", "hostname": "", "FQDN": "", "domainname": "", "id": 3229}'
@ -130,7 +129,7 @@ network_info:
"network_type": "lan", "network_type": "lan",
"network_name": "'reserve_new_ansible_network'" "network_name": "'reserve_new_ansible_network'"
} }
''' """
from ansible.module_utils.basic import AnsibleModule, json from ansible.module_utils.basic import AnsibleModule, json

View File

@ -9,8 +9,7 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = r''' DOCUMENTATION = r"""
---
module: influxdb_database module: influxdb_database
short_description: Manage InfluxDB databases short_description: Manage InfluxDB databases
description: description:
@ -33,16 +32,15 @@ options:
state: state:
description: description:
- Determines if the database should be created or destroyed. - Determines if the database should be created or destroyed.
choices: [ absent, present ] choices: [absent, present]
default: present default: present
type: str type: str
extends_documentation_fragment: extends_documentation_fragment:
- community.general.influxdb - community.general.influxdb
- community.general.attributes - community.general.attributes
"""
''' EXAMPLES = r"""
EXAMPLES = r'''
# Example influxdb_database command from Ansible Playbooks # Example influxdb_database command from Ansible Playbooks
- name: Create database - name: Create database
community.general.influxdb_database: community.general.influxdb_database:
@ -63,11 +61,11 @@ EXAMPLES = r'''
database_name: "{{influxdb_database_name}}" database_name: "{{influxdb_database_name}}"
ssl: true ssl: true
validate_certs: true validate_certs: true
''' """
RETURN = r''' RETURN = r"""
# only defaults # only defaults
''' """
try: try:
import requests.exceptions import requests.exceptions

View File

@ -8,8 +8,7 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = r''' DOCUMENTATION = r"""
---
module: influxdb_query module: influxdb_query
short_description: Query data points from InfluxDB short_description: Query data points from InfluxDB
description: description:
@ -36,10 +35,9 @@ options:
extends_documentation_fragment: extends_documentation_fragment:
- community.general.influxdb - community.general.influxdb
- community.general.attributes - community.general.attributes
"""
''' EXAMPLES = r"""
EXAMPLES = r'''
- name: Query connections - name: Query connections
community.general.influxdb_query: community.general.influxdb_query:
hostname: "{{ influxdb_ip_address }}" hostname: "{{ influxdb_ip_address }}"
@ -57,17 +55,17 @@ EXAMPLES = r'''
- name: Print results from the query - name: Print results from the query
ansible.builtin.debug: ansible.builtin.debug:
var: connection.query_results var: connection.query_results
''' """
RETURN = r''' RETURN = r"""
query_results: query_results:
description: Result from the query description: Result from the query.
returned: success returned: success
type: list type: list
sample: sample:
- mean: 1245.5333333333333 - mean: 1245.5333333333333
time: "1970-01-01T00:00:00Z" time: "1970-01-01T00:00:00Z"
''' """
from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.common.text.converters import to_native from ansible.module_utils.common.text.converters import to_native

View File

@ -9,8 +9,7 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = r''' DOCUMENTATION = r"""
---
module: influxdb_retention_policy module: influxdb_retention_policy
short_description: Manage InfluxDB retention policies short_description: Manage InfluxDB retention policies
description: description:
@ -38,15 +37,14 @@ options:
state: state:
description: description:
- State of the retention policy. - State of the retention policy.
choices: [ absent, present ] choices: [absent, present]
default: present default: present
type: str type: str
version_added: 3.1.0 version_added: 3.1.0
duration: duration:
description: description:
- Determines how long InfluxDB should keep the data. If specified, it - Determines how long InfluxDB should keep the data. If specified, it should be V(INF) or at least one hour. If not
should be V(INF) or at least one hour. If not specified, V(INF) is specified, V(INF) is assumed. Supports complex duration expressions with multiple units.
assumed. Supports complex duration expressions with multiple units.
- Required only if O(state) is set to V(present). - Required only if O(state) is set to V(present).
type: str type: str
replication: replication:
@ -61,19 +59,16 @@ options:
default: false default: false
shard_group_duration: shard_group_duration:
description: description:
- Determines the time range covered by a shard group. If specified it - Determines the time range covered by a shard group. If specified it must be at least one hour. If none, it's determined
must be at least one hour. If none, it's determined by InfluxDB by by InfluxDB by the rentention policy's duration. Supports complex duration expressions with multiple units.
the rentention policy's duration. Supports complex duration expressions
with multiple units.
type: str type: str
version_added: '2.0.0' version_added: '2.0.0'
extends_documentation_fragment: extends_documentation_fragment:
- community.general.influxdb - community.general.influxdb
- community.general.attributes - community.general.attributes
"""
''' EXAMPLES = r"""
EXAMPLES = r'''
# Example influxdb_retention_policy command from Ansible Playbooks # Example influxdb_retention_policy command from Ansible Playbooks
- name: Create 1 hour retention policy - name: Create 1 hour retention policy
community.general.influxdb_retention_policy: community.general.influxdb_retention_policy:
@ -134,11 +129,11 @@ EXAMPLES = r'''
database_name: "{{ influxdb_database_name }}" database_name: "{{ influxdb_database_name }}"
policy_name: test policy_name: test
state: absent state: absent
''' """
RETURN = r''' RETURN = r"""
# only defaults # only defaults
''' """
import re import re

View File

@ -10,8 +10,7 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = r''' DOCUMENTATION = r"""
---
module: influxdb_user module: influxdb_user
short_description: Manage InfluxDB users short_description: Manage InfluxDB users
description: description:
@ -44,7 +43,7 @@ options:
state: state:
description: description:
- State of the user. - State of the user.
choices: [ absent, present ] choices: [absent, present]
default: present default: present
type: str type: str
grants: grants:
@ -58,10 +57,9 @@ options:
extends_documentation_fragment: extends_documentation_fragment:
- community.general.influxdb - community.general.influxdb
- community.general.attributes - community.general.attributes
"""
''' EXAMPLES = r"""
EXAMPLES = r'''
- name: Create a user on localhost using default login credentials - name: Create a user on localhost using default login credentials
community.general.influxdb_user: community.general.influxdb_user:
user_name: john user_name: john
@ -101,11 +99,11 @@ EXAMPLES = r'''
login_username: "{{ influxdb_username }}" login_username: "{{ influxdb_username }}"
login_password: "{{ influxdb_password }}" login_password: "{{ influxdb_password }}"
state: absent state: absent
''' """
RETURN = r''' RETURN = r"""
#only defaults #only defaults
''' """
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: influxdb_write module: influxdb_write
short_description: Write data points into InfluxDB short_description: Write data points into InfluxDB
description: description:
@ -37,10 +36,9 @@ options:
extends_documentation_fragment: extends_documentation_fragment:
- community.general.influxdb - community.general.influxdb
- community.general.attributes - community.general.attributes
"""
''' EXAMPLES = r"""
EXAMPLES = r'''
- name: Write points into database - name: Write points into database
community.general.influxdb_write: community.general.influxdb_write:
hostname: "{{influxdb_ip_address}}" hostname: "{{influxdb_ip_address}}"
@ -60,11 +58,11 @@ EXAMPLES = r'''
time: "{{ ansible_date_time.iso8601 }}" time: "{{ ansible_date_time.iso8601 }}"
fields: fields:
value: 3000 value: 3000
''' """
RETURN = r''' RETURN = r"""
# only defaults # only defaults
''' """
from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.common.text.converters import to_native from ansible.module_utils.common.text.converters import to_native

View File

@ -12,19 +12,18 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = r''' DOCUMENTATION = r"""
---
module: ini_file module: ini_file
short_description: Tweak settings in INI files short_description: Tweak settings in INI files
extends_documentation_fragment: extends_documentation_fragment:
- files - files
- community.general.attributes - community.general.attributes
description: description:
- Manage (add, remove, change) individual settings in an INI-style file without having - Manage (add, remove, change) individual settings in an INI-style file without having to manage the file as a whole with,
to manage the file as a whole with, say, M(ansible.builtin.template) or M(ansible.builtin.assemble). say, M(ansible.builtin.template) or M(ansible.builtin.assemble).
- Adds missing sections if they don't exist. - Adds missing sections if they do not exist.
- This module adds missing ending newlines to files to keep in line with the POSIX standard, even when - This module adds missing ending newlines to files to keep in line with the POSIX standard, even when no other modifications
no other modifications need to be applied. need to be applied.
attributes: attributes:
check_mode: check_mode:
support: full support: full
@ -36,11 +35,10 @@ options:
- Path to the INI-style file; this file is created if required. - Path to the INI-style file; this file is created if required.
type: path type: path
required: true required: true
aliases: [ dest ] aliases: [dest]
section: section:
description: description:
- Section name in INI file. This is added if O(state=present) automatically when - Section name in INI file. This is added if O(state=present) automatically when a single value is being set.
a single value is being set.
- If being omitted, the O(option) will be placed before the first O(section). - If being omitted, the O(option) will be placed before the first O(section).
- Omitting O(section) is also required if the config format does not support sections. - Omitting O(section) is also required if the config format does not support sections.
type: str type: str
@ -91,28 +89,27 @@ options:
version_added: 3.6.0 version_added: 3.6.0
backup: backup:
description: description:
- Create a backup file including the timestamp information so you can get - Create a backup file including the timestamp information so you can get the original file back if you somehow clobbered
the original file back if you somehow clobbered it incorrectly. it incorrectly.
type: bool type: bool
default: false default: false
state: state:
description: description:
- If set to V(absent) and O(exclusive) set to V(true) all matching O(option) lines are removed. - If set to V(absent) and O(exclusive) set to V(true) all matching O(option) lines are removed.
- If set to V(absent) and O(exclusive) set to V(false) the specified O(option=value) lines are removed, - If set to V(absent) and O(exclusive) set to V(false) the specified O(option=value) lines are removed, but the other
but the other O(option)s with the same name are not touched. O(option)s with the same name are not touched.
- If set to V(present) and O(exclusive) set to V(false) the specified O(option=values) lines are added, - If set to V(present) and O(exclusive) set to V(false) the specified O(option=values) lines are added, but the other
but the other O(option)s with the same name are not touched. O(option)s with the same name are not touched.
- If set to V(present) and O(exclusive) set to V(true) all given O(option=values) lines will be - If set to V(present) and O(exclusive) set to V(true) all given O(option=values) lines will be added and the other
added and the other O(option)s with the same name are removed. O(option)s with the same name are removed.
type: str type: str
choices: [ absent, present ] choices: [absent, present]
default: present default: present
exclusive: exclusive:
description: description:
- If set to V(true) (default), all matching O(option) lines are removed when O(state=absent), - If set to V(true) (default), all matching O(option) lines are removed when O(state=absent), or replaced when O(state=present).
or replaced when O(state=present). - If set to V(false), only the specified O(value)/O(values) are added when O(state=present), or removed when O(state=absent),
- If set to V(false), only the specified O(value)/O(values) are added when O(state=present), and existing ones are not modified.
or removed when O(state=absent), and existing ones are not modified.
type: bool type: bool
default: true default: true
version_added: 3.6.0 version_added: 3.6.0
@ -141,8 +138,8 @@ options:
modify_inactive_option: modify_inactive_option:
description: description:
- By default the module replaces a commented line that matches the given option. - By default the module replaces a commented line that matches the given option.
- Set this option to V(false) to avoid this. This is useful when you want to keep commented example - Set this option to V(false) to avoid this. This is useful when you want to keep commented example C(key=value) pairs
C(key=value) pairs for documentation purposes. for documentation purposes.
type: bool type: bool
default: true default: true
version_added: 8.0.0 version_added: 8.0.0
@ -159,9 +156,9 @@ notes:
author: author:
- Jan-Piet Mens (@jpmens) - Jan-Piet Mens (@jpmens)
- Ales Nosek (@noseka1) - Ales Nosek (@noseka1)
''' """
EXAMPLES = r''' EXAMPLES = r"""
- name: Ensure "fav=lemonade is in section "[drinks]" in specified file - name: Ensure "fav=lemonade is in section "[drinks]" in specified file
community.general.ini_file: community.general.ini_file:
path: /etc/conf path: /etc/conf
@ -257,7 +254,7 @@ EXAMPLES = r'''
value: xxxxxxxxxxxxxxxxxxxx value: xxxxxxxxxxxxxxxxxxxx
mode: '0600' mode: '0600'
state: present state: present
''' """
import io import io
import os import os

View File

@ -8,14 +8,13 @@
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: installp module: installp
author: author:
- Kairo Araujo (@kairoaraujo) - Kairo Araujo (@kairoaraujo)
short_description: Manage packages on AIX short_description: Manage packages on AIX
description: description:
- Manage packages using 'installp' on AIX - Manage packages using 'installp' on AIX.
extends_documentation_fragment: extends_documentation_fragment:
- community.general.attributes - community.general.attributes
attributes: attributes:
@ -36,7 +35,7 @@ options:
type: list type: list
elements: str elements: str
required: true required: true
aliases: [ pkg ] aliases: [pkg]
repository_path: repository_path:
description: description:
- Path with AIX packages (required to install). - Path with AIX packages (required to install).
@ -45,13 +44,13 @@ options:
description: description:
- Whether the package needs to be present on or absent from the system. - Whether the package needs to be present on or absent from the system.
type: str type: str
choices: [ absent, present ] choices: [absent, present]
default: present default: present
notes: notes:
- If the package is already installed, even the package/fileset is new, the module will not install it. - If the package is already installed, even the package/fileset is new, the module will not install it.
''' """
EXAMPLES = r''' EXAMPLES = r"""
- name: Install package foo - name: Install package foo
community.general.installp: community.general.installp:
name: foo name: foo
@ -84,9 +83,9 @@ EXAMPLES = r'''
community.general.installp: community.general.installp:
name: bos.sysmgt.nim.master name: bos.sysmgt.nim.master
state: absent state: absent
''' """
RETURN = r''' # ''' RETURN = r""" # """
import os import os
import re import re

View File

@ -9,16 +9,15 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = r"""
---
module: interfaces_file module: interfaces_file
short_description: Tweak settings in C(/etc/network/interfaces) files short_description: Tweak settings in C(/etc/network/interfaces) files
extends_documentation_fragment: extends_documentation_fragment:
- ansible.builtin.files - ansible.builtin.files
- community.general.attributes - community.general.attributes
description: description:
- Manage (add, remove, change) individual interface options in an interfaces-style file without having - Manage (add, remove, change) individual interface options in an interfaces-style file without having to manage the file
to manage the file as a whole with, say, M(ansible.builtin.template) or M(ansible.builtin.assemble). Interface has to be presented in a file. as a whole with, say, M(ansible.builtin.template) or M(ansible.builtin.assemble). Interface has to be presented in a file.
- Read information about interfaces from interfaces-styled files. - Read information about interfaces from interfaces-styled files.
attributes: attributes:
check_mode: check_mode:
@ -46,14 +45,14 @@ options:
value: value:
type: str type: str
description: description:
- If O(option) is not presented for the O(iface) and O(state) is V(present) option will be added. - If O(option) is not presented for the O(iface) and O(state) is V(present) option will be added. If O(option) already
If O(option) already exists and is not V(pre-up), V(up), V(post-up) or V(down), it's value will be updated. exists and is not V(pre-up), V(up), V(post-up) or V(down), it's value will be updated. V(pre-up), V(up), V(post-up)
V(pre-up), V(up), V(post-up) and V(down) options cannot be updated, only adding new options, removing existing and V(down) options cannot be updated, only adding new options, removing existing ones or cleaning the whole option
ones or cleaning the whole option set are supported. set are supported.
backup: backup:
description: description:
- Create a backup file including the timestamp information so you can get - Create a backup file including the timestamp information so you can get the original file back if you somehow clobbered
the original file back if you somehow clobbered it incorrectly. it incorrectly.
type: bool type: bool
default: false default: false
state: state:
@ -61,15 +60,15 @@ options:
description: description:
- If set to V(absent) the option or section will be removed if present instead of created. - If set to V(absent) the option or section will be removed if present instead of created.
default: "present" default: "present"
choices: [ "present", "absent" ] choices: ["present", "absent"]
notes: notes:
- If option is defined multiple times last one will be updated but all will be deleted in case of an absent state. - If option is defined multiple times last one will be updated but all will be deleted in case of an absent state.
requirements: [] requirements: []
author: "Roman Belyakovsky (@hryamzik)" author: "Roman Belyakovsky (@hryamzik)"
''' """
RETURN = ''' RETURN = r"""
dest: dest:
description: Destination file/path. description: Destination file/path.
returned: success returned: success
@ -137,10 +136,9 @@ ifaces:
sample: sample:
- "route del -net 10.10.10.0/24 gw 10.10.10.1 dev eth1" - "route del -net 10.10.10.0/24 gw 10.10.10.1 dev eth1"
- "route del -net 10.10.11.0/24 gw 10.10.11.1 dev eth2" - "route del -net 10.10.11.0/24 gw 10.10.11.1 dev eth2"
... """
'''
EXAMPLES = ''' EXAMPLES = r"""
- name: Set eth1 mtu configuration value to 8000 - name: Set eth1 mtu configuration value to 8000
community.general.interfaces_file: community.general.interfaces_file:
dest: /etc/network/interfaces.d/eth1.cfg dest: /etc/network/interfaces.d/eth1.cfg
@ -150,7 +148,7 @@ EXAMPLES = '''
backup: true backup: true
state: present state: present
register: eth1_cfg register: eth1_cfg
''' """
import os import os
import re import re