-
Notifications
You must be signed in to change notification settings - Fork 0
/
playbook-kubeadm-add-new-worker.yml
38 lines (34 loc) · 1.31 KB
/
playbook-kubeadm-add-new-worker.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
---
- hosts: k8s-nodes
any_errors_fatal: true
pre_tasks:
- name: "Starting playbook to add worker nodes:"
debug:
msg:
- "Nodes: {{ groups['k8s-nodes'] }}"
- "Masters: {{ groups['masters'] }}"
- "Workers: {{ groups['workers'] }}"
- "Main-Master: {{ groups['masters'][0] }}"
when: "inventory_hostname == groups['masters'][0]"
- debug:
msg: "VM Operation System: \
{{ ansible_distribution }}{{ ansible_distribution_major_version}}"
- name: "Register main master that will be used to get all the data from"
set_fact:
main_master: "{{ groups['masters'][0] }}"
roles:
- { role: prep-node-vms,
when: "inventory_hostname in groups['workers']" }
# - { role: cockpit } # BROKEN IN CENTOS8
- { role: docker,
when: "inventory_hostname in groups['workers']" }
- { role: firewalld,
when: "inventory_hostname in groups['workers']" }
- { role: k8s-clusterconfiguration,
when: "inventory_hostname in groups['workers']" }
- { role: kubeadm-join-workers,
when: "inventory_hostname in groups['workers']" }
- { role: k8s-label-nodes,
when: "inventory_hostname in groups['workers']" }
- { role: k8s-ready-check,
when: "inventory_hostname in groups['workers']" }