-
Notifications
You must be signed in to change notification settings - Fork 39
/
25_pxeboot_vms.yml
55 lines (48 loc) · 1.6 KB
/
25_pxeboot_vms.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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
---
- name: PXE boot vms
hosts: vm_host
become: true
vars_files:
- vars/cluster_vars.yml
tasks:
- name: Restart NetworkManager service
ansible.builtin.service:
name: NetworkManager
state: restarted
- name: Restart OCP VMs sequentially
block:
- name: Shutdown bootstrap node
community.libvirt.virt:
name: "{{ hostvars[item].node_hostname }}"
state: destroyed
loop: "{{ groups['bootstrap'] }}"
- name: Shutdown master nodes
community.libvirt.virt:
name: "{{ hostvars[item].node_hostname }}"
state: destroyed
loop: "{{ groups['masters'] }}"
- name: Shutdown worker nodes
community.libvirt.virt:
name: "{{ hostvars[item].node_hostname }}"
state: destroyed
loop: "{{ groups['workers'] }}"
when: not three_node
- name: Restart bootstrap node
community.libvirt.virt:
name: "{{ hostvars[item].node_hostname }}"
state: running
loop: "{{ groups['bootstrap'] }}"
- name: Restart master nodes
community.libvirt.virt:
name: "{{ hostvars[item].node_hostname }}"
state: running
loop: "{{ groups['masters'] }}"
- name: Restart worker nodes
community.libvirt.virt:
name: "{{ hostvars[item].node_hostname }}"
state: running
loop: "{{ groups['workers'] }}"
when: not three_node
- name: State message
ansible.builtin.debug:
msg: All VMs are booting...