W3cubDocs

/Ansible 2.7

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
required
Base URI of OOB controller
bootdevice
bootdevice when setting boot configuration
category
required
Category to execute on OOB controller
command
required
List of commands to execute on OOB controller
password
required
Password for authentication with OOB controller
user
required
User for authentication with OOB controller
userid
ID of user to add/delete/modify
username
name of user to add/delete/modify
userpswd
password of user to add/delete/modify
userrole
role of user to add/delete/modify

Examples

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

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

- name: Add and enable user
  redfish_command:
    category: Accounts
    command: AddUser,EnableUser
    baseuri: "{{ baseuri }}"
    user: "{{ user }}"
    password: "{{ password }}"
    userid: "{{ userid }}"
    username: "{{ username }}"
    userpswd: "{{ userpswd }}"
    userrole: "{{ userrole }}"

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

- name: Update user password
  redfish_command:
    category: Accounts
    command: UpdateUserPassword
    baseuri: "{{ baseuri }}"
    user: "{{ user }}"
    password: "{{ password }}"
    userid: "{{ userid }}"
    userpswd: "{{ userpswd }}"

- name: Clear Manager Logs
  redfish_command:
    category: Manager
    command: ClearLogs
    baseuri: "{{ baseuri }}"
    user: "{{ user }}"
    password: "{{ password }}"

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

This module is flagged as preview which means that it is not guaranteed to have a backwards compatible interface.

Maintenance

This module is flagged as community which means that it is maintained by the Ansible Community. See Module Maintenance & Support for more info.

For a list of other modules that are also maintained by the Ansible Community, see here.

Author

  • Jose Delarosa (github: jose-delarosa)

Hint

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

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