mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-26 04:11:25 -07:00
[PR #9354/97514612 backport][stable-10] r*: normalize docs (#9377)
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>
(cherry picked from commit 9751461295
)
Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
This commit is contained in:
parent
899fcb8749
commit
f6fa7fb273
22 changed files with 1858 additions and 1947 deletions
|
@ -8,13 +8,11 @@
|
|||
from __future__ import absolute_import, division, print_function
|
||||
__metaclass__ = type
|
||||
|
||||
DOCUMENTATION = '''
|
||||
---
|
||||
DOCUMENTATION = r"""
|
||||
module: redfish_config
|
||||
short_description: Manages Out-Of-Band controllers using Redfish APIs
|
||||
description:
|
||||
- Builds Redfish URIs locally and sends them to remote OOB controllers to
|
||||
set or update a configuration attribute.
|
||||
- Builds Redfish URIs locally and sends them to remote OOB controllers to set or update a configuration attribute.
|
||||
- Manages BIOS configuration settings.
|
||||
- Manages OOB controller configuration settings.
|
||||
extends_documentation_fragment:
|
||||
|
@ -64,8 +62,7 @@ options:
|
|||
timeout:
|
||||
description:
|
||||
- Timeout in seconds for HTTP requests to OOB controller.
|
||||
- The default value for this parameter changed from V(10) to V(60)
|
||||
in community.general 9.0.0.
|
||||
- The default value for this parameter changed from V(10) to V(60) in community.general 9.0.0.
|
||||
type: int
|
||||
default: 60
|
||||
boot_order:
|
||||
|
@ -111,10 +108,8 @@ options:
|
|||
version_added: '0.2.0'
|
||||
strip_etag_quotes:
|
||||
description:
|
||||
- Removes surrounding quotes of etag used in C(If-Match) header
|
||||
of C(PATCH) requests.
|
||||
- Only use this option to resolve bad vendor implementation where
|
||||
C(If-Match) only matches the unquoted etag string.
|
||||
- Removes surrounding quotes of etag used in C(If-Match) header of C(PATCH) requests.
|
||||
- Only use this option to resolve bad vendor implementation where C(If-Match) only matches the unquoted etag string.
|
||||
type: bool
|
||||
default: false
|
||||
version_added: 3.7.0
|
||||
|
@ -165,15 +160,14 @@ options:
|
|||
description:
|
||||
- Setting parameter to enable or disable SecureBoot.
|
||||
type: bool
|
||||
default: True
|
||||
default: true
|
||||
version_added: '7.5.0'
|
||||
volume_details:
|
||||
required: false
|
||||
description:
|
||||
- Setting dict of volume to be created.
|
||||
- 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
|
||||
size will not be the maximum available size.
|
||||
- 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 size will not be the maximum available size.
|
||||
type: dict
|
||||
default: {}
|
||||
version_added: '7.5.0'
|
||||
|
@ -181,9 +175,8 @@ options:
|
|||
required: false
|
||||
description:
|
||||
- SSL/TLS Ciphers to use for the request.
|
||||
- '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)
|
||||
for more details.
|
||||
- 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) for more details.
|
||||
- The available ciphers is dependent on the Python and OpenSSL/LibreSSL versions.
|
||||
type: list
|
||||
elements: str
|
||||
|
@ -192,195 +185,195 @@ options:
|
|||
author:
|
||||
- "Jose Delarosa (@jose-delarosa)"
|
||||
- "T S Kushal (@TSKushal)"
|
||||
'''
|
||||
"""
|
||||
|
||||
EXAMPLES = '''
|
||||
- name: Set BootMode to UEFI
|
||||
community.general.redfish_config:
|
||||
category: Systems
|
||||
command: SetBiosAttributes
|
||||
resource_id: 437XR1138R2
|
||||
bios_attributes:
|
||||
BootMode: "Uefi"
|
||||
baseuri: "{{ baseuri }}"
|
||||
username: "{{ username }}"
|
||||
password: "{{ password }}"
|
||||
EXAMPLES = r"""
|
||||
- name: Set BootMode to UEFI
|
||||
community.general.redfish_config:
|
||||
category: Systems
|
||||
command: SetBiosAttributes
|
||||
resource_id: 437XR1138R2
|
||||
bios_attributes:
|
||||
BootMode: "Uefi"
|
||||
baseuri: "{{ baseuri }}"
|
||||
username: "{{ username }}"
|
||||
password: "{{ password }}"
|
||||
|
||||
- name: Set multiple BootMode attributes
|
||||
community.general.redfish_config:
|
||||
category: Systems
|
||||
command: SetBiosAttributes
|
||||
resource_id: 437XR1138R2
|
||||
bios_attributes:
|
||||
BootMode: "Bios"
|
||||
OneTimeBootMode: "Enabled"
|
||||
BootSeqRetry: "Enabled"
|
||||
baseuri: "{{ baseuri }}"
|
||||
username: "{{ username }}"
|
||||
password: "{{ password }}"
|
||||
- name: Set multiple BootMode attributes
|
||||
community.general.redfish_config:
|
||||
category: Systems
|
||||
command: SetBiosAttributes
|
||||
resource_id: 437XR1138R2
|
||||
bios_attributes:
|
||||
BootMode: "Bios"
|
||||
OneTimeBootMode: "Enabled"
|
||||
BootSeqRetry: "Enabled"
|
||||
baseuri: "{{ baseuri }}"
|
||||
username: "{{ username }}"
|
||||
password: "{{ password }}"
|
||||
|
||||
- name: Enable PXE Boot for NIC1
|
||||
community.general.redfish_config:
|
||||
category: Systems
|
||||
command: SetBiosAttributes
|
||||
resource_id: 437XR1138R2
|
||||
bios_attributes:
|
||||
PxeDev1EnDis: Enabled
|
||||
baseuri: "{{ baseuri }}"
|
||||
username: "{{ username }}"
|
||||
password: "{{ password }}"
|
||||
- name: Enable PXE Boot for NIC1
|
||||
community.general.redfish_config:
|
||||
category: Systems
|
||||
command: SetBiosAttributes
|
||||
resource_id: 437XR1138R2
|
||||
bios_attributes:
|
||||
PxeDev1EnDis: Enabled
|
||||
baseuri: "{{ baseuri }}"
|
||||
username: "{{ username }}"
|
||||
password: "{{ password }}"
|
||||
|
||||
- name: Set BIOS default settings with a timeout of 20 seconds
|
||||
community.general.redfish_config:
|
||||
category: Systems
|
||||
command: SetBiosDefaultSettings
|
||||
resource_id: 437XR1138R2
|
||||
baseuri: "{{ baseuri }}"
|
||||
username: "{{ username }}"
|
||||
password: "{{ password }}"
|
||||
timeout: 20
|
||||
- name: Set BIOS default settings with a timeout of 20 seconds
|
||||
community.general.redfish_config:
|
||||
category: Systems
|
||||
command: SetBiosDefaultSettings
|
||||
resource_id: 437XR1138R2
|
||||
baseuri: "{{ baseuri }}"
|
||||
username: "{{ username }}"
|
||||
password: "{{ password }}"
|
||||
timeout: 20
|
||||
|
||||
- name: Set boot order
|
||||
community.general.redfish_config:
|
||||
category: Systems
|
||||
command: SetBootOrder
|
||||
boot_order:
|
||||
- Boot0002
|
||||
- Boot0001
|
||||
- Boot0000
|
||||
- Boot0003
|
||||
- Boot0004
|
||||
baseuri: "{{ baseuri }}"
|
||||
username: "{{ username }}"
|
||||
password: "{{ password }}"
|
||||
- name: Set boot order
|
||||
community.general.redfish_config:
|
||||
category: Systems
|
||||
command: SetBootOrder
|
||||
boot_order:
|
||||
- Boot0002
|
||||
- Boot0001
|
||||
- Boot0000
|
||||
- Boot0003
|
||||
- Boot0004
|
||||
baseuri: "{{ baseuri }}"
|
||||
username: "{{ username }}"
|
||||
password: "{{ password }}"
|
||||
|
||||
- name: Set boot order to the default
|
||||
community.general.redfish_config:
|
||||
category: Systems
|
||||
command: SetDefaultBootOrder
|
||||
baseuri: "{{ baseuri }}"
|
||||
username: "{{ username }}"
|
||||
password: "{{ password }}"
|
||||
- name: Set boot order to the default
|
||||
community.general.redfish_config:
|
||||
category: Systems
|
||||
command: SetDefaultBootOrder
|
||||
baseuri: "{{ baseuri }}"
|
||||
username: "{{ username }}"
|
||||
password: "{{ password }}"
|
||||
|
||||
- name: Set Manager Network Protocols
|
||||
community.general.redfish_config:
|
||||
category: Manager
|
||||
command: SetNetworkProtocols
|
||||
network_protocols:
|
||||
SNMP:
|
||||
ProtocolEnabled: true
|
||||
Port: 161
|
||||
HTTP:
|
||||
ProtocolEnabled: false
|
||||
Port: 8080
|
||||
baseuri: "{{ baseuri }}"
|
||||
username: "{{ username }}"
|
||||
password: "{{ password }}"
|
||||
- name: Set Manager Network Protocols
|
||||
community.general.redfish_config:
|
||||
category: Manager
|
||||
command: SetNetworkProtocols
|
||||
network_protocols:
|
||||
SNMP:
|
||||
ProtocolEnabled: true
|
||||
Port: 161
|
||||
HTTP:
|
||||
ProtocolEnabled: false
|
||||
Port: 8080
|
||||
baseuri: "{{ baseuri }}"
|
||||
username: "{{ username }}"
|
||||
password: "{{ password }}"
|
||||
|
||||
- name: Set Manager NIC
|
||||
community.general.redfish_config:
|
||||
category: Manager
|
||||
command: SetManagerNic
|
||||
nic_config:
|
||||
DHCPv4:
|
||||
DHCPEnabled: false
|
||||
IPv4StaticAddresses:
|
||||
Address: 192.168.1.3
|
||||
Gateway: 192.168.1.1
|
||||
SubnetMask: 255.255.255.0
|
||||
baseuri: "{{ baseuri }}"
|
||||
username: "{{ username }}"
|
||||
password: "{{ password }}"
|
||||
- name: Set Manager NIC
|
||||
community.general.redfish_config:
|
||||
category: Manager
|
||||
command: SetManagerNic
|
||||
nic_config:
|
||||
DHCPv4:
|
||||
DHCPEnabled: false
|
||||
IPv4StaticAddresses:
|
||||
Address: 192.168.1.3
|
||||
Gateway: 192.168.1.1
|
||||
SubnetMask: 255.255.255.0
|
||||
baseuri: "{{ baseuri }}"
|
||||
username: "{{ username }}"
|
||||
password: "{{ password }}"
|
||||
|
||||
- name: Disable Host Interface
|
||||
community.general.redfish_config:
|
||||
category: Manager
|
||||
command: SetHostInterface
|
||||
hostinterface_config:
|
||||
InterfaceEnabled: false
|
||||
baseuri: "{{ baseuri }}"
|
||||
username: "{{ username }}"
|
||||
password: "{{ password }}"
|
||||
- name: Disable Host Interface
|
||||
community.general.redfish_config:
|
||||
category: Manager
|
||||
command: SetHostInterface
|
||||
hostinterface_config:
|
||||
InterfaceEnabled: false
|
||||
baseuri: "{{ baseuri }}"
|
||||
username: "{{ username }}"
|
||||
password: "{{ password }}"
|
||||
|
||||
- name: Enable Host Interface for HostInterface resource ID '2'
|
||||
community.general.redfish_config:
|
||||
category: Manager
|
||||
command: SetHostInterface
|
||||
hostinterface_config:
|
||||
InterfaceEnabled: true
|
||||
hostinterface_id: "2"
|
||||
baseuri: "{{ baseuri }}"
|
||||
username: "{{ username }}"
|
||||
password: "{{ password }}"
|
||||
- name: Enable Host Interface for HostInterface resource ID '2'
|
||||
community.general.redfish_config:
|
||||
category: Manager
|
||||
command: SetHostInterface
|
||||
hostinterface_config:
|
||||
InterfaceEnabled: true
|
||||
hostinterface_id: "2"
|
||||
baseuri: "{{ baseuri }}"
|
||||
username: "{{ username }}"
|
||||
password: "{{ password }}"
|
||||
|
||||
- name: Set SessionService Session Timeout to 30 minutes
|
||||
community.general.redfish_config:
|
||||
category: Sessions
|
||||
command: SetSessionService
|
||||
sessions_config:
|
||||
SessionTimeout: 1800
|
||||
baseuri: "{{ baseuri }}"
|
||||
username: "{{ username }}"
|
||||
password: "{{ password }}"
|
||||
- name: Set SessionService Session Timeout to 30 minutes
|
||||
community.general.redfish_config:
|
||||
category: Sessions
|
||||
command: SetSessionService
|
||||
sessions_config:
|
||||
SessionTimeout: 1800
|
||||
baseuri: "{{ baseuri }}"
|
||||
username: "{{ username }}"
|
||||
password: "{{ password }}"
|
||||
|
||||
- name: Enable SecureBoot
|
||||
community.general.redfish_config:
|
||||
category: Systems
|
||||
command: EnableSecureBoot
|
||||
baseuri: "{{ baseuri }}"
|
||||
username: "{{ username }}"
|
||||
password: "{{ password }}"
|
||||
- name: Enable SecureBoot
|
||||
community.general.redfish_config:
|
||||
category: Systems
|
||||
command: EnableSecureBoot
|
||||
baseuri: "{{ baseuri }}"
|
||||
username: "{{ username }}"
|
||||
password: "{{ password }}"
|
||||
|
||||
- name: Set SecureBoot
|
||||
community.general.redfish_config:
|
||||
category: Systems
|
||||
command: SetSecureBoot
|
||||
baseuri: "{{ baseuri }}"
|
||||
username: "{{ username }}"
|
||||
password: "{{ password }}"
|
||||
secure_boot_enable: True
|
||||
- name: Set SecureBoot
|
||||
community.general.redfish_config:
|
||||
category: Systems
|
||||
command: SetSecureBoot
|
||||
baseuri: "{{ baseuri }}"
|
||||
username: "{{ username }}"
|
||||
password: "{{ password }}"
|
||||
secure_boot_enable: true
|
||||
|
||||
- name: Delete All Volumes
|
||||
community.general.redfish_config:
|
||||
category: Systems
|
||||
command: DeleteVolumes
|
||||
baseuri: "{{ baseuri }}"
|
||||
username: "{{ username }}"
|
||||
password: "{{ password }}"
|
||||
storage_subsystem_id: "DExxxxxx"
|
||||
volume_ids: ["volume1", "volume2"]
|
||||
- name: Delete All Volumes
|
||||
community.general.redfish_config:
|
||||
category: Systems
|
||||
command: DeleteVolumes
|
||||
baseuri: "{{ baseuri }}"
|
||||
username: "{{ username }}"
|
||||
password: "{{ password }}"
|
||||
storage_subsystem_id: "DExxxxxx"
|
||||
volume_ids: ["volume1", "volume2"]
|
||||
|
||||
- name: Create Volume
|
||||
community.general.redfish_config:
|
||||
category: Systems
|
||||
command: CreateVolume
|
||||
baseuri: "{{ baseuri }}"
|
||||
username: "{{ username }}"
|
||||
password: "{{ password }}"
|
||||
storage_subsystem_id: "DExxxxxx"
|
||||
volume_details:
|
||||
Name: "MR Volume"
|
||||
RAIDType: "RAID0"
|
||||
Drives:
|
||||
- "/redfish/v1/Systems/1/Storage/DE00B000/Drives/1"
|
||||
- name: Create Volume
|
||||
community.general.redfish_config:
|
||||
category: Systems
|
||||
command: CreateVolume
|
||||
baseuri: "{{ baseuri }}"
|
||||
username: "{{ username }}"
|
||||
password: "{{ password }}"
|
||||
storage_subsystem_id: "DExxxxxx"
|
||||
volume_details:
|
||||
Name: "MR Volume"
|
||||
RAIDType: "RAID0"
|
||||
Drives:
|
||||
- "/redfish/v1/Systems/1/Storage/DE00B000/Drives/1"
|
||||
|
||||
- name: Set service identification to {{ service_id }}
|
||||
community.general.redfish_config:
|
||||
category: Manager
|
||||
command: SetServiceIdentification
|
||||
service_id: "{{ service_id }}"
|
||||
baseuri: "{{ baseuri }}"
|
||||
username: "{{ username }}"
|
||||
password: "{{ password }}"
|
||||
'''
|
||||
- name: Set service identification to {{ service_id }}
|
||||
community.general.redfish_config:
|
||||
category: Manager
|
||||
command: SetServiceIdentification
|
||||
service_id: "{{ service_id }}"
|
||||
baseuri: "{{ baseuri }}"
|
||||
username: "{{ username }}"
|
||||
password: "{{ password }}"
|
||||
"""
|
||||
|
||||
RETURN = '''
|
||||
RETURN = r"""
|
||||
msg:
|
||||
description: Message with action result or error description
|
||||
returned: always
|
||||
type: str
|
||||
sample: "Action was successful"
|
||||
'''
|
||||
description: Message with action result or error description.
|
||||
returned: always
|
||||
type: str
|
||||
sample: "Action was successful"
|
||||
"""
|
||||
|
||||
from ansible.module_utils.basic import AnsibleModule
|
||||
from ansible_collections.community.general.plugins.module_utils.redfish_utils import RedfishUtils
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue