mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-25 11:51:26 -07:00
[PR #9308/f9bfe4e4 backport][stable-10] x*: adjust docs (#9342)
x*: adjust docs (#9308)
* adjust docs
* Update plugins/modules/xml.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* fix capitalisation
* add markup to references of the xe command (xenserver)
* add missing markup
* Update plugins/modules/xml.py
Co-authored-by: Felix Fontein <felix@fontein.de>
---------
Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit f9bfe4e4a6
)
Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
This commit is contained in:
parent
434032080e
commit
474c7a7240
11 changed files with 827 additions and 863 deletions
|
@ -8,14 +8,13 @@
|
|||
from __future__ import absolute_import, division, print_function
|
||||
__metaclass__ = type
|
||||
|
||||
DOCUMENTATION = '''
|
||||
---
|
||||
DOCUMENTATION = r"""
|
||||
module: xcc_redfish_command
|
||||
short_description: Manages Lenovo Out-Of-Band controllers using Redfish APIs
|
||||
version_added: 2.4.0
|
||||
description:
|
||||
- Builds Redfish URIs locally and sends them to remote OOB controllers to
|
||||
perform an action or get information back or update a configuration attribute.
|
||||
- Builds Redfish URIs locally and sends them to remote OOB controllers to perform an action or get information back or update a configuration
|
||||
attribute.
|
||||
- Manages virtual media.
|
||||
- Supports getting information back via GET method.
|
||||
- Supports updating a configuration attribute via PATCH method.
|
||||
|
@ -54,7 +53,7 @@ options:
|
|||
type: str
|
||||
auth_token:
|
||||
description:
|
||||
- Security token for authentication with OOB controller
|
||||
- Security token for authentication with OOB controller.
|
||||
type: str
|
||||
timeout:
|
||||
description:
|
||||
|
@ -120,181 +119,181 @@ options:
|
|||
type: dict
|
||||
|
||||
author: "Yuyan Pan (@panyy3)"
|
||||
'''
|
||||
"""
|
||||
|
||||
EXAMPLES = '''
|
||||
- name: Insert Virtual Media
|
||||
community.general.xcc_redfish_command:
|
||||
category: Manager
|
||||
command: VirtualMediaInsert
|
||||
baseuri: "{{ baseuri }}"
|
||||
username: "{{ username }}"
|
||||
password: "{{ password }}"
|
||||
virtual_media:
|
||||
image_url: "http://example.com/images/SomeLinux-current.iso"
|
||||
media_types:
|
||||
- CD
|
||||
- DVD
|
||||
resource_id: "1"
|
||||
EXAMPLES = r"""
|
||||
- name: Insert Virtual Media
|
||||
community.general.xcc_redfish_command:
|
||||
category: Manager
|
||||
command: VirtualMediaInsert
|
||||
baseuri: "{{ baseuri }}"
|
||||
username: "{{ username }}"
|
||||
password: "{{ password }}"
|
||||
virtual_media:
|
||||
image_url: "http://example.com/images/SomeLinux-current.iso"
|
||||
media_types:
|
||||
- CD
|
||||
- DVD
|
||||
resource_id: "1"
|
||||
|
||||
- name: Eject Virtual Media
|
||||
community.general.xcc_redfish_command:
|
||||
category: Manager
|
||||
command: VirtualMediaEject
|
||||
baseuri: "{{ baseuri }}"
|
||||
username: "{{ username }}"
|
||||
password: "{{ password }}"
|
||||
virtual_media:
|
||||
image_url: "http://example.com/images/SomeLinux-current.iso"
|
||||
resource_id: "1"
|
||||
- name: Eject Virtual Media
|
||||
community.general.xcc_redfish_command:
|
||||
category: Manager
|
||||
command: VirtualMediaEject
|
||||
baseuri: "{{ baseuri }}"
|
||||
username: "{{ username }}"
|
||||
password: "{{ password }}"
|
||||
virtual_media:
|
||||
image_url: "http://example.com/images/SomeLinux-current.iso"
|
||||
resource_id: "1"
|
||||
|
||||
- name: Eject all Virtual Media
|
||||
community.general.xcc_redfish_command:
|
||||
category: Manager
|
||||
command: VirtualMediaEject
|
||||
baseuri: "{{ baseuri }}"
|
||||
username: "{{ username }}"
|
||||
password: "{{ password }}"
|
||||
resource_id: "1"
|
||||
- name: Eject all Virtual Media
|
||||
community.general.xcc_redfish_command:
|
||||
category: Manager
|
||||
command: VirtualMediaEject
|
||||
baseuri: "{{ baseuri }}"
|
||||
username: "{{ username }}"
|
||||
password: "{{ password }}"
|
||||
resource_id: "1"
|
||||
|
||||
- name: Get ComputeSystem Oem property SystemStatus via GetResource command
|
||||
community.general.xcc_redfish_command:
|
||||
category: Raw
|
||||
command: GetResource
|
||||
baseuri: "{{ baseuri }}"
|
||||
username: "{{ username }}"
|
||||
password: "{{ password }}"
|
||||
resource_uri: "/redfish/v1/Systems/1"
|
||||
register: result
|
||||
- ansible.builtin.debug:
|
||||
msg: "{{ result.redfish_facts.data.Oem.Lenovo.SystemStatus }}"
|
||||
- name: Get ComputeSystem Oem property SystemStatus via GetResource command
|
||||
community.general.xcc_redfish_command:
|
||||
category: Raw
|
||||
command: GetResource
|
||||
baseuri: "{{ baseuri }}"
|
||||
username: "{{ username }}"
|
||||
password: "{{ password }}"
|
||||
resource_uri: "/redfish/v1/Systems/1"
|
||||
register: result
|
||||
- ansible.builtin.debug:
|
||||
msg: "{{ result.redfish_facts.data.Oem.Lenovo.SystemStatus }}"
|
||||
|
||||
- name: Get Oem DNS setting via GetResource command
|
||||
community.general.xcc_redfish_command:
|
||||
category: Raw
|
||||
command: GetResource
|
||||
baseuri: "{{ baseuri }}"
|
||||
username: "{{ username }}"
|
||||
password: "{{ password }}"
|
||||
resource_uri: "/redfish/v1/Managers/1/NetworkProtocol/Oem/Lenovo/DNS"
|
||||
register: result
|
||||
- name: Get Oem DNS setting via GetResource command
|
||||
community.general.xcc_redfish_command:
|
||||
category: Raw
|
||||
command: GetResource
|
||||
baseuri: "{{ baseuri }}"
|
||||
username: "{{ username }}"
|
||||
password: "{{ password }}"
|
||||
resource_uri: "/redfish/v1/Managers/1/NetworkProtocol/Oem/Lenovo/DNS"
|
||||
register: result
|
||||
|
||||
- name: Print fetched information
|
||||
ansible.builtin.debug:
|
||||
msg: "{{ result.redfish_facts.data }}"
|
||||
- name: Print fetched information
|
||||
ansible.builtin.debug:
|
||||
msg: "{{ result.redfish_facts.data }}"
|
||||
|
||||
- name: Get Lenovo FoD key collection resource via GetCollectionResource command
|
||||
community.general.xcc_redfish_command:
|
||||
category: Raw
|
||||
command: GetCollectionResource
|
||||
baseuri: "{{ baseuri }}"
|
||||
username: "{{ username }}"
|
||||
password: "{{ password }}"
|
||||
resource_uri: "/redfish/v1/Managers/1/Oem/Lenovo/FoD/Keys"
|
||||
register: result
|
||||
- name: Get Lenovo FoD key collection resource via GetCollectionResource command
|
||||
community.general.xcc_redfish_command:
|
||||
category: Raw
|
||||
command: GetCollectionResource
|
||||
baseuri: "{{ baseuri }}"
|
||||
username: "{{ username }}"
|
||||
password: "{{ password }}"
|
||||
resource_uri: "/redfish/v1/Managers/1/Oem/Lenovo/FoD/Keys"
|
||||
register: result
|
||||
|
||||
- name: Print fetched information
|
||||
ansible.builtin.debug:
|
||||
msg: "{{ result.redfish_facts.data_list }}"
|
||||
- name: Print fetched information
|
||||
ansible.builtin.debug:
|
||||
msg: "{{ result.redfish_facts.data_list }}"
|
||||
|
||||
- name: Update ComputeSystem property AssetTag via PatchResource command
|
||||
community.general.xcc_redfish_command:
|
||||
category: Raw
|
||||
command: PatchResource
|
||||
baseuri: "{{ baseuri }}"
|
||||
username: "{{ username }}"
|
||||
password: "{{ password }}"
|
||||
resource_uri: "/redfish/v1/Systems/1"
|
||||
request_body:
|
||||
AssetTag: "new_asset_tag"
|
||||
- name: Update ComputeSystem property AssetTag via PatchResource command
|
||||
community.general.xcc_redfish_command:
|
||||
category: Raw
|
||||
command: PatchResource
|
||||
baseuri: "{{ baseuri }}"
|
||||
username: "{{ username }}"
|
||||
password: "{{ password }}"
|
||||
resource_uri: "/redfish/v1/Systems/1"
|
||||
request_body:
|
||||
AssetTag: "new_asset_tag"
|
||||
|
||||
- name: Perform BootToBIOSSetup action via PostResource command
|
||||
community.general.xcc_redfish_command:
|
||||
category: Raw
|
||||
command: PostResource
|
||||
baseuri: "{{ baseuri }}"
|
||||
username: "{{ username }}"
|
||||
password: "{{ password }}"
|
||||
resource_uri: "/redfish/v1/Systems/1/Actions/Oem/LenovoComputerSystem.BootToBIOSSetup"
|
||||
request_body: {}
|
||||
- name: Perform BootToBIOSSetup action via PostResource command
|
||||
community.general.xcc_redfish_command:
|
||||
category: Raw
|
||||
command: PostResource
|
||||
baseuri: "{{ baseuri }}"
|
||||
username: "{{ username }}"
|
||||
password: "{{ password }}"
|
||||
resource_uri: "/redfish/v1/Systems/1/Actions/Oem/LenovoComputerSystem.BootToBIOSSetup"
|
||||
request_body: {}
|
||||
|
||||
- name: Perform SecureBoot.ResetKeys action via PostResource command
|
||||
community.general.xcc_redfish_command:
|
||||
category: Raw
|
||||
command: PostResource
|
||||
baseuri: "{{ baseuri }}"
|
||||
username: "{{ username }}"
|
||||
password: "{{ password }}"
|
||||
resource_uri: "/redfish/v1/Systems/1/SecureBoot/Actions/SecureBoot.ResetKeys"
|
||||
request_body:
|
||||
ResetKeysType: DeleteAllKeys
|
||||
- name: Perform SecureBoot.ResetKeys action via PostResource command
|
||||
community.general.xcc_redfish_command:
|
||||
category: Raw
|
||||
command: PostResource
|
||||
baseuri: "{{ baseuri }}"
|
||||
username: "{{ username }}"
|
||||
password: "{{ password }}"
|
||||
resource_uri: "/redfish/v1/Systems/1/SecureBoot/Actions/SecureBoot.ResetKeys"
|
||||
request_body:
|
||||
ResetKeysType: DeleteAllKeys
|
||||
|
||||
- name: Create session
|
||||
community.general.redfish_command:
|
||||
category: Sessions
|
||||
command: CreateSession
|
||||
baseuri: "{{ baseuri }}"
|
||||
username: "{{ username }}"
|
||||
password: "{{ password }}"
|
||||
register: result
|
||||
- name: Create session
|
||||
community.general.redfish_command:
|
||||
category: Sessions
|
||||
command: CreateSession
|
||||
baseuri: "{{ baseuri }}"
|
||||
username: "{{ username }}"
|
||||
password: "{{ password }}"
|
||||
register: result
|
||||
|
||||
- name: Update Manager DateTimeLocalOffset property using security token for auth
|
||||
community.general.xcc_redfish_command:
|
||||
category: Raw
|
||||
command: PatchResource
|
||||
baseuri: "{{ baseuri }}"
|
||||
auth_token: "{{ result.session.token }}"
|
||||
resource_uri: "/redfish/v1/Managers/1"
|
||||
request_body:
|
||||
DateTimeLocalOffset: "+08:00"
|
||||
- name: Update Manager DateTimeLocalOffset property using security token for auth
|
||||
community.general.xcc_redfish_command:
|
||||
category: Raw
|
||||
command: PatchResource
|
||||
baseuri: "{{ baseuri }}"
|
||||
auth_token: "{{ result.session.token }}"
|
||||
resource_uri: "/redfish/v1/Managers/1"
|
||||
request_body:
|
||||
DateTimeLocalOffset: "+08:00"
|
||||
|
||||
- name: Delete session using security token created by CreateSesssion above
|
||||
community.general.redfish_command:
|
||||
category: Sessions
|
||||
command: DeleteSession
|
||||
baseuri: "{{ baseuri }}"
|
||||
auth_token: "{{ result.session.token }}"
|
||||
session_uri: "{{ result.session.uri }}"
|
||||
'''
|
||||
- name: Delete session using security token created by CreateSesssion above
|
||||
community.general.redfish_command:
|
||||
category: Sessions
|
||||
command: DeleteSession
|
||||
baseuri: "{{ baseuri }}"
|
||||
auth_token: "{{ result.session.token }}"
|
||||
session_uri: "{{ result.session.uri }}"
|
||||
"""
|
||||
|
||||
RETURN = '''
|
||||
RETURN = r"""
|
||||
msg:
|
||||
description: A message related to the performed action(s).
|
||||
returned: when failure or action/update success
|
||||
type: str
|
||||
sample: "Action was successful"
|
||||
description: A message related to the performed action(s).
|
||||
returned: when failure or action/update success
|
||||
type: str
|
||||
sample: "Action was successful"
|
||||
redfish_facts:
|
||||
description: Resource content.
|
||||
returned: when command == GetResource or command == GetCollectionResource
|
||||
type: dict
|
||||
sample: '{
|
||||
"redfish_facts": {
|
||||
"data": {
|
||||
"@odata.etag": "\"3179bf00d69f25a8b3c\"",
|
||||
"@odata.id": "/redfish/v1/Managers/1/NetworkProtocol/Oem/Lenovo/DNS",
|
||||
"@odata.type": "#LenovoDNS.v1_0_0.LenovoDNS",
|
||||
"DDNS": [
|
||||
{
|
||||
"DDNSEnable": true,
|
||||
"DomainName": "",
|
||||
"DomainNameSource": "DHCP"
|
||||
}
|
||||
],
|
||||
"DNSEnable": true,
|
||||
"Description": "This resource is used to represent a DNS resource for a Redfish implementation.",
|
||||
"IPv4Address1": "10.103.62.178",
|
||||
"IPv4Address2": "0.0.0.0",
|
||||
"IPv4Address3": "0.0.0.0",
|
||||
"IPv6Address1": "::",
|
||||
"IPv6Address2": "::",
|
||||
"IPv6Address3": "::",
|
||||
"Id": "LenovoDNS",
|
||||
"PreferredAddresstype": "IPv4"
|
||||
},
|
||||
"ret": true
|
||||
}
|
||||
}'
|
||||
'''
|
||||
description: Resource content.
|
||||
returned: when command == GetResource or command == GetCollectionResource
|
||||
type: dict
|
||||
sample: '{
|
||||
"redfish_facts": {
|
||||
"data": {
|
||||
"@odata.etag": "\"3179bf00d69f25a8b3c\"",
|
||||
"@odata.id": "/redfish/v1/Managers/1/NetworkProtocol/Oem/Lenovo/DNS",
|
||||
"@odata.type": "#LenovoDNS.v1_0_0.LenovoDNS",
|
||||
"DDNS": [
|
||||
{
|
||||
"DDNSEnable": true,
|
||||
"DomainName": "",
|
||||
"DomainNameSource": "DHCP"
|
||||
}
|
||||
],
|
||||
"DNSEnable": true,
|
||||
"Description": "This resource is used to represent a DNS resource for a Redfish implementation.",
|
||||
"IPv4Address1": "10.103.62.178",
|
||||
"IPv4Address2": "0.0.0.0",
|
||||
"IPv4Address3": "0.0.0.0",
|
||||
"IPv6Address1": "::",
|
||||
"IPv6Address2": "::",
|
||||
"IPv6Address3": "::",
|
||||
"Id": "LenovoDNS",
|
||||
"PreferredAddresstype": "IPv4"
|
||||
},
|
||||
"ret": true
|
||||
}
|
||||
}'
|
||||
"""
|
||||
|
||||
from ansible.module_utils.basic import AnsibleModule
|
||||
from ansible.module_utils.common.text.converters import to_native
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue