-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreinstall_os_via_pxe.yml
33 lines (30 loc) · 1.13 KB
/
reinstall_os_via_pxe.yml
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
---
- hosts: boletus
become: true
gather_facts: false
tasks:
- name: set the machine to PXE boot on next reboot
command: ipmitool
-H {{ inventory_hostname_short
}}-ipmi.management.bos1.openelectronicslab.org
-U ADMIN -P ADMIN
chassis bootdev pxe
delegate_to: morchella0.bos1.openelectronicslab.org
- name: power down the machine
command: ipmitool
-H {{ inventory_hostname_short
}}-ipmi.management.bos1.openelectronicslab.org
-U ADMIN -P ADMIN
chassis power off
delegate_to: morchella0.bos1.openelectronicslab.org
- name: wait for the machine to power down
command: sleep 15
delegate_to: morchella0.bos1.openelectronicslab.org
run_once: True
- name: power on the machine
command: ipmitool
-H {{ inventory_hostname_short
}}-ipmi.management.bos1.openelectronicslab.org
-U ADMIN -P ADMIN
chassis power on
delegate_to: morchella0.bos1.openelectronicslab.org