r*: normalize docs (#9354)

* r*: normalize docs

* Apply suggestions from code review

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

* Apply suggestions from code review

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
pull/9101/merge
Alexei Znamensky 2024-12-26 09:19:49 +13:00 committed by GitHub
parent 70b62ed745
commit 9751461295
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
22 changed files with 1858 additions and 1947 deletions

View File

@ -8,16 +8,15 @@
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: read_csv module: read_csv
short_description: Read a CSV file short_description: Read a CSV file
description: description:
- Read a CSV file and return a list or a dictionary, containing one dictionary per row. - Read a CSV file and return a list or a dictionary, containing one dictionary per row.
author: author:
- Dag Wieers (@dagwieers) - Dag Wieers (@dagwieers)
extends_documentation_fragment: extends_documentation_fragment:
- community.general.attributes - community.general.attributes
attributes: attributes:
check_mode: check_mode:
support: full support: full
@ -26,58 +25,57 @@ attributes:
options: options:
path: path:
description: description:
- The CSV filename to read data from. - The CSV filename to read data from.
type: path type: path
required: true required: true
aliases: [ filename ] aliases: [filename]
key: key:
description: description:
- The column name used as a key for the resulting dictionary. - The column name used as a key for the resulting dictionary.
- If O(key) is unset, the module returns a list of dictionaries, - If O(key) is unset, the module returns a list of dictionaries, where each dictionary is a row in the CSV file.
where each dictionary is a row in the CSV file.
type: str type: str
dialect: dialect:
description: description:
- The CSV dialect to use when parsing the CSV file. - The CSV dialect to use when parsing the CSV file.
- Possible values include V(excel), V(excel-tab) or V(unix). - Possible values include V(excel), V(excel-tab) or V(unix).
type: str type: str
default: excel default: excel
fieldnames: fieldnames:
description: description:
- A list of field names for every column. - A list of field names for every column.
- This is needed if the CSV does not have a header. - This is needed if the CSV does not have a header.
type: list type: list
elements: str elements: str
unique: unique:
description: description:
- Whether the O(key) used is expected to be unique. - Whether the O(key) used is expected to be unique.
type: bool type: bool
default: true default: true
delimiter: delimiter:
description: description:
- A one-character string used to separate fields. - A one-character string used to separate fields.
- When using this parameter, you change the default value used by O(dialect). - When using this parameter, you change the default value used by O(dialect).
- The default value depends on the dialect used. - The default value depends on the dialect used.
type: str type: str
skipinitialspace: skipinitialspace:
description: description:
- Whether to ignore any whitespaces immediately following the delimiter. - Whether to ignore any whitespaces immediately following the delimiter.
- When using this parameter, you change the default value used by O(dialect). - When using this parameter, you change the default value used by O(dialect).
- The default value depends on the dialect used. - The default value depends on the dialect used.
type: bool type: bool
strict: strict:
description: description:
- Whether to raise an exception on bad CSV input. - Whether to raise an exception on bad CSV input.
- When using this parameter, you change the default value used by O(dialect). - When using this parameter, you change the default value used by O(dialect).
- The default value depends on the dialect used. - The default value depends on the dialect used.
type: bool type: bool
seealso: seealso:
- plugin: ansible.builtin.csvfile - plugin: ansible.builtin.csvfile
plugin_type: lookup plugin_type: lookup
description: Can be used to do selective lookups in CSV files from Jinja. description: Can be used to do selective lookups in CSV files from Jinja.
''' """
EXAMPLES = r''' EXAMPLES = r"""
# Example CSV file with header # Example CSV file with header
# #
# name,uid,gid # name,uid,gid
@ -118,9 +116,9 @@ EXAMPLES = r'''
delimiter: ';' delimiter: ';'
register: users register: users
delegate_to: localhost delegate_to: localhost
''' """
RETURN = r''' RETURN = r"""
dict: dict:
description: The CSV content as a dictionary. description: The CSV content as a dictionary.
returned: success returned: success
@ -139,13 +137,13 @@ list:
returned: success returned: success
type: list type: list
sample: sample:
- name: dag - name: dag
uid: 500 uid: 500
gid: 500 gid: 500
- name: jeroen - name: jeroen
uid: 501 uid: 501
gid: 500 gid: 500
''' """
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

File diff suppressed because it is too large Load Diff

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: redfish_config module: redfish_config
short_description: Manages Out-Of-Band controllers using Redfish APIs short_description: Manages Out-Of-Band controllers using 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 set or update a configuration attribute.
set or update a configuration attribute.
- Manages BIOS configuration settings. - Manages BIOS configuration settings.
- Manages OOB controller configuration settings. - Manages OOB controller configuration settings.
extends_documentation_fragment: extends_documentation_fragment:
@ -64,8 +62,7 @@ options:
timeout: timeout:
description: description:
- Timeout in seconds for HTTP requests to OOB controller. - Timeout in seconds for HTTP requests to OOB controller.
- The default value for this parameter changed from V(10) to V(60) - The default value for this parameter changed from V(10) to V(60) in community.general 9.0.0.
in community.general 9.0.0.
type: int type: int
default: 60 default: 60
boot_order: boot_order:
@ -111,10 +108,8 @@ options:
version_added: '0.2.0' version_added: '0.2.0'
strip_etag_quotes: strip_etag_quotes:
description: description:
- Removes surrounding quotes of etag used in C(If-Match) header - Removes surrounding quotes of etag used in C(If-Match) header of C(PATCH) requests.
of C(PATCH) requests. - Only use this option to resolve bad vendor implementation where C(If-Match) only matches the unquoted etag string.
- Only use this option to resolve bad vendor implementation where
C(If-Match) only matches the unquoted etag string.
type: bool type: bool
default: false default: false
version_added: 3.7.0 version_added: 3.7.0
@ -165,15 +160,14 @@ options:
description: description:
- Setting parameter to enable or disable SecureBoot. - Setting parameter to enable or disable SecureBoot.
type: bool type: bool
default: True default: true
version_added: '7.5.0' version_added: '7.5.0'
volume_details: volume_details:
required: false required: false
description: description:
- Setting dict of volume to be created. - Setting dict of volume to be created.
- If C(CapacityBytes) key is not specified in this dictionary, the size of - If C(CapacityBytes) key is not specified in this dictionary, the size of the volume will be determined by the Redfish service. It is possible
the volume will be determined by the Redfish service. It is possible the the size will not be the maximum available size.
size will not be the maximum available size.
type: dict type: dict
default: {} default: {}
version_added: '7.5.0' version_added: '7.5.0'
@ -181,9 +175,8 @@ options:
required: false required: false
description: description:
- SSL/TLS Ciphers to use for the request. - SSL/TLS Ciphers to use for the request.
- 'When a list is provided, all ciphers are joined in order with V(:).' - When a list is provided, all ciphers are joined in order with V(:).
- See the L(OpenSSL Cipher List Format,https://www.openssl.org/docs/manmaster/man1/openssl-ciphers.html#CIPHER-LIST-FORMAT) - See the L(OpenSSL Cipher List Format,https://www.openssl.org/docs/manmaster/man1/openssl-ciphers.html#CIPHER-LIST-FORMAT) for more details.
for more details.
- The available ciphers is dependent on the Python and OpenSSL/LibreSSL versions. - The available ciphers is dependent on the Python and OpenSSL/LibreSSL versions.
type: list type: list
elements: str elements: str
@ -192,195 +185,195 @@ options:
author: author:
- "Jose Delarosa (@jose-delarosa)" - "Jose Delarosa (@jose-delarosa)"
- "T S Kushal (@TSKushal)" - "T S Kushal (@TSKushal)"
''' """
EXAMPLES = ''' EXAMPLES = r"""
- name: Set BootMode to UEFI - name: Set BootMode to UEFI
community.general.redfish_config: community.general.redfish_config:
category: Systems category: Systems
command: SetBiosAttributes command: SetBiosAttributes
resource_id: 437XR1138R2 resource_id: 437XR1138R2
bios_attributes: bios_attributes:
BootMode: "Uefi" BootMode: "Uefi"
baseuri: "{{ baseuri }}" baseuri: "{{ baseuri }}"
username: "{{ username }}" username: "{{ username }}"
password: "{{ password }}" password: "{{ password }}"
- name: Set multiple BootMode attributes - name: Set multiple BootMode attributes
community.general.redfish_config: community.general.redfish_config:
category: Systems category: Systems
command: SetBiosAttributes command: SetBiosAttributes
resource_id: 437XR1138R2 resource_id: 437XR1138R2
bios_attributes: bios_attributes:
BootMode: "Bios" BootMode: "Bios"
OneTimeBootMode: "Enabled" OneTimeBootMode: "Enabled"
BootSeqRetry: "Enabled" BootSeqRetry: "Enabled"
baseuri: "{{ baseuri }}" baseuri: "{{ baseuri }}"
username: "{{ username }}" username: "{{ username }}"
password: "{{ password }}" password: "{{ password }}"
- name: Enable PXE Boot for NIC1 - name: Enable PXE Boot for NIC1
community.general.redfish_config: community.general.redfish_config:
category: Systems category: Systems
command: SetBiosAttributes command: SetBiosAttributes
resource_id: 437XR1138R2 resource_id: 437XR1138R2
bios_attributes: bios_attributes:
PxeDev1EnDis: Enabled PxeDev1EnDis: Enabled
baseuri: "{{ baseuri }}" baseuri: "{{ baseuri }}"
username: "{{ username }}" username: "{{ username }}"
password: "{{ password }}" password: "{{ password }}"
- name: Set BIOS default settings with a timeout of 20 seconds - name: Set BIOS default settings with a timeout of 20 seconds
community.general.redfish_config: community.general.redfish_config:
category: Systems category: Systems
command: SetBiosDefaultSettings command: SetBiosDefaultSettings
resource_id: 437XR1138R2 resource_id: 437XR1138R2
baseuri: "{{ baseuri }}" baseuri: "{{ baseuri }}"
username: "{{ username }}" username: "{{ username }}"
password: "{{ password }}" password: "{{ password }}"
timeout: 20 timeout: 20
- name: Set boot order - name: Set boot order
community.general.redfish_config: community.general.redfish_config:
category: Systems category: Systems
command: SetBootOrder command: SetBootOrder
boot_order: boot_order:
- Boot0002 - Boot0002
- Boot0001 - Boot0001
- Boot0000 - Boot0000
- Boot0003 - Boot0003
- Boot0004 - Boot0004
baseuri: "{{ baseuri }}" baseuri: "{{ baseuri }}"
username: "{{ username }}" username: "{{ username }}"
password: "{{ password }}" password: "{{ password }}"
- name: Set boot order to the default - name: Set boot order to the default
community.general.redfish_config: community.general.redfish_config:
category: Systems category: Systems
command: SetDefaultBootOrder command: SetDefaultBootOrder
baseuri: "{{ baseuri }}" baseuri: "{{ baseuri }}"
username: "{{ username }}" username: "{{ username }}"
password: "{{ password }}" password: "{{ password }}"
- name: Set Manager Network Protocols - name: Set Manager Network Protocols
community.general.redfish_config: community.general.redfish_config:
category: Manager category: Manager
command: SetNetworkProtocols command: SetNetworkProtocols
network_protocols: network_protocols:
SNMP: SNMP:
ProtocolEnabled: true ProtocolEnabled: true
Port: 161 Port: 161
HTTP: HTTP:
ProtocolEnabled: false ProtocolEnabled: false
Port: 8080 Port: 8080
baseuri: "{{ baseuri }}" baseuri: "{{ baseuri }}"
username: "{{ username }}" username: "{{ username }}"
password: "{{ password }}" password: "{{ password }}"
- name: Set Manager NIC - name: Set Manager NIC
community.general.redfish_config: community.general.redfish_config:
category: Manager category: Manager
command: SetManagerNic command: SetManagerNic
nic_config: nic_config:
DHCPv4: DHCPv4:
DHCPEnabled: false DHCPEnabled: false
IPv4StaticAddresses: IPv4StaticAddresses:
Address: 192.168.1.3 Address: 192.168.1.3
Gateway: 192.168.1.1 Gateway: 192.168.1.1
SubnetMask: 255.255.255.0 SubnetMask: 255.255.255.0
baseuri: "{{ baseuri }}" baseuri: "{{ baseuri }}"
username: "{{ username }}" username: "{{ username }}"
password: "{{ password }}" password: "{{ password }}"
- name: Disable Host Interface - name: Disable Host Interface
community.general.redfish_config: community.general.redfish_config:
category: Manager category: Manager
command: SetHostInterface command: SetHostInterface
hostinterface_config: hostinterface_config:
InterfaceEnabled: false InterfaceEnabled: false
baseuri: "{{ baseuri }}" baseuri: "{{ baseuri }}"
username: "{{ username }}" username: "{{ username }}"
password: "{{ password }}" password: "{{ password }}"
- name: Enable Host Interface for HostInterface resource ID '2' - name: Enable Host Interface for HostInterface resource ID '2'
community.general.redfish_config: community.general.redfish_config:
category: Manager category: Manager
command: SetHostInterface command: SetHostInterface
hostinterface_config: hostinterface_config:
InterfaceEnabled: true InterfaceEnabled: true
hostinterface_id: "2" hostinterface_id: "2"
baseuri: "{{ baseuri }}" baseuri: "{{ baseuri }}"
username: "{{ username }}" username: "{{ username }}"
password: "{{ password }}" password: "{{ password }}"
- name: Set SessionService Session Timeout to 30 minutes - name: Set SessionService Session Timeout to 30 minutes
community.general.redfish_config: community.general.redfish_config:
category: Sessions category: Sessions
command: SetSessionService command: SetSessionService
sessions_config: sessions_config:
SessionTimeout: 1800 SessionTimeout: 1800
baseuri: "{{ baseuri }}" baseuri: "{{ baseuri }}"
username: "{{ username }}" username: "{{ username }}"
password: "{{ password }}" password: "{{ password }}"
- name: Enable SecureBoot - name: Enable SecureBoot
community.general.redfish_config: community.general.redfish_config:
category: Systems category: Systems
command: EnableSecureBoot command: EnableSecureBoot
baseuri: "{{ baseuri }}" baseuri: "{{ baseuri }}"
username: "{{ username }}" username: "{{ username }}"
password: "{{ password }}" password: "{{ password }}"
- name: Set SecureBoot - name: Set SecureBoot
community.general.redfish_config: community.general.redfish_config:
category: Systems category: Systems
command: SetSecureBoot command: SetSecureBoot
baseuri: "{{ baseuri }}" baseuri: "{{ baseuri }}"
username: "{{ username }}" username: "{{ username }}"
password: "{{ password }}" password: "{{ password }}"
secure_boot_enable: True secure_boot_enable: true
- name: Delete All Volumes - name: Delete All Volumes
community.general.redfish_config: community.general.redfish_config:
category: Systems category: Systems
command: DeleteVolumes command: DeleteVolumes
baseuri: "{{ baseuri }}" baseuri: "{{ baseuri }}"
username: "{{ username }}" username: "{{ username }}"
password: "{{ password }}" password: "{{ password }}"
storage_subsystem_id: "DExxxxxx" storage_subsystem_id: "DExxxxxx"
volume_ids: ["volume1", "volume2"] volume_ids: ["volume1", "volume2"]
- name: Create Volume - name: Create Volume
community.general.redfish_config: community.general.redfish_config:
category: Systems category: Systems
command: CreateVolume command: CreateVolume
baseuri: "{{ baseuri }}" baseuri: "{{ baseuri }}"
username: "{{ username }}" username: "{{ username }}"
password: "{{ password }}" password: "{{ password }}"
storage_subsystem_id: "DExxxxxx" storage_subsystem_id: "DExxxxxx"
volume_details: volume_details:
Name: "MR Volume" Name: "MR Volume"
RAIDType: "RAID0" RAIDType: "RAID0"
Drives: Drives:
- "/redfish/v1/Systems/1/Storage/DE00B000/Drives/1" - "/redfish/v1/Systems/1/Storage/DE00B000/Drives/1"
- name: Set service identification to {{ service_id }} - name: Set service identification to {{ service_id }}
community.general.redfish_config: community.general.redfish_config:
category: Manager category: Manager
command: SetServiceIdentification command: SetServiceIdentification
service_id: "{{ service_id }}" service_id: "{{ service_id }}"
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_collections.community.general.plugins.module_utils.redfish_utils import RedfishUtils from ansible_collections.community.general.plugins.module_utils.redfish_utils import RedfishUtils

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: redfish_info module: redfish_info
short_description: Manages Out-Of-Band controllers using Redfish APIs short_description: Manages Out-Of-Band controllers using 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 get information back.
get information back.
- Information retrieved is placed in a location specified by the user. - Information retrieved is placed in a location specified by the user.
extends_documentation_fragment: extends_documentation_fragment:
- community.general.attributes - community.general.attributes
@ -63,8 +61,7 @@ options:
timeout: timeout:
description: description:
- Timeout in seconds for HTTP requests to OOB controller. - Timeout in seconds for HTTP requests to OOB controller.
- The default value for this parameter changed from V(10) to V(60) - The default value for this parameter changed from V(10) to V(60) in community.general 9.0.0.
in community.general 9.0.0.
type: int type: int
default: 60 default: 60
update_handle: update_handle:
@ -77,318 +74,317 @@ options:
required: false required: false
description: description:
- SSL/TLS Ciphers to use for the request. - SSL/TLS Ciphers to use for the request.
- 'When a list is provided, all ciphers are joined in order with V(:).' - When a list is provided, all ciphers are joined in order with V(:).
- See the L(OpenSSL Cipher List Format,https://www.openssl.org/docs/manmaster/man1/openssl-ciphers.html#CIPHER-LIST-FORMAT) - See the L(OpenSSL Cipher List Format,https://www.openssl.org/docs/manmaster/man1/openssl-ciphers.html#CIPHER-LIST-FORMAT) for more details.
for more details.
- The available ciphers is dependent on the Python and OpenSSL/LibreSSL versions. - The available ciphers is dependent on the Python and OpenSSL/LibreSSL versions.
type: list type: list
elements: str elements: str
version_added: 9.2.0 version_added: 9.2.0
author: "Jose Delarosa (@jose-delarosa)" author: "Jose Delarosa (@jose-delarosa)"
''' """
EXAMPLES = ''' EXAMPLES = r"""
- name: Get CPU inventory - name: Get CPU inventory
community.general.redfish_info: community.general.redfish_info:
category: Systems category: Systems
command: GetCpuInventory command: GetCpuInventory
baseuri: "{{ baseuri }}" baseuri: "{{ baseuri }}"
username: "{{ username }}" username: "{{ username }}"
password: "{{ password }}" password: "{{ password }}"
register: result register: result
- name: Print fetched information - name: Print fetched information
ansible.builtin.debug: ansible.builtin.debug:
msg: "{{ result.redfish_facts.cpu.entries | to_nice_json }}" msg: "{{ result.redfish_facts.cpu.entries | to_nice_json }}"
- name: Get CPU model - name: Get CPU model
community.general.redfish_info: community.general.redfish_info:
category: Systems category: Systems
command: GetCpuInventory command: GetCpuInventory
baseuri: "{{ baseuri }}" baseuri: "{{ baseuri }}"
username: "{{ username }}" username: "{{ username }}"
password: "{{ password }}" password: "{{ password }}"
register: result register: result
- name: Print fetched information - name: Print fetched information
ansible.builtin.debug: ansible.builtin.debug:
msg: "{{ result.redfish_facts.cpu.entries.0.Model }}" msg: "{{ result.redfish_facts.cpu.entries.0.Model }}"
- name: Get memory inventory - name: Get memory inventory
community.general.redfish_info: community.general.redfish_info:
category: Systems category: Systems
command: GetMemoryInventory command: GetMemoryInventory
baseuri: "{{ baseuri }}" baseuri: "{{ baseuri }}"
username: "{{ username }}" username: "{{ username }}"
password: "{{ password }}" password: "{{ password }}"
register: result register: result
- name: Get fan inventory with a timeout of 20 seconds - name: Get fan inventory with a timeout of 20 seconds
community.general.redfish_info: community.general.redfish_info:
category: Chassis category: Chassis
command: GetFanInventory command: GetFanInventory
baseuri: "{{ baseuri }}" baseuri: "{{ baseuri }}"
username: "{{ username }}" username: "{{ username }}"
password: "{{ password }}" password: "{{ password }}"
timeout: 20 timeout: 20
register: result register: result
- name: Get Virtual Media information - name: Get Virtual Media information
community.general.redfish_info: community.general.redfish_info:
category: Manager category: Manager
command: GetVirtualMedia command: GetVirtualMedia
baseuri: "{{ baseuri }}" baseuri: "{{ baseuri }}"
username: "{{ username }}" username: "{{ username }}"
password: "{{ password }}" password: "{{ password }}"
register: result register: result
- name: Print fetched information - name: Print fetched information
ansible.builtin.debug: ansible.builtin.debug:
msg: "{{ result.redfish_facts.virtual_media.entries | to_nice_json }}" msg: "{{ result.redfish_facts.virtual_media.entries | to_nice_json }}"
- name: Get Virtual Media information from Systems - name: Get Virtual Media information from Systems
community.general.redfish_info: community.general.redfish_info:
category: Systems category: Systems
command: GetVirtualMedia command: GetVirtualMedia
baseuri: "{{ baseuri }}" baseuri: "{{ baseuri }}"
username: "{{ username }}" username: "{{ username }}"
password: "{{ password }}" password: "{{ password }}"
register: result register: result
- name: Print fetched information - name: Print fetched information
ansible.builtin.debug: ansible.builtin.debug:
msg: "{{ result.redfish_facts.virtual_media.entries | to_nice_json }}" msg: "{{ result.redfish_facts.virtual_media.entries | to_nice_json }}"
- name: Get Volume Inventory - name: Get Volume Inventory
community.general.redfish_info: community.general.redfish_info:
category: Systems category: Systems
command: GetVolumeInventory command: GetVolumeInventory
baseuri: "{{ baseuri }}" baseuri: "{{ baseuri }}"
username: "{{ username }}" username: "{{ username }}"
password: "{{ password }}" password: "{{ password }}"
register: result register: result
- name: Print fetched information - name: Print fetched information
ansible.builtin.debug: ansible.builtin.debug:
msg: "{{ result.redfish_facts.volume.entries | to_nice_json }}" msg: "{{ result.redfish_facts.volume.entries | to_nice_json }}"
- name: Get Session information - name: Get Session information
community.general.redfish_info: community.general.redfish_info:
category: Sessions category: Sessions
command: GetSessions command: GetSessions
baseuri: "{{ baseuri }}" baseuri: "{{ baseuri }}"
username: "{{ username }}" username: "{{ username }}"
password: "{{ password }}" password: "{{ password }}"
register: result register: result
- name: Print fetched information - name: Print fetched information
ansible.builtin.debug: ansible.builtin.debug:
msg: "{{ result.redfish_facts.session.entries | to_nice_json }}" msg: "{{ result.redfish_facts.session.entries | to_nice_json }}"
- name: Get default inventory information - name: Get default inventory information
community.general.redfish_info: community.general.redfish_info:
baseuri: "{{ baseuri }}" baseuri: "{{ baseuri }}"
username: "{{ username }}" username: "{{ username }}"
password: "{{ password }}" password: "{{ password }}"
register: result register: result
- name: Print fetched information - name: Print fetched information
ansible.builtin.debug: ansible.builtin.debug:
msg: "{{ result.redfish_facts | to_nice_json }}" msg: "{{ result.redfish_facts | to_nice_json }}"
- name: Get several inventories - name: Get several inventories
community.general.redfish_info: community.general.redfish_info:
category: Systems category: Systems
command: GetNicInventory,GetBiosAttributes command: GetNicInventory,GetBiosAttributes
baseuri: "{{ baseuri }}" baseuri: "{{ baseuri }}"
username: "{{ username }}" username: "{{ username }}"
password: "{{ password }}" password: "{{ password }}"
- name: Get default system inventory and user information - name: Get default system inventory and user information
community.general.redfish_info: community.general.redfish_info:
category: Systems,Accounts category: Systems,Accounts
baseuri: "{{ baseuri }}" baseuri: "{{ baseuri }}"
username: "{{ username }}" username: "{{ username }}"
password: "{{ password }}" password: "{{ password }}"
- name: Get default system, user and firmware information - name: Get default system, user and firmware information
community.general.redfish_info: community.general.redfish_info:
category: ["Systems", "Accounts", "Update"] category: ["Systems", "Accounts", "Update"]
baseuri: "{{ baseuri }}" baseuri: "{{ baseuri }}"
username: "{{ username }}" username: "{{ username }}"
password: "{{ password }}" password: "{{ password }}"
- name: Get Manager NIC inventory information - name: Get Manager NIC inventory information
community.general.redfish_info: community.general.redfish_info:
category: Manager category: Manager
command: GetManagerNicInventory command: GetManagerNicInventory
baseuri: "{{ baseuri }}" baseuri: "{{ baseuri }}"
username: "{{ username }}" username: "{{ username }}"
password: "{{ password }}" password: "{{ password }}"
- name: Get boot override information - name: Get boot override information
community.general.redfish_info: community.general.redfish_info:
category: Systems category: Systems
command: GetBootOverride command: GetBootOverride
baseuri: "{{ baseuri }}" baseuri: "{{ baseuri }}"
username: "{{ username }}" username: "{{ username }}"
password: "{{ password }}" password: "{{ password }}"
- name: Get chassis inventory - name: Get chassis inventory
community.general.redfish_info: community.general.redfish_info:
category: Chassis category: Chassis
command: GetChassisInventory command: GetChassisInventory
baseuri: "{{ baseuri }}" baseuri: "{{ baseuri }}"
username: "{{ username }}" username: "{{ username }}"
password: "{{ password }}" password: "{{ password }}"
- name: Get all information available in the Manager category - name: Get all information available in the Manager category
community.general.redfish_info: community.general.redfish_info:
category: Manager category: Manager
command: all command: all
baseuri: "{{ baseuri }}" baseuri: "{{ baseuri }}"
username: "{{ username }}" username: "{{ username }}"
password: "{{ password }}" password: "{{ password }}"
- name: Get firmware update capability information - name: Get firmware update capability information
community.general.redfish_info: community.general.redfish_info:
category: Update category: Update
command: GetFirmwareUpdateCapabilities command: GetFirmwareUpdateCapabilities
baseuri: "{{ baseuri }}" baseuri: "{{ baseuri }}"
username: "{{ username }}" username: "{{ username }}"
password: "{{ password }}" password: "{{ password }}"
- name: Get firmware inventory - name: Get firmware inventory
community.general.redfish_info: community.general.redfish_info:
category: Update category: Update
command: GetFirmwareInventory command: GetFirmwareInventory
baseuri: "{{ baseuri }}" baseuri: "{{ baseuri }}"
username: "{{ username }}" username: "{{ username }}"
password: "{{ password }}" password: "{{ password }}"
- name: Get service identification - name: Get service identification
community.general.redfish_info: community.general.redfish_info:
category: Manager category: Manager
command: GetServiceIdentification command: GetServiceIdentification
manager: "{{ manager }}" manager: "{{ manager }}"
baseuri: "{{ baseuri }}" baseuri: "{{ baseuri }}"
username: "{{ username }}" username: "{{ username }}"
password: "{{ password }}" password: "{{ password }}"
- name: Get software inventory - name: Get software inventory
community.general.redfish_info: community.general.redfish_info:
category: Update category: Update
command: GetSoftwareInventory command: GetSoftwareInventory
baseuri: "{{ baseuri }}" baseuri: "{{ baseuri }}"
username: "{{ username }}" username: "{{ username }}"
password: "{{ password }}" password: "{{ password }}"
- name: Get the status of an update operation - name: Get the status of an update operation
community.general.redfish_info: community.general.redfish_info:
category: Update category: Update
command: GetUpdateStatus command: GetUpdateStatus
baseuri: "{{ baseuri }}" baseuri: "{{ baseuri }}"
username: "{{ username }}" username: "{{ username }}"
password: "{{ password }}" password: "{{ password }}"
update_handle: /redfish/v1/TaskService/TaskMonitors/735 update_handle: /redfish/v1/TaskService/TaskMonitors/735
- name: Get Manager Services - name: Get Manager Services
community.general.redfish_info: community.general.redfish_info:
category: Manager category: Manager
command: GetNetworkProtocols command: GetNetworkProtocols
baseuri: "{{ baseuri }}" baseuri: "{{ baseuri }}"
username: "{{ username }}" username: "{{ username }}"
password: "{{ password }}" password: "{{ password }}"
- name: Get all information available in all categories - name: Get all information available in all categories
community.general.redfish_info: community.general.redfish_info:
category: all category: all
command: all command: all
baseuri: "{{ baseuri }}" baseuri: "{{ baseuri }}"
username: "{{ username }}" username: "{{ username }}"
password: "{{ password }}" password: "{{ password }}"
- name: Get system health report - name: Get system health report
community.general.redfish_info: community.general.redfish_info:
category: Systems category: Systems
command: GetHealthReport command: GetHealthReport
baseuri: "{{ baseuri }}" baseuri: "{{ baseuri }}"
username: "{{ username }}" username: "{{ username }}"
password: "{{ password }}" password: "{{ password }}"
- name: Get chassis health report - name: Get chassis health report
community.general.redfish_info: community.general.redfish_info:
category: Chassis category: Chassis
command: GetHealthReport command: GetHealthReport
baseuri: "{{ baseuri }}" baseuri: "{{ baseuri }}"
username: "{{ username }}" username: "{{ username }}"
password: "{{ password }}" password: "{{ password }}"
- name: Get manager health report - name: Get manager health report
community.general.redfish_info: community.general.redfish_info:
category: Manager category: Manager
command: GetHealthReport command: GetHealthReport
baseuri: "{{ baseuri }}" baseuri: "{{ baseuri }}"
username: "{{ username }}" username: "{{ username }}"
password: "{{ password }}" password: "{{ password }}"
- name: Get manager Redfish Host Interface inventory - name: Get manager Redfish Host Interface inventory
community.general.redfish_info: community.general.redfish_info:
category: Manager category: Manager
command: GetHostInterfaces command: GetHostInterfaces
baseuri: "{{ baseuri }}" baseuri: "{{ baseuri }}"
username: "{{ username }}" username: "{{ username }}"
password: "{{ password }}" password: "{{ password }}"
- name: Get Manager Inventory - name: Get Manager Inventory
community.general.redfish_info: community.general.redfish_info:
category: Manager category: Manager
command: GetManagerInventory command: GetManagerInventory
baseuri: "{{ baseuri }}" baseuri: "{{ baseuri }}"
username: "{{ username }}" username: "{{ username }}"
password: "{{ password }}" password: "{{ password }}"
- name: Get HPE Thermal Config - name: Get HPE Thermal Config
community.general.redfish_info: community.general.redfish_info:
category: Chassis category: Chassis
command: GetHPEThermalConfig command: GetHPEThermalConfig
baseuri: "{{ baseuri }}" baseuri: "{{ baseuri }}"
username: "{{ username }}" username: "{{ username }}"
password: "{{ password }}" password: "{{ password }}"
- name: Get HPE Fan Percent Minimum - name: Get HPE Fan Percent Minimum
community.general.redfish_info: community.general.redfish_info:
category: Chassis category: Chassis
command: GetHPEFanPercentMin command: GetHPEFanPercentMin
baseuri: "{{ baseuri }}" baseuri: "{{ baseuri }}"
username: "{{ username }}" username: "{{ username }}"
password: "{{ password }}" password: "{{ password }}"
- name: Get BIOS registry - name: Get BIOS registry
community.general.redfish_info: community.general.redfish_info:
category: Systems category: Systems
command: GetBiosRegistries command: GetBiosRegistries
baseuri: "{{ baseuri }}" baseuri: "{{ baseuri }}"
username: "{{ username }}" username: "{{ username }}"
password: "{{ password }}" password: "{{ password }}"
- name: Check the availability of the service with a timeout of 5 seconds - name: Check the availability of the service with a timeout of 5 seconds
community.general.redfish_info: community.general.redfish_info:
category: Service category: Service
command: CheckAvailability command: CheckAvailability
baseuri: "{{ baseuri }}" baseuri: "{{ baseuri }}"
username: "{{ username }}" username: "{{ username }}"
password: "{{ password }}" password: "{{ password }}"
timeout: 5 timeout: 5
register: result register: result
''' """
RETURN = ''' RETURN = r"""
result: result:
description: different results depending on task description: Different results depending on task.
returned: always returned: always
type: dict type: dict
sample: List of CPUs on system sample: List of CPUs on system
''' """
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

@ -10,16 +10,15 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = r"""
---
module: redhat_subscription module: redhat_subscription
short_description: Manage registration and subscriptions to RHSM using C(subscription-manager) short_description: Manage registration and subscriptions to RHSM using C(subscription-manager)
description: description:
- Manage registration and subscription to the Red Hat Subscription Management entitlement platform using the C(subscription-manager) command, - Manage registration and subscription to the Red Hat Subscription Management entitlement platform using the C(subscription-manager) command,
registering using D-Bus if possible. registering using D-Bus if possible.
author: "Barnaby Court (@barnabycourt)" author: "Barnaby Court (@barnabycourt)"
notes: notes:
- | - >-
The module tries to use the D-Bus C(rhsm) service (part of C(subscription-manager)) The module tries to use the D-Bus C(rhsm) service (part of C(subscription-manager))
to register, starting from community.general 6.5.0: this is done so credentials to register, starting from community.general 6.5.0: this is done so credentials
(username, password, activation keys) can be passed to C(rhsm) in a secure way. (username, password, activation keys) can be passed to C(rhsm) in a secure way.
@ -42,171 +41,161 @@ notes:
already registered system, for example attaching pools to it (using O(pool_ids)), already registered system, for example attaching pools to it (using O(pool_ids)),
and modifying the C(syspurpose) attributes (using O(syspurpose)). and modifying the C(syspurpose) attributes (using O(syspurpose)).
requirements: requirements:
- subscription-manager - subscription-manager
- Optionally the C(dbus) Python library; this is usually included in the OS - Optionally the C(dbus) Python library; this is usually included in the OS as it is used by C(subscription-manager).
as it is used by C(subscription-manager).
extends_documentation_fragment: extends_documentation_fragment:
- community.general.attributes - community.general.attributes
attributes: attributes:
check_mode: check_mode:
support: none support: none
diff_mode: diff_mode:
support: none support: none
options: options:
state: state:
description: description:
- whether to register and subscribe (V(present)), or unregister (V(absent)) a system - Whether to register and subscribe (V(present)), or unregister (V(absent)) a system.
choices: [ "present", "absent" ] choices: ["present", "absent"]
default: "present" default: "present"
type: str
username:
description:
- Access.redhat.com or Red Hat Satellite or Katello username.
type: str
password:
description:
- Access.redhat.com or Red Hat Satellite or Katello password.
type: str
token:
description:
- Sso.redhat.com API access token.
type: str
version_added: 6.3.0
server_hostname:
description:
- Specify an alternative Red Hat Subscription Management or Red Hat Satellite or Katello server.
type: str
server_insecure:
description:
- Enable or disable https server certificate verification when connecting to O(server_hostname).
type: str
server_prefix:
description:
- Specify the prefix when registering to the Red Hat Subscription Management or Red Hat Satellite or Katello server.
type: str
version_added: 3.3.0
server_port:
description:
- Specify the port when registering to the Red Hat Subscription Management or Red Hat Satellite or Katello server.
type: str
version_added: 3.3.0
rhsm_baseurl:
description:
- Specify CDN baseurl.
type: str
rhsm_repo_ca_cert:
description:
- Specify an alternative location for a CA certificate for CDN.
type: str
server_proxy_hostname:
description:
- Specify an HTTP proxy hostname.
type: str
server_proxy_scheme:
description:
- Specify an HTTP proxy scheme, for example V(http) or V(https).
type: str
version_added: 6.2.0
server_proxy_port:
description:
- Specify an HTTP proxy port.
type: str
server_proxy_user:
description:
- Specify a user for HTTP proxy with basic authentication.
type: str
server_proxy_password:
description:
- Specify a password for HTTP proxy with basic authentication.
type: str
auto_attach:
description:
- Upon successful registration, auto-consume available subscriptions.
- "Please note that the alias O(ignore:autosubscribe) was removed in community.general 9.0.0."
type: bool
activationkey:
description:
- Supply an activation key for use with registration.
type: str
org_id:
description:
- Organization ID to use in conjunction with activationkey.
type: str
environment:
description:
- Register with a specific environment in the destination org. Used with Red Hat Satellite or Katello.
type: str
pool_ids:
description:
- "Specify subscription pool IDs to consume.
- A pool ID may be specified as a C(string) - just the pool ID (for example V(0123456789abcdef0123456789abcdef)),
or as a C(dict) with the pool ID as the key, and a quantity as the value (for example V(0123456789abcdef0123456789abcdef: 2). If the
quantity is provided, it is used to consume multiple entitlements from a pool (the pool must support this)."
default: []
type: list
elements: raw
consumer_type:
description:
- The type of unit to register, defaults to system.
type: str
consumer_name:
description:
- Name of the system to register, defaults to the hostname.
type: str
consumer_id:
description:
- "References an existing consumer ID to resume using a previous registration for this system. If the system's identity certificate is
lost or corrupted, this option allows it to resume using its previous identity and subscriptions. The default is to not specify a consumer
ID so a new ID is created."
type: str
force_register:
description:
- Register the system even if it is already registered.
type: bool
default: false
release:
description:
- Set a release version.
type: str
syspurpose:
description:
- Set syspurpose attributes in file C(/etc/rhsm/syspurpose/syspurpose.json) and synchronize these attributes with RHSM server. Syspurpose
attributes help attach the most appropriate subscriptions to the system automatically. When C(syspurpose.json) file already contains some
attributes, then new attributes overwrite existing attributes. When some attribute is not listed in the new list of attributes, the existing
attribute will be removed from C(syspurpose.json) file. Unknown attributes are ignored.
type: dict
suboptions:
usage:
description: Syspurpose attribute usage.
type: str type: str
username: role:
description: description: Syspurpose attribute role.
- access.redhat.com or Red Hat Satellite or Katello username
type: str type: str
password: service_level_agreement:
description: description: Syspurpose attribute service_level_agreement.
- access.redhat.com or Red Hat Satellite or Katello password
type: str type: str
token: addons:
description: description: Syspurpose attribute addons.
- sso.redhat.com API access token.
type: str
version_added: 6.3.0
server_hostname:
description:
- Specify an alternative Red Hat Subscription Management or Red Hat Satellite or Katello server.
type: str
server_insecure:
description:
- Enable or disable https server certificate verification when connecting to O(server_hostname).
type: str
server_prefix:
description:
- Specify the prefix when registering to the Red Hat Subscription Management or Red Hat Satellite or Katello server.
type: str
version_added: 3.3.0
server_port:
description:
- Specify the port when registering to the Red Hat Subscription Management or Red Hat Satellite or Katello server.
type: str
version_added: 3.3.0
rhsm_baseurl:
description:
- Specify CDN baseurl
type: str
rhsm_repo_ca_cert:
description:
- Specify an alternative location for a CA certificate for CDN
type: str
server_proxy_hostname:
description:
- Specify an HTTP proxy hostname.
type: str
server_proxy_scheme:
description:
- Specify an HTTP proxy scheme, for example V(http) or V(https).
type: str
version_added: 6.2.0
server_proxy_port:
description:
- Specify an HTTP proxy port.
type: str
server_proxy_user:
description:
- Specify a user for HTTP proxy with basic authentication
type: str
server_proxy_password:
description:
- Specify a password for HTTP proxy with basic authentication
type: str
auto_attach:
description:
- Upon successful registration, auto-consume available subscriptions
- |
Please note that the alias O(ignore:autosubscribe) was removed in
community.general 9.0.0.
type: bool
activationkey:
description:
- supply an activation key for use with registration
type: str
org_id:
description:
- Organization ID to use in conjunction with activationkey
type: str
environment:
description:
- Register with a specific environment in the destination org. Used with Red Hat Satellite or Katello
type: str
pool_ids:
description:
- |
Specify subscription pool IDs to consume.
A pool ID may be specified as a C(string) - just the pool ID (for example V(0123456789abcdef0123456789abcdef)),
or as a C(dict) with the pool ID as the key, and a quantity as the value (for example
V(0123456789abcdef0123456789abcdef: 2). If the quantity is provided, it is used to consume multiple
entitlements from a pool (the pool must support this).
default: []
type: list type: list
elements: raw elements: str
consumer_type: sync:
description: description:
- The type of unit to register, defaults to system - When this option is V(true), then syspurpose attributes are synchronized with RHSM server immediately. When this option is V(false),
type: str then syspurpose attributes will be synchronized with RHSM server by rhsmcertd daemon.
consumer_name:
description:
- Name of the system to register, defaults to the hostname
type: str
consumer_id:
description:
- |
References an existing consumer ID to resume using a previous registration
for this system. If the system's identity certificate is lost or corrupted,
this option allows it to resume using its previous identity and subscriptions.
The default is to not specify a consumer ID so a new ID is created.
type: str
force_register:
description:
- Register the system even if it is already registered
type: bool type: bool
default: false default: false
release: """
description:
- Set a release version
type: str
syspurpose:
description:
- Set syspurpose attributes in file C(/etc/rhsm/syspurpose/syspurpose.json)
and synchronize these attributes with RHSM server. Syspurpose attributes help attach
the most appropriate subscriptions to the system automatically. When C(syspurpose.json) file
already contains some attributes, then new attributes overwrite existing attributes.
When some attribute is not listed in the new list of attributes, the existing
attribute will be removed from C(syspurpose.json) file. Unknown attributes are ignored.
type: dict
suboptions:
usage:
description: Syspurpose attribute usage
type: str
role:
description: Syspurpose attribute role
type: str
service_level_agreement:
description: Syspurpose attribute service_level_agreement
type: str
addons:
description: Syspurpose attribute addons
type: list
elements: str
sync:
description:
- When this option is V(true), then syspurpose attributes are synchronized with
RHSM server immediately. When this option is V(false), then syspurpose attributes
will be synchronized with RHSM server by rhsmcertd daemon.
type: bool
default: false
'''
EXAMPLES = ''' EXAMPLES = r"""
- name: Register as user (joe_user) with password (somepass) and auto-subscribe to available content. - name: Register as user (joe_user) with password (somepass) and auto-subscribe to available content.
community.general.redhat_subscription: community.general.redhat_subscription:
state: present state: present
@ -275,17 +264,15 @@ EXAMPLES = '''
- addon1 - addon1
- addon2 - addon2
sync: true sync: true
''' """
RETURN = ''' RETURN = r"""
subscribed_pool_ids: subscribed_pool_ids:
description: List of pool IDs to which system is now subscribed description: List of pool IDs to which system is now subscribed.
returned: success returned: success
type: dict type: dict
sample: { sample: {"8a85f9815ab905d3015ab928c7005de4": "1"}
"8a85f9815ab905d3015ab928c7005de4": "1" """
}
'''
from os.path import isfile from os.path import isfile
from os import getuid, unlink from os import getuid, unlink

View File

@ -8,91 +8,85 @@
from __future__ import absolute_import, division, print_function from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = r"""
---
module: redis module: redis
short_description: Various redis commands, replica and flush short_description: Various redis commands, replica and flush
description: description:
- Unified utility to interact with redis instances. - Unified utility to interact with redis instances.
extends_documentation_fragment: extends_documentation_fragment:
- community.general.redis - community.general.redis
- community.general.attributes - community.general.attributes
attributes: attributes:
check_mode: check_mode:
support: full support: full
diff_mode: diff_mode:
support: none support: none
options: options:
command: command:
description: description:
- The selected redis command - The selected redis command.
- V(config) ensures a configuration setting on an instance. - V(config) ensures a configuration setting on an instance.
- V(flush) flushes all the instance or a specified db. - V(flush) flushes all the instance or a specified db.
- V(replica) sets a redis instance in replica or master mode. (V(slave) is an alias for V(replica).) - V(replica) sets a redis instance in replica or master mode. (V(slave) is an alias for V(replica)).
choices: [ config, flush, replica, slave ] choices: [config, flush, replica, slave]
type: str type: str
tls: tls:
default: false default: false
version_added: 4.6.0 version_added: 4.6.0
login_user: login_user:
version_added: 4.6.0 version_added: 4.6.0
validate_certs: validate_certs:
version_added: 4.6.0 version_added: 4.6.0
ca_certs: ca_certs:
version_added: 4.6.0 version_added: 4.6.0
master_host: master_host:
description: description:
- The host of the master instance [replica command] - The host of the master instance [replica command].
type: str type: str
master_port: master_port:
description: description:
- The port of the master instance [replica command] - The port of the master instance [replica command].
type: int type: int
replica_mode: replica_mode:
description: description:
- The mode of the redis instance [replica command] - The mode of the redis instance [replica command].
- V(slave) is an alias for V(replica). - V(slave) is an alias for V(replica).
default: replica default: replica
choices: [ master, replica, slave ] choices: [master, replica, slave]
type: str type: str
aliases: aliases:
- slave_mode - slave_mode
db: db:
description: description:
- The database to flush (used in db mode) [flush command] - The database to flush (used in DB mode) [flush command].
type: int type: int
flush_mode: flush_mode:
description: description:
- Type of flush (all the dbs in a redis instance or a specific one) - Type of flush (all the DBs in a redis instance or a specific one) [flush command].
[flush command] default: all
default: all choices: [all, db]
choices: [ all, db ] type: str
type: str name:
name: description:
description: - A redis config key.
- A redis config key. type: str
type: str value:
value: description:
description: - A redis config value. When memory size is needed, it is possible to specify it in the usual form of 1KB, 2M, 400MB where the base is 1024.
- A redis config value. When memory size is needed, it is possible Units are case insensitive, in other words 1m = 1mb = 1M = 1MB.
to specify it in the usual form of 1KB, 2M, 400MB where the base is 1024. type: str
Units are case insensitive i.e. 1m = 1mb = 1M = 1MB.
type: str
notes: notes:
- Requires the redis-py Python package on the remote host. You can - Requires the C(redis-py) Python package on the remote host. You can install it with pip
install it with pip (pip install redis) or with a package manager. (C(pip install redis)) or with a package manager. U(https://github.com/andymccurdy/redis-py).
https://github.com/andymccurdy/redis-py - If the redis master instance you are making replica of is password protected this needs to be in the C(redis.conf) in the C(masterauth) variable.
- If the redis master instance we are making replica of is password protected
this needs to be in the redis.conf in the masterauth variable
seealso: seealso:
- module: community.general.redis_info - module: community.general.redis_info
requirements: [ redis ] requirements: [redis]
author: "Xabier Larrakoetxea (@slok)" author: "Xabier Larrakoetxea (@slok)"
''' """
EXAMPLES = ''' EXAMPLES = r"""
- name: Set local redis instance to be a replica of melee.island on port 6377 - name: Set local redis instance to be a replica of melee.island on port 6377
community.general.redis: community.general.redis:
command: replica command: replica
@ -142,7 +136,7 @@ EXAMPLES = '''
ca_certs: /etc/redis/certs/ca.crt ca_certs: /etc/redis/certs/ca.crt
client_cert_file: /etc/redis/certs/redis.crt client_cert_file: /etc/redis/certs/redis.crt
client_key_file: /etc/redis/certs/redis.key client_key_file: /etc/redis/certs/redis.key
''' """
import traceback import traceback

View File

@ -8,71 +8,69 @@
from __future__ import absolute_import, division, print_function from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = r"""
---
module: redis_data module: redis_data
short_description: Set key value pairs in Redis short_description: Set key value pairs in Redis
version_added: 3.7.0 version_added: 3.7.0
description: description:
- Set key value pairs in Redis database. - Set key value pairs in Redis database.
author: "Andreas Botzner (@paginabianca)" author: "Andreas Botzner (@paginabianca)"
attributes: attributes:
check_mode: check_mode:
support: full support: full
diff_mode: diff_mode:
support: none support: none
options: options:
key: key:
description: description:
- Database key. - Database key.
required: true required: true
type: str type: str
value: value:
description: description:
- Value that key should be set to. - Value that key should be set to.
required: false required: false
type: str type: str
expiration: expiration:
description: description:
- Expiration time in milliseconds. - Expiration time in milliseconds. Setting this flag will always result in a change in the database.
Setting this flag will always result in a change in the database. required: false
required: false type: int
type: int non_existing:
non_existing: description:
description: - Only set key if it does not already exist.
- Only set key if it does not already exist. required: false
required: false type: bool
type: bool existing:
existing: description:
description: - Only set key if it already exists.
- Only set key if it already exists. required: false
required: false type: bool
type: bool keep_ttl:
keep_ttl: description:
description: - Retain the time to live associated with the key.
- Retain the time to live associated with the key. required: false
required: false type: bool
type: bool state:
state: description:
description: - State of the key.
- State of the key. default: present
default: present type: str
type: str choices:
choices: - present
- present - absent
- absent
extends_documentation_fragment: extends_documentation_fragment:
- community.general.redis.documentation - community.general.redis.documentation
- community.general.attributes - community.general.attributes
seealso: seealso:
- module: community.general.redis_data_incr - module: community.general.redis_data_incr
- module: community.general.redis_data_info - module: community.general.redis_data_info
- module: community.general.redis - module: community.general.redis
''' """
EXAMPLES = ''' EXAMPLES = r"""
- name: Set key foo=bar on localhost with no username - name: Set key foo=bar on localhost with no username
community.general.redis_data: community.general.redis_data:
login_host: localhost login_host: localhost
@ -116,9 +114,9 @@ EXAMPLES = '''
login_password: supersecret login_password: supersecret
key: foo key: foo
state: absent state: absent
''' """
RETURN = ''' RETURN = r"""
old_value: old_value:
description: Value of key before setting. description: Value of key before setting.
returned: on_success if O(state=present) and key exists in database. returned: on_success if O(state=present) and key exists in database.
@ -134,7 +132,7 @@ msg:
returned: always returned: always
type: str type: str
sample: 'Set key: foo to bar' sample: 'Set key: foo to bar'
''' """
from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.basic import AnsibleModule
from ansible_collections.community.general.plugins.module_utils.redis import ( from ansible_collections.community.general.plugins.module_utils.redis import (

View File

@ -8,24 +8,22 @@
from __future__ import absolute_import, division, print_function from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = r"""
---
module: redis_data_incr module: redis_data_incr
short_description: Increment keys in Redis short_description: Increment keys in Redis
version_added: 4.0.0 version_added: 4.0.0
description: description:
- Increment integers or float keys in Redis database and get new value. - Increment integers or float keys in Redis database and get new value.
- Default increment for all keys is 1. For specific increments use the - Default increment for all keys is V(1). For specific increments use the O(increment_int) and O(increment_float) options.
O(increment_int) and O(increment_float) options.
author: "Andreas Botzner (@paginabianca)" author: "Andreas Botzner (@paginabianca)"
attributes: attributes:
check_mode: check_mode:
support: partial support: partial
details: details:
- For C(check_mode) to work, the specified O(login_user) needs permission to - For C(check_mode) to work, the specified O(login_user) needs permission to run the C(GET) command on the key, otherwise the module will
run the C(GET) command on the key, otherwise the module will fail. fail.
- When using C(check_mode) the module will try to calculate the value that - When using C(check_mode) the module will try to calculate the value that Redis would return. If the key is not present, V(0.0) is used as
Redis would return. If the key is not present, 0.0 is used as value. value.
diff_mode: diff_mode:
support: none support: none
options: options:
@ -42,8 +40,7 @@ options:
increment_float: increment_float:
description: description:
- Float amount to increment the key by. - Float amount to increment the key by.
- This only works with keys that contain float values - This only works with keys that contain float values in their string representation.
in their string representation.
type: float type: float
required: false required: false
@ -53,12 +50,12 @@ extends_documentation_fragment:
- community.general.attributes - community.general.attributes
seealso: seealso:
- module: community.general.redis_data - module: community.general.redis_data
- module: community.general.redis_data_info - module: community.general.redis_data_info
- module: community.general.redis - module: community.general.redis
''' """
EXAMPLES = ''' EXAMPLES = r"""
- name: Increment integer key foo on localhost with no username and print new value - name: Increment integer key foo on localhost with no username and print new value
community.general.redis_data_incr: community.general.redis_data_incr:
login_host: localhost login_host: localhost
@ -77,11 +74,11 @@ EXAMPLES = '''
login_password: somepass login_password: somepass
key: foo key: foo
increment_float: '20.4' increment_float: '20.4'
''' """
RETURN = ''' RETURN = r"""
value: value:
description: Incremented value of key description: Incremented value of key.
returned: on success returned: on success
type: float type: float
sample: '4039.4' sample: '4039.4'
@ -90,7 +87,7 @@ msg:
returned: always returned: always
type: str type: str
sample: 'Incremented key: foo by 20.4 to 65.9' sample: 'Incremented key: foo by 20.4 to 65.9'
''' """
from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.basic import AnsibleModule
from ansible_collections.community.general.plugins.module_utils.redis import ( from ansible_collections.community.general.plugins.module_utils.redis import (

View File

@ -8,8 +8,7 @@
from __future__ import absolute_import, division, print_function from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = r"""
---
module: redis_data_info module: redis_data_info
short_description: Get value of key in Redis database short_description: Get value of key in Redis database
version_added: 3.7.0 version_added: 3.7.0
@ -33,9 +32,9 @@ seealso:
- module: community.general.redis_data_incr - module: community.general.redis_data_incr
- module: community.general.redis_info - module: community.general.redis_info
- module: community.general.redis - module: community.general.redis
''' """
EXAMPLES = ''' EXAMPLES = r"""
- name: Get key foo=bar from loalhost with no username - name: Get key foo=bar from loalhost with no username
community.general.redis_data_info: community.general.redis_data_info:
login_host: localhost login_host: localhost
@ -50,9 +49,9 @@ EXAMPLES = '''
validate_certs: true validate_certs: true
ssl_ca_certs: /path/to/ca/certs ssl_ca_certs: /path/to/ca/certs
key: foo key: foo
''' """
RETURN = ''' RETURN = r"""
exists: exists:
description: If they key exists in the database. description: If they key exists in the database.
returned: on success returned: on success
@ -67,7 +66,7 @@ msg:
returned: always returned: always
type: str type: str
sample: 'Got key: foo with value: bar' sample: 'Got key: foo with value: bar'
''' """
from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.basic import AnsibleModule
from ansible_collections.community.general.plugins.module_utils.redis import ( from ansible_collections.community.general.plugins.module_utils.redis import (

View File

@ -9,17 +9,16 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = r''' DOCUMENTATION = r"""
---
module: redis_info module: redis_info
short_description: Gather information about Redis servers short_description: Gather information about Redis servers
version_added: '0.2.0' version_added: '0.2.0'
description: description:
- Gathers information and statistics about Redis servers. - Gathers information and statistics about Redis servers.
extends_documentation_fragment: extends_documentation_fragment:
- community.general.redis - community.general.redis
- community.general.attributes - community.general.attributes
- community.general.attributes.info_module - community.general.attributes.info_module
options: options:
login_user: login_user:
version_added: 7.5.0 version_added: 7.5.0
@ -36,11 +35,11 @@ options:
type: bool type: bool
version_added: 9.1.0 version_added: 9.1.0
seealso: seealso:
- module: community.general.redis - module: community.general.redis
author: "Pavlo Bashynskyi (@levonet)" author: "Pavlo Bashynskyi (@levonet)"
''' """
EXAMPLES = r''' EXAMPLES = r"""
- name: Get server information - name: Get server information
community.general.redis_info: community.general.redis_info:
register: result register: result
@ -57,9 +56,9 @@ EXAMPLES = r'''
- name: Print server cluster information - name: Print server cluster information
ansible.builtin.debug: ansible.builtin.debug:
var: result.cluster_info var: result.cluster_info
''' """
RETURN = r''' RETURN = r"""
info: info:
description: The default set of server information sections U(https://redis.io/commands/info). description: The default set of server information sections U(https://redis.io/commands/info).
returned: success returned: success
@ -211,7 +210,7 @@ cluster:
"cluster_stats_messages_received": 1483968, "cluster_stats_messages_received": 1483968,
"total_cluster_links_buffer_limit_exceeded": 0 "total_cluster_links_buffer_limit_exceeded": 0
} }
''' """
import traceback import traceback

View File

@ -8,151 +8,150 @@
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: rhevm module: rhevm
short_description: RHEV/oVirt automation short_description: RHEV/oVirt automation
description: description:
- This module only supports oVirt/RHEV version 3. - This module only supports oVirt/RHEV version 3.
- A newer module M(ovirt.ovirt.ovirt_vm) supports oVirt/RHV version 4. - A newer module M(ovirt.ovirt.ovirt_vm) supports oVirt/RHV version 4.
- Allows you to create/remove/update or powermanage virtual machines on a RHEV/oVirt platform. - Allows you to create/remove/update or powermanage virtual machines on a RHEV/oVirt platform.
requirements: requirements:
- ovirtsdk - ovirtsdk
author: author:
- Timothy Vandenbrande (@TimothyVandenbrande) - Timothy Vandenbrande (@TimothyVandenbrande)
extends_documentation_fragment: extends_documentation_fragment:
- community.general.attributes - community.general.attributes
attributes: attributes:
check_mode: check_mode:
support: none support: none
diff_mode: diff_mode:
support: none support: none
options: options:
user: user:
description: description:
- The user to authenticate with. - The user to authenticate with.
type: str type: str
default: admin@internal default: admin@internal
password: password:
description: description:
- The password for user authentication. - The password for user authentication.
type: str type: str
required: true required: true
server: server:
description: description:
- The name/IP of your RHEV-m/oVirt instance. - The name/IP of your RHEV-m/oVirt instance.
type: str type: str
default: 127.0.0.1 default: 127.0.0.1
port: port:
description: description:
- The port on which the API is reachable. - The port on which the API is reachable.
type: int type: int
default: 443 default: 443
insecure_api: insecure_api:
description: description:
- A boolean switch to make a secure or insecure connection to the server. - A boolean switch to make a secure or insecure connection to the server.
type: bool type: bool
default: false default: false
name: name:
description: description:
- The name of the VM. - The name of the VM.
type: str type: str
cluster: cluster:
description: description:
- The RHEV/oVirt cluster in which you want you VM to start. - The RHEV/oVirt cluster in which you want you VM to start.
type: str type: str
default: '' default: ''
datacenter: datacenter:
description: description:
- The RHEV/oVirt datacenter in which you want you VM to start. - The RHEV/oVirt datacenter in which you want you VM to start.
type: str type: str
default: Default default: Default
state: state:
description: description:
- This serves to create/remove/update or powermanage your VM. - This serves to create/remove/update or powermanage your VM.
type: str type: str
choices: [ absent, cd, down, info, ping, present, restarted, up ] choices: [absent, cd, down, info, ping, present, restarted, up]
default: present default: present
image: image:
description: description:
- The template to use for the VM. - The template to use for the VM.
type: str type: str
type: type:
description: description:
- To define if the VM is a server or desktop. - To define if the VM is a server or desktop.
type: str type: str
choices: [ desktop, host, server ] choices: [desktop, host, server]
default: server default: server
vmhost: vmhost:
description: description:
- The host you wish your VM to run on. - The host you wish your VM to run on.
type: str type: str
vmcpu: vmcpu:
description: description:
- The number of CPUs you want in your VM. - The number of CPUs you want in your VM.
type: int type: int
default: 2 default: 2
cpu_share: cpu_share:
description: description:
- This parameter is used to configure the CPU share. - This parameter is used to configure the CPU share.
type: int type: int
default: 0 default: 0
vmmem: vmmem:
description: description:
- The amount of memory you want your VM to use (in GB). - The amount of memory you want your VM to use (in GB).
type: int type: int
default: 1 default: 1
osver: osver:
description: description:
- The operating system option in RHEV/oVirt. - The operating system option in RHEV/oVirt.
type: str type: str
default: rhel_6x64 default: rhel_6x64
mempol: mempol:
description: description:
- The minimum amount of memory you wish to reserve for this system. - The minimum amount of memory you wish to reserve for this system.
type: int type: int
default: 1 default: 1
vm_ha: vm_ha:
description: description:
- To make your VM High Available. - To make your VM High Available.
type: bool type: bool
default: true default: true
disks: disks:
description: description:
- This option uses complex arguments and is a list of disks with the options name, size and domain. - This option uses complex arguments and is a list of disks with the options V(name), V(size), and V(domain).
type: list type: list
elements: str elements: str
ifaces: ifaces:
description: description:
- This option uses complex arguments and is a list of interfaces with the options name and vlan. - This option uses complex arguments and is a list of interfaces with the options V(name) and V(vlan).
type: list type: list
elements: str elements: str
aliases: [ interfaces, nics ] aliases: [interfaces, nics]
boot_order: boot_order:
description: description:
- This option uses complex arguments and is a list of items that specify the bootorder. - This option uses complex arguments and is a list of items that specify the bootorder.
type: list type: list
elements: str elements: str
default: [ hd, network ] default: [hd, network]
del_prot: del_prot:
description: description:
- This option sets the delete protection checkbox. - This option sets the delete protection checkbox.
type: bool type: bool
default: true default: true
cd_drive: cd_drive:
description: description:
- The CD you wish to have mounted on the VM when O(state=cd). - The CD you wish to have mounted on the VM when O(state=cd).
type: str type: str
timeout: timeout:
description: description:
- The timeout you wish to define for power actions. - The timeout you wish to define for power actions.
- When O(state=up). - When O(state=up).
- When O(state=down). - When O(state=down).
- When O(state=restarted). - When O(state=restarted).
type: int type: int
''' """
RETURN = r''' RETURN = r"""
vm: vm:
description: Returns all of the VMs variables and execution. description: Returns all of the VMs variables and execution.
returned: always returned: always
@ -216,9 +215,9 @@ vm:
"vmhost": "host416", "vmhost": "host416",
"vmmem": "16" "vmmem": "16"
} }
''' """
EXAMPLES = r''' EXAMPLES = r"""
- name: Basic get info from VM - name: Basic get info from VM
community.general.rhevm: community.general.rhevm:
server: rhevm01 server: rhevm01
@ -258,33 +257,33 @@ EXAMPLES = r'''
vmcpu: 4 vmcpu: 4
vmmem: 2 vmmem: 2
ifaces: ifaces:
- name: eth0 - name: eth0
vlan: vlan2202 vlan: vlan2202
- name: eth1 - name: eth1
vlan: vlan36 vlan: vlan36
- name: eth2 - name: eth2
vlan: vlan38 vlan: vlan38
- name: eth3 - name: eth3
vlan: vlan2202 vlan: vlan2202
disks: disks:
- name: root - name: root
size: 10 size: 10
domain: ssd-san domain: ssd-san
- name: swap - name: swap
size: 10 size: 10
domain: 15kiscsi-san domain: 15kiscsi-san
- name: opt - name: opt
size: 10 size: 10
domain: 15kiscsi-san domain: 15kiscsi-san
- name: var - name: var
size: 10 size: 10
domain: 10kiscsi-san domain: 10kiscsi-san
- name: home - name: home
size: 10 size: 10
domain: sata-san domain: sata-san
boot_order: boot_order:
- network - network
- hd - hd
state: present state: present
- name: Add a CD to the disk cd_drive - name: Add a CD to the disk cd_drive
@ -302,33 +301,33 @@ EXAMPLES = r'''
type: host type: host
cluster: rhevm01 cluster: rhevm01
ifaces: ifaces:
- name: em1 - name: em1
- name: em2 - name: em2
- name: p3p1 - name: p3p1
ip: 172.31.224.200 ip: 172.31.224.200
netmask: 255.255.254.0 netmask: 255.255.254.0
- name: p3p2 - name: p3p2
ip: 172.31.225.200 ip: 172.31.225.200
netmask: 255.255.254.0 netmask: 255.255.254.0
- name: bond0 - name: bond0
bond: bond:
- em1 - em1
- em2 - em2
network: rhevm network: rhevm
ip: 172.31.222.200 ip: 172.31.222.200
netmask: 255.255.255.0 netmask: 255.255.255.0
management: true management: true
- name: bond0.36 - name: bond0.36
network: vlan36 network: vlan36
ip: 10.2.36.200 ip: 10.2.36.200
netmask: 255.255.254.0 netmask: 255.255.254.0
gateway: 10.2.36.254 gateway: 10.2.36.254
- name: bond0.2202 - name: bond0.2202
network: vlan2202 network: vlan2202
- name: bond0.38 - name: bond0.38
network: vlan38 network: vlan38
state: present state: present
''' """
import time import time

View File

@ -8,18 +8,15 @@
from __future__ import (absolute_import, division, print_function) from __future__ import (absolute_import, division, print_function)
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = r"""
---
module: rhsm_release module: rhsm_release
short_description: Set or Unset RHSM Release version short_description: Set or Unset RHSM Release version
description: description:
- Sets or unsets the release version used by RHSM repositories. - Sets or unsets the release version used by RHSM repositories.
notes: notes:
- This module will fail on an unregistered system. - This module will fail on an unregistered system. Use the M(community.general.redhat_subscription) module to register a system prior to setting
Use the M(community.general.redhat_subscription) module to register a system the RHSM release.
prior to setting the RHSM release. - It is possible to interact with C(subscription-manager) only as root, so root permissions are required to successfully run this module.
- It is possible to interact with C(subscription-manager) only as root,
so root permissions are required to successfully run this module.
requirements: requirements:
- Red Hat Enterprise Linux 6+ with subscription-manager installed - Red Hat Enterprise Linux 6+ with subscription-manager installed
extends_documentation_fragment: extends_documentation_fragment:
@ -37,9 +34,9 @@ options:
type: str type: str
author: author:
- Sean Myers (@seandst) - Sean Myers (@seandst)
''' """
EXAMPLES = ''' EXAMPLES = r"""
# Set release version to 7.1 # Set release version to 7.1
- name: Set RHSM release version - name: Set RHSM release version
community.general.rhsm_release: community.general.rhsm_release:
@ -53,15 +50,15 @@ EXAMPLES = '''
# Unset release version # Unset release version
- name: Unset RHSM release release - name: Unset RHSM release release
community.general.rhsm_release: community.general.rhsm_release:
release: null release:
''' """
RETURN = ''' RETURN = r"""
current_release: current_release:
description: The current RHSM release version value description: The current RHSM release version value.
returned: success returned: success
type: str type: str
''' """
from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.basic import AnsibleModule

View File

@ -8,20 +8,16 @@
from __future__ import absolute_import, division, print_function from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = r"""
---
module: rhsm_repository module: rhsm_repository
short_description: Manage RHSM repositories using the subscription-manager command short_description: Manage RHSM repositories using the subscription-manager command
description: description:
- Manage (Enable/Disable) RHSM repositories to the Red Hat Subscription - Manage (Enable/Disable) RHSM repositories to the Red Hat Subscription Management entitlement platform using the C(subscription-manager) command.
Management entitlement platform using the C(subscription-manager) command.
author: Giovanni Sciortino (@giovannisciortino) author: Giovanni Sciortino (@giovannisciortino)
notes: notes:
- In order to manage RHSM repositories the system must be already registered - In order to manage RHSM repositories the system must be already registered to RHSM manually or using the Ansible M(community.general.redhat_subscription)
to RHSM manually or using the Ansible M(community.general.redhat_subscription) module. module.
- It is possible to interact with C(subscription-manager) only as root, - It is possible to interact with C(subscription-manager) only as root, so root permissions are required to successfully run this module.
so root permissions are required to successfully run this module.
requirements: requirements:
- subscription-manager - subscription-manager
extends_documentation_fragment: extends_documentation_fragment:
@ -34,31 +30,27 @@ attributes:
options: options:
state: state:
description: description:
- If state is equal to present or disabled, indicates the desired - If state is equal to present or disabled, indicates the desired repository state.
repository state. - In community.general 10.0.0 the states V(present) and V(absent) have been removed. Please use V(enabled) and V(disabled) instead.
- In community.general 10.0.0 the states V(present) and V(absent) have been
removed. Please use V(enabled) and V(disabled) instead.
choices: [enabled, disabled] choices: [enabled, disabled]
default: "enabled" default: "enabled"
type: str type: str
name: name:
description: description:
- The ID of repositories to enable. - The ID of repositories to enable.
- To operate on several repositories this can accept a comma separated - To operate on several repositories this can accept a comma separated list or a YAML list.
list or a YAML list.
required: true required: true
type: list type: list
elements: str elements: str
purge: purge:
description: description:
- Disable all currently enabled repositories that are not not specified in O(name). - Disable all currently enabled repositories that are not not specified in O(name). Only set this to V(true) if passing in a list of repositories
Only set this to V(true) if passing in a list of repositories to the O(name) field. to the O(name) field. Using this with C(loop) will most likely not have the desired result.
Using this with C(loop) will most likely not have the desired result.
type: bool type: bool
default: false default: false
''' """
EXAMPLES = ''' EXAMPLES = r"""
- name: Enable a RHSM repository - name: Enable a RHSM repository
community.general.rhsm_repository: community.general.rhsm_repository:
name: rhel-7-server-rpms name: rhel-7-server-rpms
@ -77,16 +69,16 @@ EXAMPLES = '''
community.general.rhsm_repository: community.general.rhsm_repository:
name: rhel-7-server-rpms name: rhel-7-server-rpms
purge: true purge: true
''' """
RETURN = ''' RETURN = r"""
repositories: repositories:
description: description:
- The list of RHSM repositories with their states. - The list of RHSM repositories with their states.
- When this module is used to change the repository states, this list contains the updated states after the changes. - When this module is used to change the repository states, this list contains the updated states after the changes.
returned: success returned: success
type: list type: list
''' """
import os import os
from fnmatch import fnmatch from fnmatch import fnmatch

View File

@ -9,18 +9,16 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = r"""
---
module: riak module: riak
short_description: This module handles some common Riak operations short_description: This module handles some common Riak operations
description: description:
- This module can be used to join nodes to a cluster, check - This module can be used to join nodes to a cluster, check the status of the cluster.
the status of the cluster.
author: author:
- "James Martin (@jsmartin)" - "James Martin (@jsmartin)"
- "Drew Kerrigan (@drewkerrigan)" - "Drew Kerrigan (@drewkerrigan)"
extends_documentation_fragment: extends_documentation_fragment:
- community.general.attributes - community.general.attributes
attributes: attributes:
check_mode: check_mode:
support: none support: none
@ -34,17 +32,17 @@ options:
type: str type: str
config_dir: config_dir:
description: description:
- The path to the riak configuration directory - The path to the riak configuration directory.
default: /etc/riak default: /etc/riak
type: path type: path
http_conn: http_conn:
description: description:
- The ip address and port that is listening for Riak HTTP queries - The ip address and port that is listening for Riak HTTP queries.
default: 127.0.0.1:8098 default: 127.0.0.1:8098
type: str type: str
target_node: target_node:
description: description:
- The target node for certain operations (join, ping) - The target node for certain operations (join, ping).
default: riak@127.0.0.1 default: riak@127.0.0.1
type: str type: str
wait_for_handoffs: wait_for_handoffs:
@ -64,13 +62,12 @@ options:
type: str type: str
validate_certs: validate_certs:
description: description:
- If V(false), SSL certificates will not be validated. This should only be used - If V(false), SSL certificates will not be validated. This should only be used on personally controlled sites using self-signed certificates.
on personally controlled sites using self-signed certificates.
type: bool type: bool
default: true default: true
''' """
EXAMPLES = ''' EXAMPLES = r"""
- name: "Join's a Riak node to another node" - name: "Join's a Riak node to another node"
community.general.riak: community.general.riak:
command: join command: join
@ -83,7 +80,7 @@ EXAMPLES = '''
- name: Wait for riak_kv service to startup - name: Wait for riak_kv service to startup
community.general.riak: community.general.riak:
wait_for_service: kv wait_for_service: kv
''' """
import json import json
import time import time

View File

@ -12,11 +12,11 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = r"""
module: rocketchat module: rocketchat
short_description: Send notifications to Rocket Chat short_description: Send notifications to Rocket Chat
description: description:
- The C(rocketchat) module sends notifications to Rocket Chat via the Incoming WebHook integration - This module sends notifications to Rocket Chat through the Incoming WebHook integration.
author: "Ramon de la Fuente (@ramondelafuente)" author: "Ramon de la Fuente (@ramondelafuente)"
extends_documentation_fragment: extends_documentation_fragment:
- community.general.attributes - community.general.attributes
@ -29,15 +29,12 @@ options:
domain: domain:
type: str type: str
description: description:
- The domain for your environment without protocol. (For example - The domain for your environment without protocol. (For example V(example.com) or V(chat.example.com)).
V(example.com) or V(chat.example.com).)
required: true required: true
token: token:
type: str type: str
description: description:
- Rocket Chat Incoming Webhook integration token. This provides - Rocket Chat Incoming Webhook integration token. This provides authentication to Rocket Chat's Incoming webhook for posting messages.
authentication to Rocket Chat's Incoming webhook for posting
messages.
required: true required: true
protocol: protocol:
type: str type: str
@ -54,8 +51,8 @@ options:
channel: channel:
type: str type: str
description: description:
- Channel to send the message to. If absent, the message goes to the channel selected for the O(token) - Channel to send the message to. If absent, the message goes to the channel selected for the O(token) specified during the creation of
specified during the creation of webhook. webhook.
username: username:
type: str type: str
description: description:
@ -69,8 +66,7 @@ options:
icon_emoji: icon_emoji:
type: str type: str
description: description:
- Emoji for the message sender. The representation for the available emojis can be - Emoji for the message sender. The representation for the available emojis can be got from Rocket Chat.
got from Rocket Chat.
- For example V(:thumbsup:). - For example V(:thumbsup:).
- If O(icon_emoji) is set, O(icon_url) will not be used. - If O(icon_emoji) is set, O(icon_url) will not be used.
link_names: link_names:
@ -83,14 +79,13 @@ options:
- 0 - 0
validate_certs: validate_certs:
description: description:
- If V(false), SSL certificates will not be validated. This should only be used - If V(false), SSL certificates will not be validated. This should only be used on personally controlled sites using self-signed certificates.
on personally controlled sites using self-signed certificates.
type: bool type: bool
default: true default: true
color: color:
type: str type: str
description: description:
- Allow text to use default colors - use the default of 'normal' to not send a custom color bar at the start of the message - Allow text to use default colors - use the default of V(normal) to not send a custom color bar at the start of the message.
default: 'normal' default: 'normal'
choices: choices:
- 'normal' - 'normal'
@ -102,17 +97,17 @@ options:
elements: dict elements: dict
description: description:
- Define a list of attachments. - Define a list of attachments.
''' """
EXAMPLES = """ EXAMPLES = r"""
- name: Send notification message via Rocket Chat - name: Send notification message through Rocket Chat
community.general.rocketchat: community.general.rocketchat:
token: thetoken/generatedby/rocketchat token: thetoken/generatedby/rocketchat
domain: chat.example.com domain: chat.example.com
msg: '{{ inventory_hostname }} completed' msg: '{{ inventory_hostname }} completed'
delegate_to: localhost delegate_to: localhost
- name: Send notification message via Rocket Chat all options - name: Send notification message through Rocket Chat all options
community.general.rocketchat: community.general.rocketchat:
domain: chat.example.com domain: chat.example.com
token: thetoken/generatedby/rocketchat token: thetoken/generatedby/rocketchat
@ -151,12 +146,12 @@ EXAMPLES = """
delegate_to: localhost delegate_to: localhost
""" """
RETURN = """ RETURN = r"""
changed: changed:
description: A flag indicating if any change was made or not. description: A flag indicating if any change was made or not.
returned: success returned: success
type: bool type: bool
sample: false sample: false
""" """
from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.basic import AnsibleModule

View File

@ -9,14 +9,12 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = r"""
---
module: rollbar_deployment module: rollbar_deployment
author: "Max Riveiro (@kavu)" author: "Max Riveiro (@kavu)"
short_description: Notify Rollbar about app deployments short_description: Notify Rollbar about app deployments
description: description:
- Notify Rollbar about app deployments - Notify Rollbar about app deployments (see U(https://rollbar.com/docs/deploys_other/)).
(see https://rollbar.com/docs/deploys_other/)
extends_documentation_fragment: extends_documentation_fragment:
- community.general.attributes - community.general.attributes
attributes: attributes:
@ -33,7 +31,7 @@ options:
environment: environment:
type: str type: str
description: description:
- Name of the environment being deployed, e.g. 'production'. - Name of the environment being deployed, for example V(production).
required: true required: true
revision: revision:
type: str type: str
@ -53,7 +51,7 @@ options:
comment: comment:
type: str type: str
description: description:
- Deploy comment (e.g. what is being deployed). - Deploy comment (for example what is being deployed).
required: false required: false
url: url:
type: str type: str
@ -63,31 +61,30 @@ options:
default: 'https://api.rollbar.com/api/1/deploy/' default: 'https://api.rollbar.com/api/1/deploy/'
validate_certs: validate_certs:
description: description:
- If V(false), SSL certificates for the target url will not be validated. - If V(false), SSL certificates for the target url will not be validated. This should only be used on personally controlled sites using
This should only be used on personally controlled sites using
self-signed certificates. self-signed certificates.
required: false required: false
default: true default: true
type: bool type: bool
''' """
EXAMPLES = ''' EXAMPLES = r"""
- name: Rollbar deployment notification - name: Rollbar deployment notification
community.general.rollbar_deployment: community.general.rollbar_deployment:
token: AAAAAA token: AAAAAA
environment: staging environment: staging
user: ansible user: ansible
revision: '4.2' revision: '4.2'
rollbar_user: admin rollbar_user: admin
comment: Test Deploy comment: Test Deploy
- name: Notify rollbar about current git revision deployment by current user - name: Notify rollbar about current git revision deployment by current user
community.general.rollbar_deployment: community.general.rollbar_deployment:
token: "{{ rollbar_access_token }}" token: "{{ rollbar_access_token }}"
environment: production environment: production
revision: "{{ lookup('pipe', 'git rev-parse HEAD') }}" revision: "{{ lookup('pipe', 'git rev-parse HEAD') }}"
user: "{{ lookup('env', 'USER') }}" user: "{{ lookup('env', 'USER') }}"
''' """
import traceback import traceback
from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.basic import AnsibleModule

View File

@ -10,50 +10,49 @@ from __future__ import (absolute_import, division, print_function)
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = r''' DOCUMENTATION = r"""
---
module: rpm_ostree_pkg module: rpm_ostree_pkg
short_description: Install or uninstall overlay additional packages short_description: Install or uninstall overlay additional packages
version_added: "2.0.0" version_added: "2.0.0"
description: description:
- Install or uninstall overlay additional packages using C(rpm-ostree) command. - Install or uninstall overlay additional packages using C(rpm-ostree) command.
extends_documentation_fragment: extends_documentation_fragment:
- community.general.attributes - community.general.attributes
attributes: attributes:
check_mode: check_mode:
support: none support: none
diff_mode: diff_mode:
support: none support: none
options: options:
name: name:
description: description:
- Name of overlay package to install or remove. - Name of overlay package to install or remove.
required: true required: true
type: list type: list
elements: str elements: str
aliases: [ pkg ] aliases: [pkg]
state: state:
description: description:
- State of the overlay package. - State of the overlay package.
- V(present) simply ensures that a desired package is installed. - V(present) simply ensures that a desired package is installed.
- V(absent) removes the specified package. - V(absent) removes the specified package.
choices: [ 'absent', 'present' ] choices: ['absent', 'present']
default: 'present' default: 'present'
type: str type: str
apply_live: apply_live:
description: description:
- Adds the options C(--apply-live) when O(state=present). - Adds the options C(--apply-live) when O(state=present).
- Option is ignored when O(state=absent). - Option is ignored when O(state=absent).
- For more information, please see U(https://coreos.github.io/rpm-ostree/apply-live/). - For more information, please see U(https://coreos.github.io/rpm-ostree/apply-live/).
type: bool type: bool
default: false default: false
version_added: 10.1.0 version_added: 10.1.0
author: author:
- Dusty Mabe (@dustymabe) - Dusty Mabe (@dustymabe)
- Abhijeet Kasurde (@Akasurde) - Abhijeet Kasurde (@Akasurde)
''' """
EXAMPLES = r''' EXAMPLES = r"""
- name: Install overlay package - name: Install overlay package
community.general.rpm_ostree_pkg: community.general.rpm_ostree_pkg:
name: nfs-utils name: nfs-utils
@ -80,51 +79,51 @@ EXAMPLES = r'''
until: rpm_ostree_pkg is not failed until: rpm_ostree_pkg is not failed
retries: 10 retries: 10
dealy: 30 dealy: 30
''' """
RETURN = r''' RETURN = r"""
rc: rc:
description: Return code of rpm-ostree command. description: Return code of rpm-ostree command.
returned: always returned: always
type: int type: int
sample: 0 sample: 0
changed: changed:
description: State changes. description: State changes.
returned: always returned: always
type: bool type: bool
sample: true sample: true
action: action:
description: Action performed. description: Action performed.
returned: always returned: always
type: str type: str
sample: 'install' sample: 'install'
packages: packages:
description: A list of packages specified. description: A list of packages specified.
returned: always returned: always
type: list type: list
sample: ['nfs-utils'] sample: ['nfs-utils']
stdout: stdout:
description: Stdout of rpm-ostree command. description: Stdout of rpm-ostree command.
returned: always returned: always
type: str type: str
sample: 'Staging deployment...done\n...' sample: 'Staging deployment...done\n...'
stderr: stderr:
description: Stderr of rpm-ostree command. description: Stderr of rpm-ostree command.
returned: always returned: always
type: str type: str
sample: '' sample: ''
cmd: cmd:
description: Full command used for performed action. description: Full command used for performed action.
returned: always returned: always
type: str type: str
sample: 'rpm-ostree uninstall --allow-inactive --idempotent --unchanged-exit-77 nfs-utils' sample: 'rpm-ostree uninstall --allow-inactive --idempotent --unchanged-exit-77 nfs-utils'
needs_reboot: needs_reboot:
description: Determine if machine needs a reboot to apply current changes. description: Determine if machine needs a reboot to apply current changes.
returned: success returned: success
type: bool type: bool
sample: true sample: true
version_added: 10.1.0 version_added: 10.1.0
''' """
from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.basic import AnsibleModule

View File

@ -11,71 +11,70 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = r"""
---
module: rundeck_acl_policy module: rundeck_acl_policy
short_description: Manage Rundeck ACL policies short_description: Manage Rundeck ACL policies
description: description:
- Create, update and remove Rundeck ACL policies through HTTP API. - Create, update and remove Rundeck ACL policies through HTTP API.
author: "Loic Blot (@nerzhul)" author: "Loic Blot (@nerzhul)"
attributes: attributes:
check_mode: check_mode:
support: full support: full
diff_mode: diff_mode:
support: none support: none
options: options:
state: state:
type: str type: str
description: description:
- Create or remove Rundeck project. - Create or remove Rundeck project.
choices: ['present', 'absent'] choices: ['present', 'absent']
default: 'present' default: 'present'
name: name:
type: str type: str
description: description:
- Sets the project name. - Sets the project name.
required: true required: true
api_token: api_token:
description: description:
- Sets the token to authenticate against Rundeck API. - Sets the token to authenticate against Rundeck API.
aliases: ["token"] aliases: ["token"]
project: project:
type: str type: str
description: description:
- Sets the project which receive the ACL policy. - Sets the project which receive the ACL policy.
- If unset, it's a system ACL policy. - If unset, it's a system ACL policy.
policy: policy:
type: str type: str
description: description:
- Sets the ACL policy content. - Sets the ACL policy content.
- ACL policy content is a YAML object as described in http://rundeck.org/docs/man5/aclpolicy.html. - ACL policy content is a YAML object as described in U(http://rundeck.org/docs/man5/aclpolicy.html).
- It can be a YAML string or a pure Ansible inventory YAML object. - It can be a YAML string or a pure Ansible inventory YAML object.
client_cert: client_cert:
version_added: '0.2.0' version_added: '0.2.0'
client_key: client_key:
version_added: '0.2.0' version_added: '0.2.0'
force: force:
version_added: '0.2.0' version_added: '0.2.0'
force_basic_auth: force_basic_auth:
version_added: '0.2.0' version_added: '0.2.0'
http_agent: http_agent:
version_added: '0.2.0' version_added: '0.2.0'
url_password: url_password:
version_added: '0.2.0' version_added: '0.2.0'
url_username: url_username:
version_added: '0.2.0' version_added: '0.2.0'
use_proxy: use_proxy:
version_added: '0.2.0' version_added: '0.2.0'
validate_certs: validate_certs:
version_added: '0.2.0' version_added: '0.2.0'
extends_documentation_fragment: extends_documentation_fragment:
- ansible.builtin.url - ansible.builtin.url
- community.general.attributes - community.general.attributes
- community.general.rundeck - community.general.rundeck
''' """
EXAMPLES = ''' EXAMPLES = r"""
- name: Create or update a rundeck ACL policy in project Ansible - name: Create or update a rundeck ACL policy in project Ansible
community.general.rundeck_acl_policy: community.general.rundeck_acl_policy:
name: "Project_01" name: "Project_01"
@ -100,22 +99,22 @@ EXAMPLES = '''
url: "https://rundeck.example.org" url: "https://rundeck.example.org"
token: "mytoken" token: "mytoken"
state: absent state: absent
''' """
RETURN = ''' RETURN = r"""
rundeck_response: rundeck_response:
description: Rundeck response when a failure occurs. description: Rundeck response when a failure occurs.
returned: failed returned: failed
type: str type: str
before: before:
description: Dictionary containing ACL policy information before modification. description: Dictionary containing ACL policy information before modification.
returned: success returned: success
type: dict type: dict
after: after:
description: Dictionary containing ACL policy information after modification. description: Dictionary containing ACL policy information after modification.
returned: success returned: success
type: dict type: dict
''' """
# import module snippets # import module snippets
import re import re

View File

@ -9,43 +9,42 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = r"""
---
module: rundeck_job_executions_info module: rundeck_job_executions_info
short_description: Query executions for a Rundeck job short_description: Query executions for a Rundeck job
description: description:
- This module gets the list of executions for a specified Rundeck job. - This module gets the list of executions for a specified Rundeck job.
author: "Phillipe Smith (@phsmith)" author: "Phillipe Smith (@phsmith)"
version_added: 3.8.0 version_added: 3.8.0
options: options:
job_id: job_id:
type: str type: str
description: description:
- The job unique ID. - The job unique ID.
required: true required: true
status: status:
type: str type: str
description: description:
- The job status to filter. - The job status to filter.
choices: [succeeded, failed, aborted, running] choices: [succeeded, failed, aborted, running]
max: max:
type: int type: int
description: description:
- Max results to return. - Max results to return.
default: 20 default: 20
offset: offset:
type: int type: int
description: description:
- The start point to return the results. - The start point to return the results.
default: 0 default: 0
extends_documentation_fragment: extends_documentation_fragment:
- community.general.rundeck - community.general.rundeck
- url - url
- community.general.attributes - community.general.attributes
- community.general.attributes.info_module - community.general.attributes.info_module
''' """
EXAMPLES = ''' EXAMPLES = r"""
- name: Get Rundeck job executions info - name: Get Rundeck job executions info
community.general.rundeck_job_executions_info: community.general.rundeck_job_executions_info:
url: "https://rundeck.example.org" url: "https://rundeck.example.org"
@ -57,36 +56,31 @@ EXAMPLES = '''
- name: Show Rundeck job executions info - name: Show Rundeck job executions info
ansible.builtin.debug: ansible.builtin.debug:
var: rundeck_job_executions_info.executions var: rundeck_job_executions_info.executions
''' """
RETURN = ''' RETURN = r"""
paging: paging:
description: Results pagination info. description: Results pagination info.
returned: success returned: success
type: dict type: dict
contains: contains:
count: count:
description: Number of results in the response. description: Number of results in the response.
type: int type: int
returned: success returned: success
total: total:
description: Total number of results. description: Total number of results.
type: int type: int
returned: success returned: success
offset: offset:
description: Offset from first of all results. description: Offset from first of all results.
type: int type: int
returned: success returned: success
max: max:
description: Maximum number of results per page. description: Maximum number of results per page.
type: int type: int
returned: success returned: success
sample: { sample: {"count": 20, "total": 100, "offset": 0, "max": 20}
"count": 20,
"total": 100,
"offset": 0,
"max": 20
}
executions: executions:
description: Job executions list. description: Job executions list.
returned: always returned: always
@ -127,7 +121,7 @@ executions:
"serverUUID": "5b9a1438-fa3a-457e-b254-8f3d70338068" "serverUUID": "5b9a1438-fa3a-457e-b254-8f3d70338068"
} }
] ]
''' """
from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.six.moves.urllib.parse import quote from ansible.module_utils.six.moves.urllib.parse import quote

View File

@ -9,75 +9,74 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = r"""
---
module: rundeck_job_run module: rundeck_job_run
short_description: Run a Rundeck job short_description: Run a Rundeck job
description: description:
- This module runs a Rundeck job specified by ID. - This module runs a Rundeck job specified by ID.
author: "Phillipe Smith (@phsmith)" author: "Phillipe Smith (@phsmith)"
version_added: 3.8.0 version_added: 3.8.0
attributes: attributes:
check_mode: check_mode:
support: none support: none
diff_mode: diff_mode:
support: none support: none
options: options:
job_id: job_id:
type: str type: str
description: description:
- The job unique ID. - The job unique ID.
required: true required: true
job_options: job_options:
type: dict type: dict
description: description:
- The job options for the steps. - The job options for the steps.
- Numeric values must be quoted. - Numeric values must be quoted.
filter_nodes: filter_nodes:
type: str type: str
description: description:
- Filter the nodes where the jobs must run. - Filter the nodes where the jobs must run.
- See U(https://docs.rundeck.com/docs/manual/11-node-filters.html#node-filter-syntax). - See U(https://docs.rundeck.com/docs/manual/11-node-filters.html#node-filter-syntax).
run_at_time: run_at_time:
type: str type: str
description: description:
- Schedule the job execution to run at specific date and time. - Schedule the job execution to run at specific date and time.
- ISO-8601 date and time format like V(2021-10-05T15:45:00-03:00). - ISO-8601 date and time format like V(2021-10-05T15:45:00-03:00).
loglevel: loglevel:
type: str type: str
description: description:
- Log level configuration. - Log level configuration.
choices: [debug, verbose, info, warn, error] choices: [debug, verbose, info, warn, error]
default: info default: info
wait_execution: wait_execution:
type: bool type: bool
description: description:
- Wait until the job finished the execution. - Wait until the job finished the execution.
default: true default: true
wait_execution_delay: wait_execution_delay:
type: int type: int
description: description:
- Delay, in seconds, between job execution status check requests. - Delay, in seconds, between job execution status check requests.
default: 5 default: 5
wait_execution_timeout: wait_execution_timeout:
type: int type: int
description: description:
- Job execution wait timeout in seconds. - Job execution wait timeout in seconds.
- If the timeout is reached, the job will be aborted. - If the timeout is reached, the job will be aborted.
- Keep in mind that there is a sleep based on O(wait_execution_delay) after each job status check. - Keep in mind that there is a sleep based on O(wait_execution_delay) after each job status check.
default: 120 default: 120
abort_on_timeout: abort_on_timeout:
type: bool type: bool
description: description:
- Send a job abort request if exceeded the O(wait_execution_timeout) specified. - Send a job abort request if exceeded the O(wait_execution_timeout) specified.
default: false default: false
extends_documentation_fragment: extends_documentation_fragment:
- community.general.rundeck - community.general.rundeck
- ansible.builtin.url - ansible.builtin.url
- community.general.attributes - community.general.attributes
''' """
EXAMPLES = ''' EXAMPLES = r"""
- name: Run a Rundeck job - name: Run a Rundeck job
community.general.rundeck_job_run: community.general.rundeck_job_run:
url: "https://rundeck.example.org" url: "https://rundeck.example.org"
@ -97,9 +96,9 @@ EXAMPLES = '''
api_token: "mytoken" api_token: "mytoken"
job_id: "xxxxxxxxxxxxxxxxx" job_id: "xxxxxxxxxxxxxxxxx"
job_options: job_options:
option_1: "value_1" option_1: "value_1"
option_2: "value_3" option_2: "value_3"
option_3: "value_3" option_3: "value_3"
register: rundeck_job_run register: rundeck_job_run
- name: Run a Rundeck job with timeout, delay between status check and abort on timeout - name: Run a Rundeck job with timeout, delay between status check and abort on timeout
@ -130,9 +129,9 @@ EXAMPLES = '''
job_id: "xxxxxxxxxxxxxxxxx" job_id: "xxxxxxxxxxxxxxxxx"
wait_execution: false wait_execution: false
register: rundeck_job_run register: rundeck_job_run
''' """
RETURN = ''' RETURN = r"""
execution_info: execution_info:
description: Rundeck job execution metadata. description: Rundeck job execution metadata.
returned: always returned: always
@ -177,7 +176,7 @@ execution_info:
"output": "Test!" "output": "Test!"
} }
} }
''' """
# Modules import # Modules import
from datetime import datetime, timedelta from datetime import datetime, timedelta

