This repository has been archived by the owner on May 30, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
kubernetes-cluster.yml
100 lines (93 loc) · 2.46 KB
/
kubernetes-cluster.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
---
- hosts: kube-master
any_errors_fatal: true
gather_facts: true
become: true
tasks:
- import_role:
name: linux/version_check
- import_role:
name: linux/network
- import_role:
name: linux/docker
- import_role:
name: linux/kubernetes
- hosts: kube-minions-linux
any_errors_fatal: true
gather_facts: true
become: true
tasks:
- import_role:
name: linux/version_check
- import_role:
name: linux/network
- import_role:
name: linux/docker
- import_role:
name: linux/kubernetes
- hosts: kube-minions-linux
any_errors_fatal: true
gather_facts: true
become: true
serial: 1
tasks:
- include_tasks: roles/linux/kubernetes/tasks/set_ip_facts.yml
- name: Ensure /etc/hosts is updated on kube-master
lineinfile:
path: /etc/hosts
regexp: ' {{ ansible_hostname | lower }}$'
line: '{{ host_public_ip }} {{ ansible_hostname | lower }}'
delegate_to: "{{ item }}"
with_items: "{{ groups['kube-master'] }}"
- hosts: kube-minions-windows
remote_user: Administrator
gather_facts: true
become_method: runas
any_errors_fatal: true
tasks:
- set_fact:
windows_container_tag: 1809
when: ansible_kernel == windows2019
- import_role:
name: windows/version_check
- import_role:
name: windows/requirements
- import_role:
name: windows/docker
when: CONTAINER_RUNTIME == "docker"
- import_role:
name: windows/containerd
when: CONTAINER_RUNTIME == "containerd"
- import_role:
name: windows/kubernetes
- hosts: kube-minions-windows
remote_user: Administrator
gather_facts: true
become_method: runas
any_errors_fatal: true
serial: 1
tasks:
- name: Ensure /etc/hosts is updated on kube-master
become: true
become_method: sudo
lineinfile:
path: /etc/hosts
regexp: ' {{ ansible_hostname | lower }}$'
line: '{{ host_public_ip }} {{ ansible_hostname | lower }}'
delegate_to: "{{ item }}"
with_items: "{{ groups['kube-master'] }}"
# - hosts: kube-master:kube-minions-linux
# any_errors_fatal: true
# gather_facts: true
# become: true
# tasks:
# - import_role:
# name: linux/validation
# - hosts: kube-minions-windows
# remote_user: Administrator
# gather_facts: true
# become_method: runas
# any_errors_fatal: true
# tasks:
# - import_role:
# name: windows/validation