1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00
community.general/plugins/modules/remote_management/redfish/redfish_config.py

390 lines
12 KiB
Python
Raw Normal View History

2020-03-09 10:11:07 +01:00
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2017-2018 Dell EMC Inc.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
2020-03-09 10:11:07 +01:00
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = '''
---
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.
- Manages BIOS configuration settings.
- Manages OOB controller configuration settings.
options:
category:
required: true
description:
redfish modules: documentation language and formatting (#4722) (#4724) * redfish_command: documentation language and formatting Update the documentation block with more English language more consistent with other modules and finish each description with a full stop. * redfish_command: do not end short desc in full stop * redfish_command: remove more "the" on documentation Remove "The" from beginning of descriptions. * redfish_command: start documentation description with capital case * redfish_config: update documentation language and format Add full stops at end of descriptions, small updates to language, ensure descriptions start with a capital case letter. * redfish_config: documentation consistency Use "username" for description similarly to redfish_command. * redfish_info: documentation formatting and language Update documentation block for consistency with other modules with full stop at end of descriptions and small language updates. * idrac_redfish_command: documentation formatting and language Update documentation block for consistency with other modules with full stop at end of descriptions and small language updates. * idrac_redfish_command: more doc consistency fixes Call it iDRAC everywhere and not sometimes OOB controller. * idrac_redfish_command: documentation formatting and language Update documentation block for consistency with other modules with full stop at end of descriptions and small language updates. * idrac_redfish_info: documentation formatting and language Update documentation block for consistency with other modules with full stop at end of descriptions and small language updates. * ilo_redfish_config: documentation formatting and language Update documentation block for consistency with other modules with full stop at end of descriptions and small language updates. * ilo_redfish_info: documentation formatting and language Update documentation block for consistency with other modules with full stop at end of descriptions and small language updates. * idrac_redfish_info: documentation language Call it "HTTP request" and not "URL request". * idrac_redfish_command: documentation language fix Call it "HTTP request" and not "URL request". * idrac_redfish_config: documentation language fix Call it "HTTP request" and not "URL request". * redfish_command: documentation language fix Call it "HTTP request" and not "URL request". * redfish_config: documentation language fix Call it "HTTP request" and not "URL request". * redfish_info: documentation language fix Call it "HTTP request" and not "URL request". * redfish_command: documentation language fix Boot device should be two words. Co-authored-by: Felix Fontein <felix@fontein.de> Co-authored-by: Felix Fontein <felix@fontein.de> (cherry picked from commit 88cd35fd45fa5e19b17526b0b9e2bff512b229c6) Co-authored-by: bluikko <14869000+bluikko@users.noreply.github.com>
2022-05-24 20:20:27 +02:00
- Category to execute on OOB controller.
2020-03-09 10:11:07 +01:00
type: str
command:
required: true
description:
redfish modules: documentation language and formatting (#4722) (#4724) * redfish_command: documentation language and formatting Update the documentation block with more English language more consistent with other modules and finish each description with a full stop. * redfish_command: do not end short desc in full stop * redfish_command: remove more "the" on documentation Remove "The" from beginning of descriptions. * redfish_command: start documentation description with capital case * redfish_config: update documentation language and format Add full stops at end of descriptions, small updates to language, ensure descriptions start with a capital case letter. * redfish_config: documentation consistency Use "username" for description similarly to redfish_command. * redfish_info: documentation formatting and language Update documentation block for consistency with other modules with full stop at end of descriptions and small language updates. * idrac_redfish_command: documentation formatting and language Update documentation block for consistency with other modules with full stop at end of descriptions and small language updates. * idrac_redfish_command: more doc consistency fixes Call it iDRAC everywhere and not sometimes OOB controller. * idrac_redfish_command: documentation formatting and language Update documentation block for consistency with other modules with full stop at end of descriptions and small language updates. * idrac_redfish_info: documentation formatting and language Update documentation block for consistency with other modules with full stop at end of descriptions and small language updates. * ilo_redfish_config: documentation formatting and language Update documentation block for consistency with other modules with full stop at end of descriptions and small language updates. * ilo_redfish_info: documentation formatting and language Update documentation block for consistency with other modules with full stop at end of descriptions and small language updates. * idrac_redfish_info: documentation language Call it "HTTP request" and not "URL request". * idrac_redfish_command: documentation language fix Call it "HTTP request" and not "URL request". * idrac_redfish_config: documentation language fix Call it "HTTP request" and not "URL request". * redfish_command: documentation language fix Call it "HTTP request" and not "URL request". * redfish_config: documentation language fix Call it "HTTP request" and not "URL request". * redfish_info: documentation language fix Call it "HTTP request" and not "URL request". * redfish_command: documentation language fix Boot device should be two words. Co-authored-by: Felix Fontein <felix@fontein.de> Co-authored-by: Felix Fontein <felix@fontein.de> (cherry picked from commit 88cd35fd45fa5e19b17526b0b9e2bff512b229c6) Co-authored-by: bluikko <14869000+bluikko@users.noreply.github.com>
2022-05-24 20:20:27 +02:00
- List of commands to execute on OOB controller.
2020-03-09 10:11:07 +01:00
type: list
elements: str
2020-03-09 10:11:07 +01:00
baseuri:
required: true
description:
redfish modules: documentation language and formatting (#4722) (#4724) * redfish_command: documentation language and formatting Update the documentation block with more English language more consistent with other modules and finish each description with a full stop. * redfish_command: do not end short desc in full stop * redfish_command: remove more "the" on documentation Remove "The" from beginning of descriptions. * redfish_command: start documentation description with capital case * redfish_config: update documentation language and format Add full stops at end of descriptions, small updates to language, ensure descriptions start with a capital case letter. * redfish_config: documentation consistency Use "username" for description similarly to redfish_command. * redfish_info: documentation formatting and language Update documentation block for consistency with other modules with full stop at end of descriptions and small language updates. * idrac_redfish_command: documentation formatting and language Update documentation block for consistency with other modules with full stop at end of descriptions and small language updates. * idrac_redfish_command: more doc consistency fixes Call it iDRAC everywhere and not sometimes OOB controller. * idrac_redfish_command: documentation formatting and language Update documentation block for consistency with other modules with full stop at end of descriptions and small language updates. * idrac_redfish_info: documentation formatting and language Update documentation block for consistency with other modules with full stop at end of descriptions and small language updates. * ilo_redfish_config: documentation formatting and language Update documentation block for consistency with other modules with full stop at end of descriptions and small language updates. * ilo_redfish_info: documentation formatting and language Update documentation block for consistency with other modules with full stop at end of descriptions and small language updates. * idrac_redfish_info: documentation language Call it "HTTP request" and not "URL request". * idrac_redfish_command: documentation language fix Call it "HTTP request" and not "URL request". * idrac_redfish_config: documentation language fix Call it "HTTP request" and not "URL request". * redfish_command: documentation language fix Call it "HTTP request" and not "URL request". * redfish_config: documentation language fix Call it "HTTP request" and not "URL request". * redfish_info: documentation language fix Call it "HTTP request" and not "URL request". * redfish_command: documentation language fix Boot device should be two words. Co-authored-by: Felix Fontein <felix@fontein.de> Co-authored-by: Felix Fontein <felix@fontein.de> (cherry picked from commit 88cd35fd45fa5e19b17526b0b9e2bff512b229c6) Co-authored-by: bluikko <14869000+bluikko@users.noreply.github.com>
2022-05-24 20:20:27 +02:00
- Base URI of OOB controller.
2020-03-09 10:11:07 +01:00
type: str
username:
description:
redfish modules: documentation language and formatting (#4722) (#4724) * redfish_command: documentation language and formatting Update the documentation block with more English language more consistent with other modules and finish each description with a full stop. * redfish_command: do not end short desc in full stop * redfish_command: remove more "the" on documentation Remove "The" from beginning of descriptions. * redfish_command: start documentation description with capital case * redfish_config: update documentation language and format Add full stops at end of descriptions, small updates to language, ensure descriptions start with a capital case letter. * redfish_config: documentation consistency Use "username" for description similarly to redfish_command. * redfish_info: documentation formatting and language Update documentation block for consistency with other modules with full stop at end of descriptions and small language updates. * idrac_redfish_command: documentation formatting and language Update documentation block for consistency with other modules with full stop at end of descriptions and small language updates. * idrac_redfish_command: more doc consistency fixes Call it iDRAC everywhere and not sometimes OOB controller. * idrac_redfish_command: documentation formatting and language Update documentation block for consistency with other modules with full stop at end of descriptions and small language updates. * idrac_redfish_info: documentation formatting and language Update documentation block for consistency with other modules with full stop at end of descriptions and small language updates. * ilo_redfish_config: documentation formatting and language Update documentation block for consistency with other modules with full stop at end of descriptions and small language updates. * ilo_redfish_info: documentation formatting and language Update documentation block for consistency with other modules with full stop at end of descriptions and small language updates. * idrac_redfish_info: documentation language Call it "HTTP request" and not "URL request". * idrac_redfish_command: documentation language fix Call it "HTTP request" and not "URL request". * idrac_redfish_config: documentation language fix Call it "HTTP request" and not "URL request". * redfish_command: documentation language fix Call it "HTTP request" and not "URL request". * redfish_config: documentation language fix Call it "HTTP request" and not "URL request". * redfish_info: documentation language fix Call it "HTTP request" and not "URL request". * redfish_command: documentation language fix Boot device should be two words. Co-authored-by: Felix Fontein <felix@fontein.de> Co-authored-by: Felix Fontein <felix@fontein.de> (cherry picked from commit 88cd35fd45fa5e19b17526b0b9e2bff512b229c6) Co-authored-by: bluikko <14869000+bluikko@users.noreply.github.com>
2022-05-24 20:20:27 +02:00
- Username for authenticating to OOB controller.
2020-03-09 10:11:07 +01:00
type: str
password:
description:
redfish modules: documentation language and formatting (#4722) (#4724) * redfish_command: documentation language and formatting Update the documentation block with more English language more consistent with other modules and finish each description with a full stop. * redfish_command: do not end short desc in full stop * redfish_command: remove more "the" on documentation Remove "The" from beginning of descriptions. * redfish_command: start documentation description with capital case * redfish_config: update documentation language and format Add full stops at end of descriptions, small updates to language, ensure descriptions start with a capital case letter. * redfish_config: documentation consistency Use "username" for description similarly to redfish_command. * redfish_info: documentation formatting and language Update documentation block for consistency with other modules with full stop at end of descriptions and small language updates. * idrac_redfish_command: documentation formatting and language Update documentation block for consistency with other modules with full stop at end of descriptions and small language updates. * idrac_redfish_command: more doc consistency fixes Call it iDRAC everywhere and not sometimes OOB controller. * idrac_redfish_command: documentation formatting and language Update documentation block for consistency with other modules with full stop at end of descriptions and small language updates. * idrac_redfish_info: documentation formatting and language Update documentation block for consistency with other modules with full stop at end of descriptions and small language updates. * ilo_redfish_config: documentation formatting and language Update documentation block for consistency with other modules with full stop at end of descriptions and small language updates. * ilo_redfish_info: documentation formatting and language Update documentation block for consistency with other modules with full stop at end of descriptions and small language updates. * idrac_redfish_info: documentation language Call it "HTTP request" and not "URL request". * idrac_redfish_command: documentation language fix Call it "HTTP request" and not "URL request". * idrac_redfish_config: documentation language fix Call it "HTTP request" and not "URL request". * redfish_command: documentation language fix Call it "HTTP request" and not "URL request". * redfish_config: documentation language fix Call it "HTTP request" and not "URL request". * redfish_info: documentation language fix Call it "HTTP request" and not "URL request". * redfish_command: documentation language fix Boot device should be two words. Co-authored-by: Felix Fontein <felix@fontein.de> Co-authored-by: Felix Fontein <felix@fontein.de> (cherry picked from commit 88cd35fd45fa5e19b17526b0b9e2bff512b229c6) Co-authored-by: bluikko <14869000+bluikko@users.noreply.github.com>
2022-05-24 20:20:27 +02:00
- Password for authenticating to OOB controller.
2020-03-09 10:11:07 +01:00
type: str
auth_token:
description:
redfish modules: documentation language and formatting (#4722) (#4724) * redfish_command: documentation language and formatting Update the documentation block with more English language more consistent with other modules and finish each description with a full stop. * redfish_command: do not end short desc in full stop * redfish_command: remove more "the" on documentation Remove "The" from beginning of descriptions. * redfish_command: start documentation description with capital case * redfish_config: update documentation language and format Add full stops at end of descriptions, small updates to language, ensure descriptions start with a capital case letter. * redfish_config: documentation consistency Use "username" for description similarly to redfish_command. * redfish_info: documentation formatting and language Update documentation block for consistency with other modules with full stop at end of descriptions and small language updates. * idrac_redfish_command: documentation formatting and language Update documentation block for consistency with other modules with full stop at end of descriptions and small language updates. * idrac_redfish_command: more doc consistency fixes Call it iDRAC everywhere and not sometimes OOB controller. * idrac_redfish_command: documentation formatting and language Update documentation block for consistency with other modules with full stop at end of descriptions and small language updates. * idrac_redfish_info: documentation formatting and language Update documentation block for consistency with other modules with full stop at end of descriptions and small language updates. * ilo_redfish_config: documentation formatting and language Update documentation block for consistency with other modules with full stop at end of descriptions and small language updates. * ilo_redfish_info: documentation formatting and language Update documentation block for consistency with other modules with full stop at end of descriptions and small language updates. * idrac_redfish_info: documentation language Call it "HTTP request" and not "URL request". * idrac_redfish_command: documentation language fix Call it "HTTP request" and not "URL request". * idrac_redfish_config: documentation language fix Call it "HTTP request" and not "URL request". * redfish_command: documentation language fix Call it "HTTP request" and not "URL request". * redfish_config: documentation language fix Call it "HTTP request" and not "URL request". * redfish_info: documentation language fix Call it "HTTP request" and not "URL request". * redfish_command: documentation language fix Boot device should be two words. Co-authored-by: Felix Fontein <felix@fontein.de> Co-authored-by: Felix Fontein <felix@fontein.de> (cherry picked from commit 88cd35fd45fa5e19b17526b0b9e2bff512b229c6) Co-authored-by: bluikko <14869000+bluikko@users.noreply.github.com>
2022-05-24 20:20:27 +02:00
- Security token for authenticating to OOB controller.
type: str
version_added: 2.3.0
2020-03-09 10:11:07 +01:00
bios_attributes:
required: false
description:
redfish modules: documentation language and formatting (#4722) (#4724) * redfish_command: documentation language and formatting Update the documentation block with more English language more consistent with other modules and finish each description with a full stop. * redfish_command: do not end short desc in full stop * redfish_command: remove more "the" on documentation Remove "The" from beginning of descriptions. * redfish_command: start documentation description with capital case * redfish_config: update documentation language and format Add full stops at end of descriptions, small updates to language, ensure descriptions start with a capital case letter. * redfish_config: documentation consistency Use "username" for description similarly to redfish_command. * redfish_info: documentation formatting and language Update documentation block for consistency with other modules with full stop at end of descriptions and small language updates. * idrac_redfish_command: documentation formatting and language Update documentation block for consistency with other modules with full stop at end of descriptions and small language updates. * idrac_redfish_command: more doc consistency fixes Call it iDRAC everywhere and not sometimes OOB controller. * idrac_redfish_command: documentation formatting and language Update documentation block for consistency with other modules with full stop at end of descriptions and small language updates. * idrac_redfish_info: documentation formatting and language Update documentation block for consistency with other modules with full stop at end of descriptions and small language updates. * ilo_redfish_config: documentation formatting and language Update documentation block for consistency with other modules with full stop at end of descriptions and small language updates. * ilo_redfish_info: documentation formatting and language Update documentation block for consistency with other modules with full stop at end of descriptions and small language updates. * idrac_redfish_info: documentation language Call it "HTTP request" and not "URL request". * idrac_redfish_command: documentation language fix Call it "HTTP request" and not "URL request". * idrac_redfish_config: documentation language fix Call it "HTTP request" and not "URL request". * redfish_command: documentation language fix Call it "HTTP request" and not "URL request". * redfish_config: documentation language fix Call it "HTTP request" and not "URL request". * redfish_info: documentation language fix Call it "HTTP request" and not "URL request". * redfish_command: documentation language fix Boot device should be two words. Co-authored-by: Felix Fontein <felix@fontein.de> Co-authored-by: Felix Fontein <felix@fontein.de> (cherry picked from commit 88cd35fd45fa5e19b17526b0b9e2bff512b229c6) Co-authored-by: bluikko <14869000+bluikko@users.noreply.github.com>
2022-05-24 20:20:27 +02:00
- Dictionary of BIOS attributes to update.
2020-03-09 10:11:07 +01:00
default: {}
type: dict
version_added: '0.2.0'
2020-03-09 10:11:07 +01:00
timeout:
description:
redfish modules: documentation language and formatting (#4722) (#4724) * redfish_command: documentation language and formatting Update the documentation block with more English language more consistent with other modules and finish each description with a full stop. * redfish_command: do not end short desc in full stop * redfish_command: remove more "the" on documentation Remove "The" from beginning of descriptions. * redfish_command: start documentation description with capital case * redfish_config: update documentation language and format Add full stops at end of descriptions, small updates to language, ensure descriptions start with a capital case letter. * redfish_config: documentation consistency Use "username" for description similarly to redfish_command. * redfish_info: documentation formatting and language Update documentation block for consistency with other modules with full stop at end of descriptions and small language updates. * idrac_redfish_command: documentation formatting and language Update documentation block for consistency with other modules with full stop at end of descriptions and small language updates. * idrac_redfish_command: more doc consistency fixes Call it iDRAC everywhere and not sometimes OOB controller. * idrac_redfish_command: documentation formatting and language Update documentation block for consistency with other modules with full stop at end of descriptions and small language updates. * idrac_redfish_info: documentation formatting and language Update documentation block for consistency with other modules with full stop at end of descriptions and small language updates. * ilo_redfish_config: documentation formatting and language Update documentation block for consistency with other modules with full stop at end of descriptions and small language updates. * ilo_redfish_info: documentation formatting and language Update documentation block for consistency with other modules with full stop at end of descriptions and small language updates. * idrac_redfish_info: documentation language Call it "HTTP request" and not "URL request". * idrac_redfish_command: documentation language fix Call it "HTTP request" and not "URL request". * idrac_redfish_config: documentation language fix Call it "HTTP request" and not "URL request". * redfish_command: documentation language fix Call it "HTTP request" and not "URL request". * redfish_config: documentation language fix Call it "HTTP request" and not "URL request". * redfish_info: documentation language fix Call it "HTTP request" and not "URL request". * redfish_command: documentation language fix Boot device should be two words. Co-authored-by: Felix Fontein <felix@fontein.de> Co-authored-by: Felix Fontein <felix@fontein.de> (cherry picked from commit 88cd35fd45fa5e19b17526b0b9e2bff512b229c6) Co-authored-by: bluikko <14869000+bluikko@users.noreply.github.com>
2022-05-24 20:20:27 +02:00
- Timeout in seconds for HTTP requests to OOB controller.
2020-03-09 10:11:07 +01:00
default: 10
type: int
boot_order:
required: false
description:
redfish modules: documentation language and formatting (#4722) (#4724) * redfish_command: documentation language and formatting Update the documentation block with more English language more consistent with other modules and finish each description with a full stop. * redfish_command: do not end short desc in full stop * redfish_command: remove more "the" on documentation Remove "The" from beginning of descriptions. * redfish_command: start documentation description with capital case * redfish_config: update documentation language and format Add full stops at end of descriptions, small updates to language, ensure descriptions start with a capital case letter. * redfish_config: documentation consistency Use "username" for description similarly to redfish_command. * redfish_info: documentation formatting and language Update documentation block for consistency with other modules with full stop at end of descriptions and small language updates. * idrac_redfish_command: documentation formatting and language Update documentation block for consistency with other modules with full stop at end of descriptions and small language updates. * idrac_redfish_command: more doc consistency fixes Call it iDRAC everywhere and not sometimes OOB controller. * idrac_redfish_command: documentation formatting and language Update documentation block for consistency with other modules with full stop at end of descriptions and small language updates. * idrac_redfish_info: documentation formatting and language Update documentation block for consistency with other modules with full stop at end of descriptions and small language updates. * ilo_redfish_config: documentation formatting and language Update documentation block for consistency with other modules with full stop at end of descriptions and small language updates. * ilo_redfish_info: documentation formatting and language Update documentation block for consistency with other modules with full stop at end of descriptions and small language updates. * idrac_redfish_info: documentation language Call it "HTTP request" and not "URL request". * idrac_redfish_command: documentation language fix Call it "HTTP request" and not "URL request". * idrac_redfish_config: documentation language fix Call it "HTTP request" and not "URL request". * redfish_command: documentation language fix Call it "HTTP request" and not "URL request". * redfish_config: documentation language fix Call it "HTTP request" and not "URL request". * redfish_info: documentation language fix Call it "HTTP request" and not "URL request". * redfish_command: documentation language fix Boot device should be two words. Co-authored-by: Felix Fontein <felix@fontein.de> Co-authored-by: Felix Fontein <felix@fontein.de> (cherry picked from commit 88cd35fd45fa5e19b17526b0b9e2bff512b229c6) Co-authored-by: bluikko <14869000+bluikko@users.noreply.github.com>
2022-05-24 20:20:27 +02:00
- List of BootOptionReference strings specifying the BootOrder.
2020-03-09 10:11:07 +01:00
default: []
type: list
elements: str
version_added: '0.2.0'
2020-03-09 10:11:07 +01:00
network_protocols:
required: false
description:
redfish modules: documentation language and formatting (#4722) (#4724) * redfish_command: documentation language and formatting Update the documentation block with more English language more consistent with other modules and finish each description with a full stop. * redfish_command: do not end short desc in full stop * redfish_command: remove more "the" on documentation Remove "The" from beginning of descriptions. * redfish_command: start documentation description with capital case * redfish_config: update documentation language and format Add full stops at end of descriptions, small updates to language, ensure descriptions start with a capital case letter. * redfish_config: documentation consistency Use "username" for description similarly to redfish_command. * redfish_info: documentation formatting and language Update documentation block for consistency with other modules with full stop at end of descriptions and small language updates. * idrac_redfish_command: documentation formatting and language Update documentation block for consistency with other modules with full stop at end of descriptions and small language updates. * idrac_redfish_command: more doc consistency fixes Call it iDRAC everywhere and not sometimes OOB controller. * idrac_redfish_command: documentation formatting and language Update documentation block for consistency with other modules with full stop at end of descriptions and small language updates. * idrac_redfish_info: documentation formatting and language Update documentation block for consistency with other modules with full stop at end of descriptions and small language updates. * ilo_redfish_config: documentation formatting and language Update documentation block for consistency with other modules with full stop at end of descriptions and small language updates. * ilo_redfish_info: documentation formatting and language Update documentation block for consistency with other modules with full stop at end of descriptions and small language updates. * idrac_redfish_info: documentation language Call it "HTTP request" and not "URL request". * idrac_redfish_command: documentation language fix Call it "HTTP request" and not "URL request". * idrac_redfish_config: documentation language fix Call it "HTTP request" and not "URL request". * redfish_command: documentation language fix Call it "HTTP request" and not "URL request". * redfish_config: documentation language fix Call it "HTTP request" and not "URL request". * redfish_info: documentation language fix Call it "HTTP request" and not "URL request". * redfish_command: documentation language fix Boot device should be two words. Co-authored-by: Felix Fontein <felix@fontein.de> Co-authored-by: Felix Fontein <felix@fontein.de> (cherry picked from commit 88cd35fd45fa5e19b17526b0b9e2bff512b229c6) Co-authored-by: bluikko <14869000+bluikko@users.noreply.github.com>
2022-05-24 20:20:27 +02:00
- Setting dict of manager services to update.
2020-03-09 10:11:07 +01:00
type: dict
version_added: '0.2.0'
2020-03-09 10:11:07 +01:00
resource_id:
required: false
description:
redfish modules: documentation language and formatting (#4722) (#4724) * redfish_command: documentation language and formatting Update the documentation block with more English language more consistent with other modules and finish each description with a full stop. * redfish_command: do not end short desc in full stop * redfish_command: remove more "the" on documentation Remove "The" from beginning of descriptions. * redfish_command: start documentation description with capital case * redfish_config: update documentation language and format Add full stops at end of descriptions, small updates to language, ensure descriptions start with a capital case letter. * redfish_config: documentation consistency Use "username" for description similarly to redfish_command. * redfish_info: documentation formatting and language Update documentation block for consistency with other modules with full stop at end of descriptions and small language updates. * idrac_redfish_command: documentation formatting and language Update documentation block for consistency with other modules with full stop at end of descriptions and small language updates. * idrac_redfish_command: more doc consistency fixes Call it iDRAC everywhere and not sometimes OOB controller. * idrac_redfish_command: documentation formatting and language Update documentation block for consistency with other modules with full stop at end of descriptions and small language updates. * idrac_redfish_info: documentation formatting and language Update documentation block for consistency with other modules with full stop at end of descriptions and small language updates. * ilo_redfish_config: documentation formatting and language Update documentation block for consistency with other modules with full stop at end of descriptions and small language updates. * ilo_redfish_info: documentation formatting and language Update documentation block for consistency with other modules with full stop at end of descriptions and small language updates. * idrac_redfish_info: documentation language Call it "HTTP request" and not "URL request". * idrac_redfish_command: documentation language fix Call it "HTTP request" and not "URL request". * idrac_redfish_config: documentation language fix Call it "HTTP request" and not "URL request". * redfish_command: documentation language fix Call it "HTTP request" and not "URL request". * redfish_config: documentation language fix Call it "HTTP request" and not "URL request". * redfish_info: documentation language fix Call it "HTTP request" and not "URL request". * redfish_command: documentation language fix Boot device should be two words. Co-authored-by: Felix Fontein <felix@fontein.de> Co-authored-by: Felix Fontein <felix@fontein.de> (cherry picked from commit 88cd35fd45fa5e19b17526b0b9e2bff512b229c6) Co-authored-by: bluikko <14869000+bluikko@users.noreply.github.com>
2022-05-24 20:20:27 +02:00
- ID of the System, Manager or Chassis to modify.
2020-03-09 10:11:07 +01:00
type: str
version_added: '0.2.0'
2020-03-09 10:11:07 +01:00
nic_addr:
required: false
description:
redfish modules: documentation language and formatting (#4722) (#4724) * redfish_command: documentation language and formatting Update the documentation block with more English language more consistent with other modules and finish each description with a full stop. * redfish_command: do not end short desc in full stop * redfish_command: remove more "the" on documentation Remove "The" from beginning of descriptions. * redfish_command: start documentation description with capital case * redfish_config: update documentation language and format Add full stops at end of descriptions, small updates to language, ensure descriptions start with a capital case letter. * redfish_config: documentation consistency Use "username" for description similarly to redfish_command. * redfish_info: documentation formatting and language Update documentation block for consistency with other modules with full stop at end of descriptions and small language updates. * idrac_redfish_command: documentation formatting and language Update documentation block for consistency with other modules with full stop at end of descriptions and small language updates. * idrac_redfish_command: more doc consistency fixes Call it iDRAC everywhere and not sometimes OOB controller. * idrac_redfish_command: documentation formatting and language Update documentation block for consistency with other modules with full stop at end of descriptions and small language updates. * idrac_redfish_info: documentation formatting and language Update documentation block for consistency with other modules with full stop at end of descriptions and small language updates. * ilo_redfish_config: documentation formatting and language Update documentation block for consistency with other modules with full stop at end of descriptions and small language updates. * ilo_redfish_info: documentation formatting and language Update documentation block for consistency with other modules with full stop at end of descriptions and small language updates. * idrac_redfish_info: documentation language Call it "HTTP request" and not "URL request". * idrac_redfish_command: documentation language fix Call it "HTTP request" and not "URL request". * idrac_redfish_config: documentation language fix Call it "HTTP request" and not "URL request". * redfish_command: documentation language fix Call it "HTTP request" and not "URL request". * redfish_config: documentation language fix Call it "HTTP request" and not "URL request". * redfish_info: documentation language fix Call it "HTTP request" and not "URL request". * redfish_command: documentation language fix Boot device should be two words. Co-authored-by: Felix Fontein <felix@fontein.de> Co-authored-by: Felix Fontein <felix@fontein.de> (cherry picked from commit 88cd35fd45fa5e19b17526b0b9e2bff512b229c6) Co-authored-by: bluikko <14869000+bluikko@users.noreply.github.com>
2022-05-24 20:20:27 +02:00
- EthernetInterface Address string on OOB controller.
2020-03-09 10:11:07 +01:00
default: 'null'
type: str
version_added: '0.2.0'
2020-03-09 10:11:07 +01:00
nic_config:
required: false
description:
redfish modules: documentation language and formatting (#4722) (#4724) * redfish_command: documentation language and formatting Update the documentation block with more English language more consistent with other modules and finish each description with a full stop. * redfish_command: do not end short desc in full stop * redfish_command: remove more "the" on documentation Remove "The" from beginning of descriptions. * redfish_command: start documentation description with capital case * redfish_config: update documentation language and format Add full stops at end of descriptions, small updates to language, ensure descriptions start with a capital case letter. * redfish_config: documentation consistency Use "username" for description similarly to redfish_command. * redfish_info: documentation formatting and language Update documentation block for consistency with other modules with full stop at end of descriptions and small language updates. * idrac_redfish_command: documentation formatting and language Update documentation block for consistency with other modules with full stop at end of descriptions and small language updates. * idrac_redfish_command: more doc consistency fixes Call it iDRAC everywhere and not sometimes OOB controller. * idrac_redfish_command: documentation formatting and language Update documentation block for consistency with other modules with full stop at end of descriptions and small language updates. * idrac_redfish_info: documentation formatting and language Update documentation block for consistency with other modules with full stop at end of descriptions and small language updates. * ilo_redfish_config: documentation formatting and language Update documentation block for consistency with other modules with full stop at end of descriptions and small language updates. * ilo_redfish_info: documentation formatting and language Update documentation block for consistency with other modules with full stop at end of descriptions and small language updates. * idrac_redfish_info: documentation language Call it "HTTP request" and not "URL request". * idrac_redfish_command: documentation language fix Call it "HTTP request" and not "URL request". * idrac_redfish_config: documentation language fix Call it "HTTP request" and not "URL request". * redfish_command: documentation language fix Call it "HTTP request" and not "URL request". * redfish_config: documentation language fix Call it "HTTP request" and not "URL request". * redfish_info: documentation language fix Call it "HTTP request" and not "URL request". * redfish_command: documentation language fix Boot device should be two words. Co-authored-by: Felix Fontein <felix@fontein.de> Co-authored-by: Felix Fontein <felix@fontein.de> (cherry picked from commit 88cd35fd45fa5e19b17526b0b9e2bff512b229c6) Co-authored-by: bluikko <14869000+bluikko@users.noreply.github.com>
2022-05-24 20:20:27 +02:00
- Setting dict of EthernetInterface on OOB controller.
2020-03-09 10:11:07 +01:00
type: dict
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.
type: bool
default: false
version_added: 3.7.0
hostinterface_config:
required: false
description:
- Setting dict of HostInterface on OOB controller.
type: dict
version_added: '4.1.0'
hostinterface_id:
required: false
description:
- Redfish HostInterface instance ID if multiple HostInterfaces are present.
type: str
version_added: '4.1.0'
2020-03-09 10:11:07 +01:00
author: "Jose Delarosa (@jose-delarosa)"
'''
EXAMPLES = '''
- name: Set BootMode to UEFI
community.general.redfish_config:
2020-03-09 10:11:07 +01:00
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:
2020-03-09 10:11:07 +01:00
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:
2020-03-09 10:11:07 +01:00
category: Systems
command: SetBiosAttributes
resource_id: 437XR1138R2
bios_attributes:
PxeDev1EnDis: Enabled
2020-03-09 10:11:07 +01:00
baseuri: "{{ baseuri }}"
username: "{{ username }}"
password: "{{ password }}"
- name: Set BIOS default settings with a timeout of 20 seconds
community.general.redfish_config:
2020-03-09 10:11:07 +01:00
category: Systems
command: SetBiosDefaultSettings
resource_id: 437XR1138R2
baseuri: "{{ baseuri }}"
username: "{{ username }}"
password: "{{ password }}"
timeout: 20
- name: Set boot order
community.general.redfish_config:
2020-03-09 10:11:07 +01:00
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:
2020-03-09 10:11:07 +01:00
category: Systems
command: SetDefaultBootOrder
baseuri: "{{ baseuri }}"
username: "{{ username }}"
password: "{{ password }}"
- name: Set Manager Network Protocols
community.general.redfish_config:
2020-03-09 10:11:07 +01:00
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:
2020-03-09 10:11:07 +01:00
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: 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 }}"
2020-03-09 10:11:07 +01:00
'''
RETURN = '''
msg:
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
from ansible.module_utils.common.text.converters import to_native
2020-03-09 10:11:07 +01:00
# More will be added as module features are expanded
CATEGORY_COMMANDS_ALL = {
"Systems": ["SetBiosDefaultSettings", "SetBiosAttributes", "SetBootOrder",
"SetDefaultBootOrder"],
"Manager": ["SetNetworkProtocols", "SetManagerNic", "SetHostInterface"]
2020-03-09 10:11:07 +01:00
}
def main():
result = {}
module = AnsibleModule(
argument_spec=dict(
category=dict(required=True),
command=dict(required=True, type='list', elements='str'),
2020-03-09 10:11:07 +01:00
baseuri=dict(required=True),
username=dict(),
password=dict(no_log=True),
auth_token=dict(no_log=True),
2020-03-09 10:11:07 +01:00
bios_attributes=dict(type='dict', default={}),
timeout=dict(type='int', default=10),
boot_order=dict(type='list', elements='str', default=[]),
network_protocols=dict(
type='dict',
default={}
),
resource_id=dict(),
nic_addr=dict(default='null'),
nic_config=dict(
type='dict',
default={}
),
strip_etag_quotes=dict(type='bool', default=False),
hostinterface_config=dict(type='dict', default={}),
hostinterface_id=dict(),
2020-03-09 10:11:07 +01:00
),
required_together=[
('username', 'password'),
],
required_one_of=[
('username', 'auth_token'),
],
mutually_exclusive=[
('username', 'auth_token'),
],
2020-03-09 10:11:07 +01:00
supports_check_mode=False
)
category = module.params['category']
command_list = module.params['command']
# admin credentials used for authentication
creds = {'user': module.params['username'],
'pswd': module.params['password'],
'token': module.params['auth_token']}
2020-03-09 10:11:07 +01:00
# timeout
timeout = module.params['timeout']
# BIOS attributes to update
bios_attributes = module.params['bios_attributes']
# boot order
boot_order = module.params['boot_order']
# System, Manager or Chassis ID to modify
resource_id = module.params['resource_id']
# manager nic
nic_addr = module.params['nic_addr']
nic_config = module.params['nic_config']
# Etag options
strip_etag_quotes = module.params['strip_etag_quotes']
# HostInterface config options
hostinterface_config = module.params['hostinterface_config']
# HostInterface instance ID
hostinterface_id = module.params['hostinterface_id']
2020-03-09 10:11:07 +01:00
# Build root URI
root_uri = "https://" + module.params['baseuri']
rf_utils = RedfishUtils(creds, root_uri, timeout, module,
resource_id=resource_id, data_modification=True, strip_etag_quotes=strip_etag_quotes)
2020-03-09 10:11:07 +01:00
# Check that Category is valid
if category not in CATEGORY_COMMANDS_ALL:
module.fail_json(msg=to_native("Invalid Category '%s'. Valid Categories = %s" % (category, list(CATEGORY_COMMANDS_ALL.keys()))))
2020-03-09 10:11:07 +01:00
# Check that all commands are valid
for cmd in command_list:
# Fail if even one command given is invalid
if cmd not in CATEGORY_COMMANDS_ALL[category]:
module.fail_json(msg=to_native("Invalid Command '%s'. Valid Commands = %s" % (cmd, CATEGORY_COMMANDS_ALL[category])))
# Organize by Categories / Commands
if category == "Systems":
# execute only if we find a System resource
result = rf_utils._find_systems_resource()
if result['ret'] is False:
module.fail_json(msg=to_native(result['msg']))
for command in command_list:
if command == "SetBiosDefaultSettings":
result = rf_utils.set_bios_default_settings()
elif command == "SetBiosAttributes":
result = rf_utils.set_bios_attributes(bios_attributes)
elif command == "SetBootOrder":
result = rf_utils.set_boot_order(boot_order)
elif command == "SetDefaultBootOrder":
result = rf_utils.set_default_boot_order()
elif category == "Manager":
# execute only if we find a Manager service resource
result = rf_utils._find_managers_resource()
if result['ret'] is False:
module.fail_json(msg=to_native(result['msg']))
for command in command_list:
if command == "SetNetworkProtocols":
result = rf_utils.set_network_protocols(module.params['network_protocols'])
elif command == "SetManagerNic":
result = rf_utils.set_manager_nic(nic_addr, nic_config)
elif command == "SetHostInterface":
result = rf_utils.set_hostinterface_attributes(hostinterface_config, hostinterface_id)
2020-03-09 10:11:07 +01:00
# Return data back or fail with proper message
if result['ret'] is True:
if result.get('warning'):
module.warn(to_native(result['warning']))
2020-03-09 10:11:07 +01:00
module.exit_json(changed=result['changed'], msg=to_native(result['msg']))
else:
module.fail_json(msg=to_native(result['msg']))
if __name__ == '__main__':
main()