| 1 | # idrac_bios |
| 2 | |
| 3 | This role allows to modify BIOS attributes, clear pending BIOS attributes, and reset the BIOS to default settings. |
| 4 | |
| 5 | ## Requirements |
| 6 | |
| 7 | --- |
| 8 | |
| 9 | Requirements to develop and contribute to the role. |
| 10 | |
| 11 | ### Development |
| 12 | |
| 13 | ```text |
| 14 | ansible |
| 15 | docker |
| 16 | molecule |
| 17 | python |
| 18 | ``` |
| 19 | |
| 20 | ### Production |
| 21 | |
| 22 | Requirements to use the role. |
| 23 | |
| 24 | ```text |
| 25 | ansible |
| 26 | python |
| 27 | ``` |
| 28 | |
| 29 | ## Ansible collections |
| 30 | |
| 31 | Collections required to use the role. |
| 32 | |
| 33 | ```text |
| 34 | dellemc.openmanage |
| 35 | ``` |
| 36 | |
| 37 | ## Role Variables |
| 38 | |
| 39 | --- |
| 40 | |
| 41 | <table> |
| 42 | <thead> |
| 43 | <tr> |
| 44 | <th>Name</th> |
| 45 | <th>Required</th> |
| 46 | <th>Default Value</th> |
| 47 | <th>Choices</th> |
| 48 | <th>Type</th> |
| 49 | <th>Description</th> |
| 50 | </tr> |
| 51 | </thead> |
| 52 | <tbody> |
| 53 | <tr> |
| 54 | <td>hostname</td> |
| 55 | <td>true</td> |
| 56 | <td></td> |
| 57 | <td></td> |
| 58 | <td>str</td> |
| 59 | <td>iDRAC IP Address</td> |
| 60 | </tr> |
| 61 | <tr> |
| 62 | <td>username</td> |
| 63 | <td>true</td> |
| 64 | <td></td> |
| 65 | <td></td> |
| 66 | <td>str</td> |
| 67 | <td>iDRAC username</td> |
| 68 | </tr> |
| 69 | <tr> |
| 70 | <td>password</td> |
| 71 | <td>true</td> |
| 72 | <td></td> |
| 73 | <td></td> |
| 74 | <td>str</td> |
| 75 | <td>iDRAC user password</td> |
| 76 | </tr> |
| 77 | <tr> |
| 78 | <td>https_port</td> |
| 79 | <td>false</td> |
| 80 | <td>443</td> |
| 81 | <td></td> |
| 82 | <td>int</td> |
| 83 | <td>iDRAC port</td> |
| 84 | </tr> |
| 85 | <tr> |
| 86 | <td>validate_certs</td> |
| 87 | <td>false</td> |
| 88 | <td>true</td> |
| 89 | <td></td> |
| 90 | <td>bool</td> |
| 91 | <td> |
| 92 | - If C(false), the SSL certificates will not be validated. <br> |
| 93 | - Configure C(false) only on personally controlled sites where self-signed certificates are used |
| 94 | </td> |
| 95 | </tr> |
| 96 | <tr> |
| 97 | <td>ca_path</td> |
| 98 | <td>false</td> |
| 99 | <td></td> |
| 100 | <td></td> |
| 101 | <td>path</td> |
| 102 | <td> |
| 103 | - The Privacy Enhanced Mail (PEM) file that contains a CA certificate to be used for the validation. |
| 104 | </td> |
| 105 | </tr> |
| 106 | <tr> |
| 107 | <td>https_timeout</td> |
| 108 | <td>false</td> |
| 109 | <td>30</td> |
| 110 | <td></td> |
| 111 | <td>int</td> |
| 112 | <td>The socket level timeout in seconds.</td> |
| 113 | </tr> |
| 114 | <tr> |
| 115 | <td>attributes</td> |
| 116 | <td>false</td> |
| 117 | <td></td> |
| 118 | <td></td> |
| 119 | <td>dict</td> |
| 120 | <td> |
| 121 | - "Dictionary of BIOS attributes and value pair. Attributes should be part of the Redfish Dell BIOS Attribute Registry. Use U(https://I(idrac_ip)/redfish/v1/Systems/System.Embedded.1/Bios) to view the Redfish URI." <br> |
| 122 | - This is mutually exclusive with I(reset_bios). |
| 123 | </td> |
| 124 | </tr> |
| 125 | <tr> |
| 126 | <td>apply_time</td> |
| 127 | <td>false</td> |
| 128 | <td>Immediate</td> |
| 129 | <td>Immediate, OnReset, AtMaintenanceWindowStart, InMaintenanceWindowOnReset</td> |
| 130 | <td>str</td> |
| 131 | <td> |
| 132 | - Apply time of the I(attributes). <br> |
| 133 | - This is applicable only to I(attributes). <br> |
| 134 | - C(Immediate) Allows the user to immediately reboot the host and apply the changes. |
| 135 | I(job_wait) is applicable. <br> |
| 136 | - C(OnReset) Allows the user to apply the changes on the next reboot of the host server. <br> |
| 137 | - C(AtMaintenanceWindowStart) Allows the user to apply the changes at the start of a maintenance window as specifiedin |
| 138 | I(maintenance_window). A reboot job will be scheduled. <br> |
| 139 | - C(InMaintenanceWindowOnReset) Allows to apply the changes after a manual reset but within the maintenance window as specified in |
| 140 | I(maintenance_window). |
| 141 | </td> |
| 142 | </tr> |
| 143 | <tr> |
| 144 | <td>maintenance_window</td> |
| 145 | <td>false</td> |
| 146 | <td></td> |
| 147 | <td></td> |
| 148 | <td>dict</td> |
| 149 | <td> |
| 150 | - Option to schedule the maintenance window. <br> |
| 151 | - This is required when I(apply_time) is C(AtMaintenanceWindowStart) or |
| 152 | C(InMaintenanceWindowOnReset). |
| 153 | </td> |
| 154 | </tr> |
| 155 | <tr> |
| 156 | <td> start_time</td> |
| 157 | <td>true</td> |
| 158 | <td></td> |
| 159 | <td></td> |
| 160 | <td>str</td> |
| 161 | <td> |
| 162 | - The start time for the maintenance window to be scheduled. <br> |
| 163 | - The format is YYYY-MM-DDThh:mm:ss<offset>, <offset> is the time offset from UTC that |
| 164 | the current time zone set in iDRAC in the format: +05:30 for IST. |
| 165 | </td> |
| 166 | </tr> |
| 167 | <tr> |
| 168 | <td> duration</td> |
| 169 | <td>true</td> |
| 170 | <td></td> |
| 171 | <td></td> |
| 172 | <td>int</td> |
| 173 | <td> |
| 174 | - The duration in seconds for the maintenance window. <br> |
| 175 | </td> |
| 176 | </tr> |
| 177 | <tr> |
| 178 | <td>clear_pending</td> |
| 179 | <td>false</td> |
| 180 | <td></td> |
| 181 | <td></td> |
| 182 | <td>bool</td> |
| 183 | <td> |
| 184 | - Allows the user to clear all pending BIOS attributes changes. <br> |
| 185 | - C(true) discards any pending changes to BIOS attributes or removes the job if in |
| 186 | scheduled state. <br> |
| 187 | - This operation will not create any job. <br> |
| 188 | - C(false) does not perform any operation. <br> |
| 189 | - This is mutually exclusive with I(reset_bios). <br> |
| 190 | - C(Note) Any BIOS job scheduled will not be cleared because of boot sources configuration. <br> |
| 191 | </td> |
| 192 | </tr> |
| 193 | <tr> |
| 194 | <td>reset_bios</td> |
| 195 | <td>false</td> |
| 196 | <td></td> |
| 197 | <td></td> |
| 198 | <td>bool</td> |
| 199 | <td> |
| 200 | - Resets the BIOS to default settings and triggers a reboot of host system. <br> |
| 201 | - This is applied to the host after the restart. <br> |
| 202 | - This operation will not create any job. <br> |
| 203 | - C(false) does not perform any operation. <br> |
| 204 | - This is mutually exclusive with I(attributes), and I(clear_pending). <br> |
| 205 | - When C(true), this action will always report as changes found to be applicable. |
| 206 | </td> |
| 207 | </tr> |
| 208 | <tr> |
| 209 | <td>reset_type</td> |
| 210 | <td>false</td> |
| 211 | <td>graceful_restart</td> |
| 212 | <td>graceful_restart <br> force_restart</td> |
| 213 | <td>str</td> |
| 214 | <td> |
| 215 | - C(force_restart) Forcefully reboot the host system. <br> |
| 216 | - C(graceful_restart) Gracefully reboot the host system. <br> |
| 217 | - This is applicable for I(reset_bios), and I(attributes) when I(apply_time) is |
| 218 | C(Immediate). |
| 219 | </td> |
| 220 | </tr> |
| 221 | <tr> |
| 222 | <td>job_wait</td> |
| 223 | <td>false</td> |
| 224 | <td>true</td> |
| 225 | <td></td> |
| 226 | <td>bool</td> |
| 227 | <td> |
| 228 | - Provides the option to wait for job completion. <br> |
| 229 | - This is applicable for I(attributes) when I(apply_time) is C(Immediate). <br> |
| 230 | </td> |
| 231 | </tr> |
| 232 | <tr> |
| 233 | <td>job_wait_timeout</td> |
| 234 | <td>false</td> |
| 235 | <td>1200</td> |
| 236 | <td></td> |
| 237 | <td>int</td> |
| 238 | <td> |
| 239 | - The maximum wait time of I(job_wait) in seconds. <br> |
| 240 | The job is tracked only for this duration. <br> |
| 241 | - This option is applicable when I(job_wait) is C(True). <br> |
| 242 | </td> |
| 243 | </tr> |
| 244 | </tbody> |
| 245 | </table> |
| 246 | |
| 247 | ## Fact variables |
| 248 | |
| 249 | <table> |
| 250 | <thead> |
| 251 | <tr> |
| 252 | <th>Name</th> |
| 253 | <th>Sample</th> |
| 254 | <th>Description</th> |
| 255 | </tr> |
| 256 | </thead> |
| 257 | <tbody> |
| 258 | <tr> |
| 259 | <td>idrac_bios_out</td> |
| 260 | <td>{ |
| 261 | "attributes": { |
| 262 | "ansible_facts": {}, |
| 263 | "changed": true, |
| 264 | "failed": false, |
| 265 | "job_id": "JID_XXXXXXXXXXXX", |
| 266 | "msg": { |
| 267 | "ActualRunningStartTime": "2023-05-19T04:55:01", |
| 268 | "ActualRunningStopTime": "2023-05-19T04:59:21", |
| 269 | "CompletionTime": "2023-05-19T04:59:21", |
| 270 | "Description": "Job Instance", |
| 271 | "EndTime": "TIME_NA", |
| 272 | "Id": "JID_844899049402", |
| 273 | "JobState": "Completed", |
| 274 | "JobType": "BIOSConfiguration", |
| 275 | "Message": "Job completed successfully.", |
| 276 | "MessageArgs": [], |
| 277 | "MessageId": "PR19", |
| 278 | "Name": "Configure: BIOS.Setup.1-1", |
| 279 | "PercentComplete": 100, |
| 280 | "StartTime": "2023-05-19T04:51:44", |
| 281 | "TargetSettingsURI": null |
| 282 | }, |
| 283 | "status_msg": "Successfully applied the BIOS attributes update." |
| 284 | }, |
| 285 | "clear_pending": { |
| 286 | "changed": false, |
| 287 | "skip_reason": "Conditional result was False", |
| 288 | "skipped": true |
| 289 | }, |
| 290 | "reset_bios": { |
| 291 | "changed": false, |
| 292 | "skip_reason": "Conditional result was False", |
| 293 | "skipped": true |
| 294 | } |
| 295 | }</td> |
| 296 | <td>Module output of the idrac_bios job.</td> |
| 297 | </tr> |
| 298 | </tbody> |
| 299 | </table> |
| 300 | |
| 301 | ## Examples |
| 302 | |
| 303 | --- |
| 304 | |
| 305 | ```yaml |
| 306 | - name: Configure generic attributes of the BIOS |
| 307 | ansible.builtin.import_role: |
| 308 | name: idrac_bios |
| 309 | vars: |
| 310 | hostname: "192.168.0.1" |
| 311 | username: "user_name" |
| 312 | password: "user_password" |
| 313 | ca_path: "/path/to/ca_cert.pem" |
| 314 | attributes: |
| 315 | BootMode : "Bios" |
| 316 | OneTimeBootMode: "Enabled" |
| 317 | BootSeqRetry: "Enabled" |
| 318 | ``` |
| 319 | |
| 320 | ```yaml |
| 321 | - name: Configure BIOS attributes at Maintenance window. |
| 322 | ansible.builtin.import_role: |
| 323 | name: idrac_bios |
| 324 | vars: |
| 325 | hostname: "192.168.0.1" |
| 326 | username: "user_name" |
| 327 | password: "user_password" |
| 328 | ca_path: "/path/to/ca_cert.pem" |
| 329 | apply_time: AtMaintenanceWindowStart |
| 330 | maintenance_window: |
| 331 | start_time: "2022-09-30T05:15:40-05:00" |
| 332 | duration: 600 |
| 333 | attributes: |
| 334 | BootMode : "Bios" |
| 335 | OneTimeBootMode: "Enabled" |
| 336 | BootSeqRetry: "Enabled" |
| 337 | ``` |
| 338 | |
| 339 | ```yaml |
| 340 | - name: Clear pending BIOS attributes. |
| 341 | ansible.builtin.import_role: |
| 342 | name: idrac_bios |
| 343 | vars: |
| 344 | hostname: "192.168.0.1" |
| 345 | username: "user_name" |
| 346 | password: "user_password" |
| 347 | ca_path: "/path/to/ca_cert.pem" |
| 348 | clear_pending: true |
| 349 | ``` |
| 350 | |
| 351 | ```yaml |
| 352 | - name: Reset BIOS attributes to default settings. |
| 353 | ansible.builtin.import_role: |
| 354 | name: idrac_bios |
| 355 | vars: |
| 356 | hostname: "192.168.0.1" |
| 357 | username: "user_name" |
| 358 | password: "user_password" |
| 359 | ca_path: "/path/to/ca_cert.pem" |
| 360 | reset_bios: true |
| 361 | ``` |
| 362 | |
| 363 | ## Author Information |
| 364 | |
| 365 | --- |
| 366 | |
| 367 | Dell Technologies <br> |
| 368 | Abhishek Sinha ([email protected]) 2023 |