summaryrefslogtreecommitdiffstats
path: root/ansible_collections/dellemc/openmanage/roles/idrac_bios/README.md
blob: 25f439dc28023aafc133e13e4609b1f9393edb56 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
# idrac_bios

This role allows to modify BIOS attributes, clear pending BIOS attributes, and reset the BIOS to default settings.

## Requirements

---

Requirements to develop and contribute to the role.

### Development

```text
ansible
docker
molecule
python
```

### Production

Requirements to use the role.

```text
ansible
python
```

## Ansible collections

Collections required to use the role.

```text
dellemc.openmanage
```

## Role Variables

---

<table>
<thead>
  <tr>
    <th>Name</th>
    <th>Required</th>
    <th>Default Value</th>
    <th>Choices</th>
    <th>Type</th>
    <th>Description</th>
  </tr>
</thead>
<tbody>
  <tr>
    <td>hostname</td>
    <td>true</td>
    <td></td>
    <td></td>
    <td>str</td>
    <td>iDRAC IP Address</td>
  </tr>
  <tr>
    <td>username</td>
    <td>true</td>
    <td></td>
    <td></td>
    <td>str</td>
    <td>iDRAC username</td>
  </tr>
  <tr>
    <td>password</td>
    <td>true</td>
    <td></td>
    <td></td>
    <td>str</td>
    <td>iDRAC user password</td>
  </tr>
  <tr>
    <td>https_port</td>
    <td>false</td>
    <td>443</td>
    <td></td>
    <td>int</td>
    <td>iDRAC port</td>
  </tr>
  <tr>
    <td>validate_certs</td>
    <td>false</td>
    <td>true</td>
    <td></td>
    <td>bool</td>
    <td>
      - If C(false), the SSL certificates will not be validated. <br>
      - Configure C(false) only on personally controlled sites where self-signed certificates are used
    </td>
  </tr>
  <tr>
    <td>ca_path</td>
    <td>false</td>
    <td></td>
    <td></td>
    <td>path</td>
    <td>
      - The Privacy Enhanced Mail (PEM) file that contains a CA certificate to be used for the validation.
    </td>
  </tr>
  <tr>
    <td>https_timeout</td>
    <td>false</td>
    <td>30</td>
    <td></td>
    <td>int</td>
    <td>The socket level timeout in seconds.</td>
  </tr>
  <tr>
    <td>attributes</td>
    <td>false</td>
    <td></td>
    <td></td>
    <td>dict</td>
    <td>
      - "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>
      - This is mutually exclusive with I(reset_bios).
    </td>
  </tr>
  <tr>
    <td>apply_time</td>
    <td>false</td>
    <td>Immediate</td>
    <td>Immediate, OnReset, AtMaintenanceWindowStart, InMaintenanceWindowOnReset</td>
    <td>str</td>
    <td>
      - Apply time of the I(attributes). <br>
      - This is applicable only to I(attributes). <br>
      - C(Immediate) Allows the user to immediately reboot the host and apply the changes.
        I(job_wait) is applicable. <br>
      - C(OnReset) Allows the user to apply the changes on the next reboot of the host server. <br>
      - C(AtMaintenanceWindowStart) Allows the user to apply the changes at the start of a maintenance window as specifiedin
        I(maintenance_window). A reboot job will be scheduled. <br>
      - C(InMaintenanceWindowOnReset) Allows to apply the changes after a manual reset but within the maintenance window as specified in  
        I(maintenance_window).
    </td>
  </tr>
  <tr>
    <td>maintenance_window</td>
    <td>false</td>
    <td></td>
    <td></td>
    <td>dict</td>
    <td>
      - Option to schedule the maintenance window. <br>
      - This is required when I(apply_time) is C(AtMaintenanceWindowStart) or  
        C(InMaintenanceWindowOnReset).
    </td>
  </tr>
  <tr>
    <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;start_time</td>
    <td>true</td>
    <td></td>
    <td></td>
    <td>str</td>
    <td>
      - The start time for the maintenance window to be scheduled. <br>
      - The format is YYYY-MM-DDThh:mm:ss<offset>, <offset> is the time offset from UTC that  
        the current time zone set in iDRAC in the format: +05:30 for IST.
    </td>
  </tr>
  <tr>
    <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;duration</td>
    <td>true</td>
    <td></td>
    <td></td>
    <td>int</td>
    <td>
      - The duration in seconds for the maintenance window. <br>
    </td>
  </tr>
  <tr>
  <td>clear_pending</td>
  <td>false</td>
  <td></td>
  <td></td>
  <td>bool</td>
  <td>
    - Allows the user to clear all pending BIOS attributes changes. <br>
    - C(true) discards any pending changes to BIOS attributes or removes the job if in  
      scheduled state. <br>
    - This operation will not create any job. <br>
    - C(false) does not perform any operation. <br>
    - This is mutually exclusive with I(reset_bios). <br>
    - C(Note) Any BIOS job scheduled will not be cleared because of boot sources configuration. <br>
  </td>