View File

@ -13,60 +13,59 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = r"""
---
module: rundeck_project module: rundeck_project
short_description: Manage Rundeck projects short_description: Manage Rundeck projects
description: description:
- Create and remove Rundeck projects through HTTP API. - Create and remove Rundeck projects through HTTP API.
author: "Loic Blot (@nerzhul)" author: "Loic Blot (@nerzhul)"
attributes: attributes:
check_mode: check_mode:
support: full support: full
diff_mode: diff_mode:
support: none support: none
options: options:
state: state:
type: str type: str
description: description:
- Create or remove Rundeck project. - Create or remove Rundeck project.
choices: ['present', 'absent'] choices: ['present', 'absent']
default: 'present' default: 'present'
name: name:
type: str type: str
description: description:
- Sets the project name. - Sets the project name.
required: true required: true
api_token: api_token:
description: description:
- Sets the token to authenticate against Rundeck API. - Sets the token to authenticate against Rundeck API.
aliases: ["token"] aliases: ["token"]
client_cert: client_cert:
version_added: '0.2.0' version_added: '0.2.0'
client_key: client_key:
version_added: '0.2.0' version_added: '0.2.0'
force: force:
version_added: '0.2.0' version_added: '0.2.0'
force_basic_auth: force_basic_auth:
version_added: '0.2.0' version_added: '0.2.0'
http_agent: http_agent:
version_added: '0.2.0' version_added: '0.2.0'
url_password: url_password:
version_added: '0.2.0' version_added: '0.2.0'
url_username: url_username:
version_added: '0.2.0' version_added: '0.2.0'
use_proxy: use_proxy:
version_added: '0.2.0' version_added: '0.2.0'
validate_certs: validate_certs:
version_added: '0.2.0' version_added: '0.2.0'
extends_documentation_fragment: extends_documentation_fragment:
- ansible.builtin.url - ansible.builtin.url
- community.general.attributes - community.general.attributes
- community.general.rundeck - community.general.rundeck
''' """
EXAMPLES = ''' EXAMPLES = r"""
- name: Create a rundeck project - name: Create a rundeck project
community.general.rundeck_project: community.general.rundeck_project:
name: "Project_01" name: "Project_01"
@ -83,22 +82,22 @@ EXAMPLES = '''
url: "https://rundeck.example.org" url: "https://rundeck.example.org"
api_token: "mytoken" api_token: "mytoken"
state: absent state: absent
''' """
RETURN = ''' RETURN = r"""
rundeck_response: rundeck_response:
description: Rundeck response when a failure occurs description: Rundeck response when a failure occurs.
returned: failed returned: failed
type: str type: str
before: before:
description: dictionary containing project information before modification description: Dictionary containing project information before modification.
returned: success returned: success
type: dict type: dict
after: after:
description: dictionary containing project information after modification description: Dictionary containing project information after modification.
returned: success returned: success
type: dict type: dict
''' """
# import module snippets # import module snippets
from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.basic import AnsibleModule

