Add playbooks for interactions with DRACs
Currently includes gathering facts, configuring the BIOS and setting the boot order (sadly not via the drac role).
This commit is contained in:
parent
54ff228bc3
commit
cd33e4a75f
2
.gitignore
vendored
2
.gitignore
vendored
@ -19,6 +19,8 @@ ansible/roles/ahuffman.resolv/
|
||||
ansible/roles/jriguera.configdrive/
|
||||
ansible/roles/mrlesmithjr.manage-lvm/
|
||||
ansible/roles/MichaelRigart.interfaces/
|
||||
ansible/roles/stackhpc.drac/
|
||||
ansible/roles/stackhpc.drac-facts/
|
||||
ansible/roles/resmo.ntp/
|
||||
ansible/roles/yatesr.timezone/
|
||||
|
||||
|
31
ansible/drac-bios.yml
Normal file
31
ansible/drac-bios.yml
Normal file
@ -0,0 +1,31 @@
|
||||
---
|
||||
- name: Ensure that controller BIOS are configured
|
||||
hosts: controllers
|
||||
gather_facts: no
|
||||
vars:
|
||||
bios_config:
|
||||
OneTimeBootMode: "OneTimeBootSeq"
|
||||
OneTimeBootSeqDev: NIC.Integrated.1-1-1
|
||||
roles:
|
||||
- role: stackhpc.drac
|
||||
drac_address: "{{ ipmi_address }}"
|
||||
drac_username: "{{ ipmi_username }}"
|
||||
drac_password: "{{ ipmi_password }}"
|
||||
drac_bios_config: "{{ bios_config }}"
|
||||
drac_reboot: True
|
||||
|
||||
tasks:
|
||||
- name: Ensure BIOS configuration is applied
|
||||
command: "racadm {{ item }}"
|
||||
with_items:
|
||||
- set Nic.NICConfig.1.LegacyBootProto NONE
|
||||
- jobqueue create NIC.Integrated.1-1-1 -s TIME_NOW
|
||||
- set Nic.NICConfig.2.LegacyBootProto NONE
|
||||
- jobqueue create NIC.Integrated.1-2-1 -s TIME_NOW
|
||||
- set Nic.NICConfig.3.LegacyBootProto PXE
|
||||
- jobqueue create NIC.Integrated.1-3-1 -s TIME_NOW
|
||||
- set Nic.NICConfig.4.LegacyBootProto NONE
|
||||
- jobqueue create NIC.Integrated.1-4-1 -s TIME_NOW
|
||||
- set BIOS.BiosBootSettings.bootseq NIC.Integrated.1-3-1,HardDisk.List.1-1,Optical.SATAEmbedded.J-1
|
||||
- jobqueue create BIOS.Setup.1-1
|
||||
- serveraction powercycle
|
27
ansible/drac-boot-order.yml
Normal file
27
ansible/drac-boot-order.yml
Normal file
@ -0,0 +1,27 @@
|
||||
---
|
||||
- name: Ensure that controller boot order is configured
|
||||
hosts: controllers
|
||||
gather_facts: no
|
||||
vars:
|
||||
ansible_host: "{{ ipmi_address }}"
|
||||
ansible_user: "{{ ipmi_username }}"
|
||||
ansible_ssh_pass: "{{ ipmi_password }}"
|
||||
drac_pxe_interface: 3
|
||||
drac_interfaces: [1, 2, 3, 4]
|
||||
tasks:
|
||||
- name: Ensure NIC boot protocol is configured
|
||||
raw: "racadm set Nic.NICConfig.{{ item }}.LegacyBootProto {% if item == drac_pxe_interface %}PXE{% else %}NONE{% endif %}"
|
||||
with_items: "{{ drac_interfaces }}"
|
||||
|
||||
- name: Ensure NIC configuration jobs are created
|
||||
raw: "racadm jobqueue create NIC.Integrated.1-{{ item }}-1 -s TIME_NOW"
|
||||
with_items: "{{ drac_interfaces }}"
|
||||
|
||||
- name: Ensure BIOS boot sequence is configured
|
||||
raw: "racadm set BIOS.BiosBootSettings.bootseq NIC.Integrated.1-{{ drac_pxe_interface }}-1,HardDisk.List.1-1,Optical.SATAEmbedded.J-1"
|
||||
|
||||
- name: Ensure BIOS configuration job is created
|
||||
raw: "racadm jobqueue create BIOS.Setup.1-1"
|
||||
|
||||
- name: Ensure server is rebooted
|
||||
raw: "racadm serveraction powercycle"
|
25
ansible/drac-facts.yml
Normal file
25
ansible/drac-facts.yml
Normal file
@ -0,0 +1,25 @@
|
||||
---
|
||||
- name: Ensure that controller BIOS are configured
|
||||
hosts: controllers
|
||||
gather_facts: no
|
||||
roles:
|
||||
# The role simply pulls in the drac_facts module.
|
||||
- role: stackhpc.drac-facts
|
||||
tasks:
|
||||
- name: Gather facts via DRAC
|
||||
local_action:
|
||||
module: drac_facts
|
||||
address: "{{ ipmi_address }}"
|
||||
username: "{{ ipmi_username }}"
|
||||
password: "{{ ipmi_password }}"
|
||||
register: result
|
||||
|
||||
- name: Display results
|
||||
debug:
|
||||
var: result
|
||||
|
||||
- name: Write facts to a file
|
||||
local_action:
|
||||
module: copy
|
||||
content: "{{ result }}"
|
||||
dest: "/tmp/drac-facts-{{ inventory_hostname }}.json"
|
@ -4,4 +4,6 @@
|
||||
- src: MichaelRigart.interfaces
|
||||
- src: mrlesmithjr.manage-lvm
|
||||
- src: resmo.ntp
|
||||
- src: stackhpc.drac
|
||||
- src: stackhpc.drac-facts
|
||||
- src: yatesr.timezone
|
||||
|
Loading…
x
Reference in New Issue
Block a user