W3cubDocs

/Ansible 2.9

redfish_command – Manages Out-Of-Band controllers using Redfish APIs

New in version 2.7.

Synopsis

  • Builds Redfish URIs locally and sends them to remote OOB controllers to perform an action.
  • Manages OOB controller ex. reboot, log management.
  • Manages OOB controller users ex. add, remove, update.
  • Manages system power ex. on, off, graceful and forced reboot.

Parameters

Parameter Choices/Defaults Comments
baseuri
string / required
Base URI of OOB controller
boot_next
string
added in 2.9
BootNext target when bootdevice is "UefiBootNext"
bootdevice
string
bootdevice when setting boot configuration
category
string / required
Category to execute on OOB controller
command
list / required
List of commands to execute on OOB controller
id
string
added in 2.8
ID of user to add/delete/modify
new_password
string
added in 2.8
password of user to add/delete/modify
new_username
string
added in 2.8
name of user to add/delete/modify
password
string / required
Password for authentication with OOB controller
roleid
string
added in 2.8
role of user to add/delete/modify
timeout
integer
added in 2.8
Default:
10
Timeout in seconds for URL requests to OOB controller
uefi_target
string
added in 2.9
UEFI target when bootdevice is "UefiTarget"
username
string / required
added in 2.8
User for authentication with OOB controller

Examples

- name: Restart system power gracefully
  redfish_command:
    category: Systems
    command: PowerGracefulRestart
    baseuri: "{{ baseuri }}"
    username: "{{ username }}"
    password: "{{ password }}"

- name: Set one-time boot device to {{ bootdevice }}
  redfish_command:
    category: Systems
    command: SetOneTimeBoot
    bootdevice: "{{ bootdevice }}"
    baseuri: "{{ baseuri }}"
    username: "{{ username }}"
    password: "{{ password }}"

- name: Set one-time boot device to UefiTarget of "/0x31/0x33/0x01/0x01"
  redfish_command:
    category: Systems
    command: SetOneTimeBoot
    bootdevice: "UefiTarget"
    uefi_target: "/0x31/0x33/0x01/0x01"
    baseuri: "{{ baseuri }}"
    username: "{{ username }}"
    password: "{{ password }}"

- name: Set one-time boot device to BootNext target of "Boot0001"
  redfish_command:
    category: Systems
    command: SetOneTimeBoot
    bootdevice: "UefiBootNext"
    boot_next: "Boot0001"
    baseuri: "{{ baseuri }}"
    username: "{{ username }}"
    password: "{{ password }}"

- name: Set chassis indicator LED to blink
  redfish_command:
    category: Chassis
    command: IndicatorLedBlink
    baseuri: "{{ baseuri }}"
    username: "{{ username }}"
    password: "{{ password }}"

- name: Add and enable user
  redfish_command:
    category: Accounts
    command: AddUser,EnableUser
    baseuri: "{{ baseuri }}"
    username: "{{ username }}"
    password: "{{ password }}"
    id: "{{ id }}"
    new_username: "{{ new_username }}"
    new_password: "{{ new_password }}"
    roleid: "{{ roleid }}"

- name: Disable and delete user
  redfish_command:
    category: Accounts
    command: ["DisableUser", "DeleteUser"]
    baseuri: "{{ baseuri }}"
    username: "{{ username }}"
    password: "{{ password }}"
    id: "{{ id }}"

- name: Update user password
  redfish_command:
    category: Accounts
    command: UpdateUserPassword
    baseuri: "{{ baseuri }}"
    username: "{{ username }}"
    password: "{{ password }}"
    id: "{{ id }}"
    new_password: "{{ new_password }}"

- name: Clear Manager Logs with a timeout of 20 seconds
  redfish_command:
    category: Manager
    command: ClearLogs
    baseuri: "{{ baseuri }}"
    username: "{{ username }}"
    password: "{{ password }}"
    timeout: 20

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key Returned Description
msg
string
always
Message with action result or error description

Sample:
Action was successful


Status

Authors

  • Jose Delarosa (@jose-delarosa)

Hint

If you notice any issues in this documentation, you can edit this document to improve it.

© 2012–2018 Michael DeHaan
© 2018–2019 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/2.9/modules/redfish_command_module.html