View File

@ -8,54 +8,50 @@
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: runit module: runit
author: author:
- James Sumners (@jsumners) - James Sumners (@jsumners)
short_description: Manage runit services short_description: Manage runit services
description: description:
- Controls runit services on remote hosts using the sv utility. - Controls runit services on remote hosts using the sv utility.
extends_documentation_fragment: extends_documentation_fragment:
- community.general.attributes - community.general.attributes
attributes: attributes:
check_mode: check_mode:
support: full support: full
diff_mode: diff_mode:
support: none support: none
options: options:
name: name:
description: description:
- Name of the service to manage. - Name of the service to manage.
type: str type: str
required: true required: true
state: state:
description: description:
- V(started)/V(stopped) are idempotent actions that will not run - V(started)/V(stopped) are idempotent actions that will not run commands unless necessary. V(restarted) will always bounce the service
commands unless necessary. V(restarted) will always bounce the (sv restart) and V(killed) will always bounce the service (sv force-stop). V(reloaded) will send a HUP (sv reload). V(once) will run a
service (sv restart) and V(killed) will always bounce the service (sv force-stop). normally downed sv once (sv once), not really an idempotent operation.
V(reloaded) will send a HUP (sv reload). type: str
V(once) will run a normally downed sv once (sv once), not really choices: [killed, once, reloaded, restarted, started, stopped]
an idempotent operation. enabled:
type: str description:
choices: [ killed, once, reloaded, restarted, started, stopped ] - Whether the service is enabled or not, if disabled it also implies stopped.
enabled: type: bool
description: service_dir:
- Whether the service is enabled or not, if disabled it also implies stopped. description:
type: bool - Directory runsv watches for services.
service_dir: type: str
description: default: /var/service
- directory runsv watches for services service_src:
type: str description:
default: /var/service - Directory where services are defined, the source of symlinks to O(service_dir).
service_src: type: str
description: default: /etc/sv
- directory where services are defined, the source of symlinks to service_dir. """
type: str
default: /etc/sv
'''
EXAMPLES = r''' EXAMPLES = r"""
- name: Start sv dnscache, if not running - name: Start sv dnscache, if not running
community.general.runit: community.general.runit:
name: dnscache name: dnscache
@ -86,7 +82,7 @@ EXAMPLES = r'''
name: dnscache name: dnscache
state: reloaded state: reloaded
service_dir: /run/service service_dir: /run/service
''' """
import os import os
import re import re