-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathipmi_pxe_boot.yaml
40 lines (36 loc) · 1.08 KB
/
ipmi_pxe_boot.yaml
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
- hosts: managedHosts
gather_facts: false
collections:
- community.general
tasks:
- name: Power off system
delegate_to: localhost
command:
cmd: >-
ipmitool -I lanplus -U "{{ bmcUser }}" -P "{{ bmcPassword }}"
-H "{{ bmcAddress }}" chassis power off
- name: Wait for power off
delegate_to: localhost
command:
cmd: >-
ipmitool -I lanplus -U "{{ bmcUser }}" -P "{{ bmcPassword }}"
-H "{{ bmcAddress }}" chassis power status
register: powerstate
until: >-
powerstate.stdout == "Chassis Power is off"
retries: 10
delay: 1
- name: Set PXE boot
delegate_to: localhost
command:
cmd: >-
ipmitool -I lanplus -U "{{ bmcUser }}" -P "{{ bmcPassword }}"
-H "{{ bmcAddress }}" chassis bootdev pxe
- pause:
seconds: 1
- name: Power on system
delegate_to: localhost
command:
cmd: >-
ipmitool -I lanplus -U "{{ bmcUser }}" -P "{{ bmcPassword }}"
-H "{{ bmcAddress }}" chassis power on