</tr>
  <tr>
    <td>reset_bios</td>
    <td>false</td>
    <td></td>
    <td></td>
    <td>bool</td>
    <td>
      - Resets the BIOS to default settings and triggers a reboot of host system. <br>
      - This is applied to the host after the restart. <br>
      - This operation will not create any job. <br>
      - C(false) does not perform any operation. <br>
      - This is mutually exclusive with I(attributes), and I(clear_pending). <br>
      - When C(true), this action will always report as changes found to be applicable.
    </td>
  </tr>
  <tr>
    <td>reset_type</td>
    <td>false</td>
    <td>graceful_restart</td>
    <td>graceful_restart <br> force_restart</td>
    <td>str</td>
    <td>
      - C(force_restart) Forcefully reboot the host system. <br>
      - C(graceful_restart) Gracefully reboot the host system. <br>
      - This is applicable for I(reset_bios), and I(attributes) when I(apply_time) is  
        C(Immediate).
    </td>
  </tr>
  <tr>
    <td>job_wait</td>
    <td>false</td>
    <td>true</td>
    <td></td>
    <td>bool</td>
    <td>
      - Provides the option to wait for job completion. <br>
      - This is applicable for I(attributes) when I(apply_time) is C(Immediate). <br>
    </td>
  </tr>
  <tr>
    <td>job_wait_timeout</td>
    <td>false</td>
    <td>1200</td>
    <td></td>
    <td>int</td>
    <td>
      - The maximum wait time of I(job_wait) in seconds. <br>
        The job is tracked only for this duration. <br>
      - This option is applicable when I(job_wait) is C(True). <br>
    </td>
  </tr>
</tbody>
</table>

## Fact variables

<table>
<thead>
  <tr>
    <th>Name</th>
    <th>Sample</th>
    <th>Description</th>
  </tr>
</thead>
  <tbody>
    <tr>
      <td>idrac_bios_out</td>
      <td>{
  "attributes": {
    "ansible_facts": {},
    "changed": true,
    "failed": false,
    "job_id": "JID_XXXXXXXXXXXX",
    "msg": {
      "ActualRunningStartTime": "2023-05-19T04:55:01",
      "ActualRunningStopTime": "2023-05-19T04:59:21",
      "CompletionTime": "2023-05-19T04:59:21",
      "Description": "Job Instance",
      "EndTime": "TIME_NA",
      "Id": "JID_844899049402",
      "JobState": "Completed",
      "JobType": "BIOSConfiguration",
      "Message": "Job completed successfully.",
      "MessageArgs": [],
      "MessageId": "PR19",
      "Name": "Configure: BIOS.Setup.1-1",
      "PercentComplete": 100,
      "StartTime": "2023-05-19T04:51:44",
      "TargetSettingsURI": null
    },
    "status_msg": "Successfully applied the BIOS attributes update."
  },
  "clear_pending": {
    "changed": false,
    "skip_reason": "Conditional result was False",
    "skipped": true
  },
  "reset_bios": {
    "changed": false,
    "skip_reason": "Conditional result was False",
    "skipped": true
  }
}</td>
      <td>Module output of the idrac_bios job.</td>
    </tr>
  </tbody>
</table>

## Examples

---

```yaml
- name: Configure generic attributes of the BIOS
  ansible.builtin.import_role:
    name: idrac_bios
  vars:
    hostname: "192.168.0.1"
    username: "user_name"
    password: "user_password"
    ca_path: "/path/to/ca_cert.pem"
    attributes:
      BootMode : "Bios"
      OneTimeBootMode: "Enabled"
      BootSeqRetry: "Enabled"
```

```yaml
- name: Configure BIOS attributes at Maintenance window.
  ansible.builtin.import_role:
    name: idrac_bios
  vars:
    hostname: "192.168.0.1"
    username: "user_name"
    password: "user_password"
    ca_path: "/path/to/ca_cert.pem"
    apply_time: AtMaintenanceWindowStart
    maintenance_window:
      start_time: "2022-09-30T05:15:40-05:00"
      duration: 600
    attributes:
      BootMode : "Bios"
      OneTimeBootMode: "Enabled"
      BootSeqRetry: "Enabled"
```

```yaml
- name: Clear pending BIOS attributes.
  ansible.builtin.import_role:
    name: idrac_bios
  vars:
    hostname: "192.168.0.1"
    username: "user_name"
    password: "user_password"
    ca_path: "/path/to/ca_cert.pem"
    clear_pending: true
```

```yaml
- name: Reset BIOS attributes to default settings.
  ansible.builtin.import_role:
    name: idrac_bios
  vars:
    hostname: "192.168.0.1"
    username: "user_name"
    password: "user_password"
    ca_path: "/path/to/ca_cert.pem"
    reset_bios: true
```

## Author Information

---

Dell Technologies <br>
Abhishek Sinha (Abhishek.Sinha10@Dell.com) 2023