-
Notifications
You must be signed in to change notification settings - Fork 2
/
run.yaml
214 lines (193 loc) · 3.29 KB
/
run.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
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
---
- name: Setup OpenWrt router
hosts: router
gather_facts: false
remote_user: root
tags:
- never
- openwrt
roles:
- role: openwrt
- name: Configure base OS
hosts: metal
tags:
- controllers
- workers
roles:
- role: configure-os
- name: Setup backups
hosts: backups
tags:
- backups
roles:
- role: backups
- name: configure node
hosts:
- controllers
- workers
tags:
- cluster
- runtime
roles:
- role: kube-vip
tags:
- vip
when:
- inventory_hostname in groups['controllers']
- role: containerd
when: k8s_runtime == 'containerd'
- role: crio
when: k8s_runtime == 'crio'
- role: kubernetes
tags:
- k8s
- name: Install Helm
hosts:
- controllers
tags:
- cluster
- helm
roles:
- role: helm
- name: configure CNI
hosts:
- controllers
tags:
- cluster
- cni
roles:
- role: cilium
when:
- k8s_cni == 'cilium'
- inventory_hostname in k8s_controller
- name: Install nvidia drivers as needed
hosts:
- workers
vars:
nvidia_id: 10de
has_nvidia_card: false
tags:
- nvidia
pre_tasks:
- name: check for nvidia card
ansible.builtin.command:
cmd: "lspci -d {{ nvidia_id }}:"
register: nvidia_devices
- name: register has_nvidia_card
ansible.builtin.set_fact:
has_nvidia_card: true
when: '"VGA" in nvidia_devices.stdout'
roles:
- role: nvidia
when: has_nvidia_card
- name: Deploy MetalLB
hosts:
- controllers
tags:
- lb
- metallb
roles:
- role: metallb
when:
- inventory_hostname in k8s_controller
- name: Deploy Sealed Secrets
hosts:
- controllers
tags:
- cd
- secrets
roles:
- role: sealed-secrets
when:
- inventory_hostname in k8s_controller
- name: Deploy Argo CD
hosts:
- controllers
tags:
- cd
- argo
roles:
- role: argo
when:
- inventory_hostname in k8s_controller
- name: Deploy cert-manager
hosts:
- controllers
tags:
- certs
roles:
- role: cert-manager
when:
- inventory_hostname in k8s_controller
- name: Deploy ingress-nginx
hosts:
- ingress
tags:
- ingress
roles:
- role: ingress-nginx
when: "'ingress-nginx' in ingress_controllers"
- name: Wipe ceph drives
hosts:
- controllers
- workers
tags:
- never
- yes-really-wipe-the-ceph-drives
tasks:
- include_tasks: roles/rook/tasks/format-disks.yaml
- name: Deploy Rook ceph
hosts:
- controllers
- workers
tags:
- storage
- rook
- ceph
roles:
- role: chrony
- role: rook
- name: Deploy Free IPA
hosts:
- freeipa
tags:
- apps
- ipa
roles:
- role: freeipa
- name: Deploy Domain config
hosts:
- freeipa
tags:
- config
- domain
connection: local
become: false
roles:
- role: domain
- name: Deploy Keycloak
hosts:
- controllers
tags:
- auth
- config
roles:
- role: keycloak
when:
- inventory_hostname in k8s_controller
- name: Deploy Harbor
hosts:
- harbor
tags:
- harbor
roles:
- role: harbor
- name: Deploy gitea
hosts:
- gitea
tags:
- apps
- gitea
roles:
- role: gitea
...