File tree Expand file tree Collapse file tree 2 files changed +21
-4
lines changed Expand file tree Collapse file tree 2 files changed +21
-4
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,11 @@ to function correctly.
14
14
Role Variables
15
15
--------------
16
16
17
- None
17
+ ` address ` : IP address or hostname of the iDRAC BMC.
18
+
19
+ ` username ` : Username credentials for the iDRAC.
20
+
21
+ ` password ` : Password credentials for the iDRAC.
18
22
19
23
Dependencies
20
24
------------
24
28
Example Playbook
25
29
----------------
26
30
27
- This role may be used as follows:
31
+ With the iDRAC BMCs in the inventory, this role may be used as follows:
28
32
29
- - hosts: dell-servers
33
+ - hosts: dell-server-bmcs
34
+ gather_facts: false
30
35
roles:
31
36
- role: stackhpc.drac-facts
32
37
tasks:
33
38
- name: Gather facts via DRAC
34
39
local_action:
35
40
module: drac_facts
36
- address: 1.2.3.4
41
+ address: "{{ ansible_host }}"
37
42
username: foo
38
43
password: bar
39
44
Original file line number Diff line number Diff line change @@ -165,6 +165,16 @@ def get_bios_settings(bmc):
165
165
return settings
166
166
167
167
168
+ def get_nic_settings (bmc ):
169
+ """Get all available NIC settings and permitted values.
170
+
171
+ :param bmc: A dracclient.client.DRACClient instance
172
+ :returns: A dict of NIC settings
173
+ """
174
+ nic_settings = bmc .list_nics ()
175
+ return nic_settings
176
+
177
+
168
178
def namedtuples_to_dicts (nts ):
169
179
"""Convert a list of namedtuples to a list of dicts.
170
180
@@ -209,11 +219,13 @@ def get_facts(module):
209
219
"""
210
220
bmc = build_client (module )
211
221
bios_settings = get_bios_settings (bmc )
222
+ nic_settings = get_nic_settings (bmc )
212
223
controllers , pdisks , vdisks = get_raid_config (bmc )
213
224
jobs = get_jobs (bmc , False )
214
225
unfinished_jobs = get_jobs (bmc , True )
215
226
return {
216
227
"drac_bios_settings" : bios_settings ,
228
+ "drac_nic_settings" : nic_settings ,
217
229
"drac_jobs" : jobs ,
218
230
"drac_unfinished_jobs" : unfinished_jobs ,
219
231
"drac_raid_controllers" : controllers ,
You can’t perform that action at this time.
0 commit comments