| 1 |
.. _ome_powerstate_module: |
| 2 |
|
| 3 |
|
| 4 |
ome_powerstate -- Performs the power management operations on OpenManage Enterprise |
| 5 |
=================================================================================== |
| 6 |
|
| 7 |
.. contents:: |
| 8 |
:local: |
| 9 |
:depth: 1 |
| 10 |
|
| 11 |
|
| 12 |
Synopsis |
| 13 |
-------- |
| 14 |
|
| 15 |
This module performs the supported power management operations on OpenManage Enterprise. |
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
Requirements |
| 20 |
------------ |
| 21 |
The below requirements are needed on the host that executes this module. |
| 22 |
|
| 23 |
- python \>= 3.9.6 |
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
Parameters |
| 28 |
---------- |
| 29 |
|
| 30 |
power_state (True, str, None) |
| 31 |
Desired end power state. |
| 32 |
|
| 33 |
|
| 34 |
device_service_tag (optional, str, None) |
| 35 |
Targeted device service tag. |
| 36 |
|
| 37 |
\ :emphasis:`device\_service\_tag`\ is mutually exclusive with \ :emphasis:`device\_id`\ . |
| 38 |
|
| 39 |
|
| 40 |
device_id (optional, int, None) |
| 41 |
Targeted device id. |
| 42 |
|
| 43 |
\ :emphasis:`device\_id`\ is mutually exclusive with \ :emphasis:`device\_service\_tag`\ . |
| 44 |
|
| 45 |
|
| 46 |
hostname (True, str, None) |
| 47 |
OpenManage Enterprise or OpenManage Enterprise Modular IP address or hostname. |
| 48 |
|
| 49 |
|
| 50 |
username (False, str, None) |
| 51 |
OpenManage Enterprise or OpenManage Enterprise Modular username. |
| 52 |
|
| 53 |
If the username is not provided, then the environment variable \ :envvar:`OME\_USERNAME`\ is used. |
| 54 |
|
| 55 |
Example: export OME\_USERNAME=username |
| 56 |
|
| 57 |
|
| 58 |
password (False, str, None) |
| 59 |
OpenManage Enterprise or OpenManage Enterprise Modular password. |
| 60 |
|
| 61 |
If the password is not provided, then the environment variable \ :envvar:`OME\_PASSWORD`\ is used. |
| 62 |
|
| 63 |
Example: export OME\_PASSWORD=password |
| 64 |
|
| 65 |
|
| 66 |
x_auth_token (False, str, None) |
| 67 |
Authentication token. |
| 68 |
|
| 69 |
If the x\_auth\_token is not provided, then the environment variable \ :envvar:`OME\_X\_AUTH\_TOKEN`\ is used. |
| 70 |
|
| 71 |
Example: export OME\_X\_AUTH\_TOKEN=x\_auth\_token |
| 72 |
|
| 73 |
|
| 74 |
port (optional, int, 443) |
| 75 |
OpenManage Enterprise or OpenManage Enterprise Modular HTTPS port. |
| 76 |
|
| 77 |
|
| 78 |
validate_certs (optional, bool, True) |
| 79 |
If \ :literal:`false`\ , the SSL certificates will not be validated. |
| 80 |
|
| 81 |
Configure \ :literal:`false`\ only on personally controlled sites where self-signed certificates are used. |
| 82 |
|
| 83 |
Prior to collection version \ :literal:`5.0.0`\ , the \ :emphasis:`validate\_certs`\ is \ :literal:`false`\ by default. |
| 84 |
|
| 85 |
|
| 86 |
ca_path (optional, path, None) |
| 87 |
The Privacy Enhanced Mail (PEM) file that contains a CA certificate to be used for the validation. |
| 88 |
|
| 89 |
|
| 90 |
timeout (optional, int, 30) |
| 91 |
The socket level timeout in seconds. |
| 92 |
|
| 93 |
|
| 94 |
|
| 95 |
|
| 96 |
|
| 97 |
Notes |
| 98 |
----- |
| 99 |
|
| 100 |
.. note:: |
| 101 |
- Run this module from a system that has direct access to Dell OpenManage Enterprise. |
| 102 |
- This module supports \ :literal:`check\_mode`\ . |
| 103 |
|
| 104 |
|
| 105 |
|
| 106 |
|
| 107 |
Examples |
| 108 |
-------- |
| 109 |
|
| 110 |
.. code-block:: yaml+jinja |
| 111 |
|
| 112 |
|
| 113 |
--- |
| 114 |
- name: Power state operation based on device id |
| 115 |
dellemc.openmanage.ome_powerstate: |
| 116 |
hostname: "192.168.0.1" |
| 117 |
username: "username" |
| 118 |
password: "password" |
| 119 |
ca_path: "/path/to/ca_cert.pem" |
| 120 |
device_id: 11111 |
| 121 |
power_state: "off" |
| 122 |
|
| 123 |
- name: Power state operation based on device service tag |
| 124 |
dellemc.openmanage.ome_powerstate: |
| 125 |
hostname: "192.168.0.1" |
| 126 |
username: "username" |
| 127 |
password: "password" |
| 128 |
ca_path: "/path/to/ca_cert.pem" |
| 129 |
device_service_tag: "KLBR111" |
| 130 |
power_state: "on" |
| 131 |
|
| 132 |
- name: Power state operation based on list of device ids |
| 133 |
dellemc.openmanage.ome_powerstate: |
| 134 |
hostname: "192.168.0.1" |
| 135 |
username: "username" |
| 136 |
password: "password" |
| 137 |
ca_path: "/path/to/ca_cert.pem" |
| 138 |
device_id: "{{ item.device_id }}" |
| 139 |
power_state: "{{ item.state }}" |
| 140 |
with_items: |
| 141 |
- { "device_id": 11111, "state": "on" } |
| 142 |
- { "device_id": 22222, "state": "off" } |
| 143 |
|
| 144 |
- name: Power state operation based on list of device service tags |
| 145 |
dellemc.openmanage.ome_powerstate: |
| 146 |
hostname: "192.168.0.1" |
| 147 |
username: "username" |
| 148 |
password: "password" |
| 149 |
ca_path: "/path/to/ca_cert.pem" |
| 150 |
device_service_tag: "{{ item.service_tag }}" |
| 151 |
power_state: "{{ item.state }}" |
| 152 |
with_items: |
| 153 |
- { "service_tag": "KLBR111", "state": "on" } |
| 154 |
- { "service_tag": "KLBR222", "state": "off" } |
| 155 |
|
| 156 |
|
| 157 |
|
| 158 |
Return Values |
| 159 |
------------- |
| 160 |
|
| 161 |
msg (always, str, Power State operation job submitted successfully.) |
| 162 |
Overall power state operation job status. |
| 163 |
|
| 164 |
|
| 165 |
job_status (success, dict, {'Builtin': False, 'CreatedBy': 'user', 'Editable': True, 'EndTime': None, 'Id': 11111, 'JobDescription': 'DeviceAction_Task', 'JobName': 'DeviceAction_Task_PowerState', 'JobStatus': {'Id': 1111, 'Name': 'New'}, 'JobType': {'Id': 1, 'Internal': False, 'Name': 'DeviceAction_Task'}, 'LastRun': '2019-04-01 06:39:02.69', 'LastRunStatus': {'Id': 1112, 'Name': 'Running'}, 'NextRun': None, 'Params': [{'JobId': 11111, 'Key': 'powerState', 'Value': '2'}, {'JobId': 11111, 'Key': 'operationName', 'Value': 'POWER_CONTROL'}], 'Schedule': '', 'StartTime': None, 'State': 'Enabled', 'Targets': [{'Data': '', 'Id': 11112, 'JobId': 11111, 'TargetType': {'Id': 1000, 'Name': 'DEVICE'}}], 'UpdatedBy': None, 'Visible': True}) |
| 166 |
Power state operation job and progress details from the OME. |
| 167 |
|
| 168 |
|
| 169 |
|
| 170 |
|
| 171 |
|
| 172 |
Status |
| 173 |
------ |
| 174 |
|
| 175 |
|
| 176 |
|
| 177 |
|
| 178 |
|
| 179 |
Authors |
| 180 |
~~~~~~~ |
| 181 |
|
| 182 |
- Felix Stephen (@felixs88) |
| 183 |
|