dellemc.openmanage.redfish_powerstate (9.1.0) — module

Manage device power state

| "added in version" 2.1.0 of dellemc.openmanage"

Authors: Sajna Shetty(@Sajna-Shetty)

Install collection

Install with ansible-galaxy collection install dellemc.openmanage:==9.1.0


Add to requirements.yml

  collections:
    - name: dellemc.openmanage
      version: 9.1.0

Description

This module allows to manage the different power states of the specified device.


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
---
- name: Manage power state of the first device
  dellemc.openmanage.redfish_powerstate:
       baseuri: "192.168.0.1"
       username: "username"
       password: "password"
       ca_path: "/path/to/ca_cert.pem"
       reset_type: "On"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Manage power state of a specified device
  dellemc.openmanage.redfish_powerstate:
       baseuri: "192.168.0.1"
       username: "username"
       password: "password"
       ca_path: "/path/to/ca_cert.pem"
       reset_type: "ForceOff"
       resource_id: "System.Embedded.1"

Inputs

    
baseuri:
    description: IP address of the target out-of-band controller. For example- <ipaddress>:<port>.
    required: true
    type: str

ca_path:
    description:
    - The Privacy Enhanced Mail (PEM) file that contains a CA certificate to be used for
      the validation.
    type: path
    version_added: 5.0.0
    version_added_collection: dellemc.openmanage

timeout:
    default: 30
    description: The socket level timeout in seconds.
    type: int
    version_added: 5.0.0
    version_added_collection: dellemc.openmanage

password:
    description:
    - Password of the target out-of-band controller.
    - If the password is not provided, then the environment variable C(IDRAC_PASSWORD)
      is used.
    - 'Example: export IDRAC_PASSWORD=password'
    required: true
    type: str

username:
    description:
    - Username of the target out-of-band controller.
    - If the username is not provided, then the environment variable C(IDRAC_USERNAME)
      is used.
    - 'Example: export IDRAC_USERNAME=username'
    required: true
    type: str

reset_type:
    choices:
    - ForceOff
    - ForceOn
    - ForceRestart
    - GracefulRestart
    - GracefulShutdown
    - Nmi
    - 'On'
    - PowerCycle
    - PushPowerButton
    description:
    - This option resets the device.
    - If C(ForceOff), Turns off the device immediately.
    - If C(ForceOn), Turns on the device immediately.
    - If C(ForceRestart), Turns off the device immediately, and then restarts the device.
    - If C(GracefulRestart), Performs graceful shutdown of the device, and then restarts
      the device.
    - If C(GracefulShutdown), Performs a graceful shutdown of the device, and the turns
      off the device.
    - If C(Nmi), Sends a diagnostic interrupt to the device. This is usually a non-maskable
      interrupt (NMI) on x86 device.
    - If C(On), Turns on the device.
    - If C(PowerCycle), Performs power cycle on the device.
    - If C(PushPowerButton), Simulates the pressing of a physical power button on the
      device.
    - When a power control operation is performed, which is not supported on the device,
      an error message is displayed with the list of operations that can be performed.
    required: true
    type: str

resource_id:
    description:
    - The unique identifier of the device being managed. For example- U(https://<I(baseuri)>/redfish/v1/Systems/<I(resource_id)>).
    - This option is mandatory for I(base_uri) with multiple devices.
    - To get the device details, use the API U(https://<I(baseuri)>/redfish/v1/Systems).
    required: false
    type: str

validate_certs:
    default: true
    description:
    - If C(false), the SSL certificates will not be validated.
    - Configure C(false) only on personally controlled sites where self-signed certificates
      are used.
    - Prior to collection version C(5.0.0), the I(validate_certs) is C(false) by default.
    type: bool
    version_added: 5.0.0
    version_added_collection: dellemc.openmanage

Outputs

error_info:
  description: Details of the HTTP error.
  returned: on http error
  sample:
    error:
      '@Message.ExtendedInfo':
      - Message: Unable to complete the operation because the resource /redfish/v1/Systems/System.Embedded.1/Actions/ComputerSystem.Reset
          entered in not found.
        MessageArgs:
        - /redfish/v1/Systems/System.Embedded.1/Actions/ComputerSystem.Reset
        MessageArgs@odata.count: 1
        MessageId: IDRAC.2.1.SYS403
        RelatedProperties: []
        RelatedProperties@odata.count: 0
        Resolution: Enter the correct resource and retry the operation. For information
          about valid resource, see the Redfish Users Guide available on the support
          site.
        Severity: Critical
      code: Base.1.5.GeneralError
      message: A general error has occurred. See ExtendedInfo for more information
  type: dict
msg:
  description: Overall status of the reset operation.
  returned: always
  sample: Successfully performed the reset type operation 'On'.
  type: str