community.general.ipmi_power module – Power management for machine
Note
This module is part of the community.general collection (version 4.8.3).
You might already have this collection installed if you are using the ansible
package.
It is not included in ansible-core
.
To check whether it is installed, run ansible-galaxy collection list
.
To install it, use: ansible-galaxy collection install community.general
.
To use it in a playbook, specify: community.general.ipmi_power
.
Requirements
The below requirements are needed on the host that executes this module.
python >= 2.6
pyghmi
Parameters
Parameter |
Comments |
---|---|
Encryption key to connect to the BMC in hex format. |
|
Provide a list of the remote target address for the bridge IPMI request, and the power status. Either this option or state is required. |
|
Whether to ensure that the machine specified by targetAddress in desired state. If this option is not set, the power state is set by state. If both this option and state are set, this option takes precedence over state. Choices:
|
|
Remote target address for the bridge IPMI request. |
|
Hostname or ip address of the BMC. |
|
Password to connect to the BMC. |
|
Remote RMCP port. Default: 623 |
|
Whether to ensure that the machine in desired state. The choices for state are: - on – Request system turn on - off – Request system turn off without waiting for OS to shutdown - shutdown – Have system request OS proper shutdown - reset – Request system reset without waiting for OS - boot – If system is off, then ‘on’, else ‘reset’ Either this option or machine is required. Choices:
|
|
Maximum number of seconds before interrupt request. Default: 300 |
|
Username to use to connect to the BMC. |
Examples
- name: Ensure machine is powered on
community.general.ipmi_power:
name: test.testdomain.com
user: admin
password: password
state: on
- name: Ensure machines of which remote target address is 48 and 50 are powered off
community.general.ipmi_power:
name: test.testdomain.com
user: admin
password: password
state: off
machine:
- targetAddress: 48
- targetAddress: 50
- name: Ensure machine of which remote target address is 48 is powered on, and 50 is powered off
community.general.ipmi_power:
name: test.testdomain.com
user: admin
password: password
machine:
- targetAddress: 48
state: on
- targetAddress: 50
state: off
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
The current power state of the machine. Returned: success and machine is not provided Sample: true |
|
The current power state of the machine when the machine option is set. Returned: success and machine is provided Sample: [{“powerstate”: “on”, “targetAddress”: 48}, {“powerstate”: “on”, “targetAddress”: 50}] |
|
The current power state of the machine specified by targetAddress. Returned: success |
|
The remote target address. Returned: success |
Authors
Bulat Gaifullin (@bgaifullin)
Collection links
Issue Tracker Repository (Sources) Submit a bug report Request a feature Communication