-
Notifications
You must be signed in to change notification settings - Fork 3
/
day0.yml
337 lines (291 loc) · 6.63 KB
/
day0.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
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
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
---
# prep ssh keys
- hosts: localhost
gather_facts: false
become: true
any_errors_fatal: True
tasks:
- import_role:
name: common
tasks_from: pre_steps.yml
# only run this first one with specific tags
- hosts: ovh
gather_facts: false
become: True
any_errors_fatal: true
tasks:
- import_role:
name: ovh
tags: ['ovh_wipe', 'never']
- hosts: baremetal_hosts
gather_facts: true
become: True
any_errors_fatal: true
strategy: free
tags: ['host_pre']
tasks:
- import_role:
name: day0_pre
tags: ['day0_pre']
- import_role:
name: users
tags: ['users']
- import_role:
name: ssh_keys
tags: ['ssh_keys']
- import_role:
name: install_required_packages
tags: ['install_required_packages']
- import_role:
name: zerotier_networking
tags: ['zerotier_networking']
- import_role:
name: proxmox
tags: ['proxmox']
- import_role:
name: common
tasks_from: install_docker
- hosts:
- baremetal_hosts
# - ipa_hetzner
gather_facts: true
become: True
any_errors_fatal: true
serial: 1
tags: ['freeipa']
tasks:
- import_role:
name: freeipa
tags: ['freeipa']
- import_role:
name: freeipa_users
tags: ['freeipa_users']
- hosts: baremetal_hosts
gather_facts: true
become: True
any_errors_fatal: true
strategy: free
tags: ['wireguard']
tasks:
- import_role:
name: githubixx.ansible_role_wireguard
tags: ['wireguard']
# break out to clustering role which needs to be linear
- hosts: baremetal_hosts
gather_facts: false
become: True
any_errors_fatal: true
# serial is used to run in sequence - i.e. one host at a time
serial: 1
tags: ['phase2']
tasks:
- import_role:
name: proxmox_clustering
tags: ['proxmox_clustering']
- hosts: baremetal_hosts
gather_facts: true
become: True
any_errors_fatal: true
strategy: free
tags: ['networking']
tasks:
- import_role:
name: networking
tags: ['networking']
- import_role:
name: firewall
tags: ['firewall']
- hosts: baremetal_hosts
gather_facts: true
become: True
any_errors_fatal: true
strategy: free
tags: ['lxd']
tasks:
- import_role:
name: lxd
tags: ['lxd']
# serial run
- hosts: baremetal_hosts
gather_facts: true
become: True
any_errors_fatal: true
tags: ['overlay_networking']
serial: 1
tasks:
- import_role:
name: networking_nebula
tags: ['networking_nebula']
- hosts: baremetal_hosts
gather_facts: true
become: True
any_errors_fatal: true
serial: 1
tags: ['dhcp_servers']
tasks:
- import_role:
name: bertvv.dhcp
tags: ['dhcp_servers']
- hosts: baremetal_hosts
gather_facts: true
become: True
any_errors_fatal: false
strategy: linear
tags: ['storage_zfs']
tasks:
- import_role:
name: storage_zfs
tags: ['storage_zfs']
- hosts: baremetal_hosts
gather_facts: true
become: True
any_errors_fatal: false
strategy: linear
tags: ['storage_proxmox']
tasks:
- import_role:
name: storage_proxmox
tags: ['storage_proxmox']
- hosts: baremetal_hosts
gather_facts: true
become: True
any_errors_fatal: true
strategy: linear
tags: ['storage']
tasks:
- import_role:
name: storage_configuration
tags: ['storage']
# - import_role:
# name: storage_linstor
# tags: ['storage_linstor']
- hosts: baremetal_hosts
gather_facts: true
become: True
any_errors_fatal: true
strategy: linear
tags: ['vm_pre']
tasks:
- import_role:
name: proxmox_vm
tags: ['proxmox_vm']
- hosts: terraform_control
gather_facts: false
become: True
any_errors_fatal: true
tags: ['vm_deploy']
tasks:
- import_role:
name: terraform
tags: ['terraform_deploy']
- hosts: terraform_control
gather_facts: false
become: True
any_errors_fatal: true
tasks:
- import_role:
name: terraform_destroy
tags: ['terraform_destroy']
# Virtual Machines prep
- hosts: virtual_machines
gather_facts: false
become: True
tags: ['vm_post']
#any_errors_fatal: true
tasks:
- import_role:
name: vm_networking
tags: ['vm_networking']
- import_role:
name: install_required_packages
tags: ['install_required_packages']
- import_playbook: playbooks/run_once/configure_teleport_servers.yml
tags: ['gravitational_teleport']
# enroll to freeipa
- hosts: ipa_clients
gather_facts: true
become: True
any_errors_fatal: true
tags: ['freeipa_client']
tasks:
- import_role:
name: freeipa_client
tags: ['freeipa_client']
- import_playbook: playbooks/run_once/vm_configuration_kubernetes.yml
tags: ['k3s_deploy']
- hosts: baremetal_hosts
gather_facts: false
become: True
any_errors_fatal: true
tags: ['docker_baremetal']
tasks:
- import_role:
name: docker
tags: 'docker_baremetal'
- hosts: docker_hosts
gather_facts: false
become: True
any_errors_fatal: true
tags: ['docker']
tasks:
- import_role:
name: common
tasks_from: install_docker
- hosts: pritunl_servers
gather_facts: false
become: True
any_errors_fatal: true
tags: ['pritunl_server']
tasks:
- import_role:
name: install_required_packages
tasks_from: install_baseline_packages_vm
# install FRR on auth server as it is advertising anycast loopback to the host with eBGP
- include_role: # loop through to pull in multiple tasks (only works with include)
name: networking
tasks_from: '{{ item }}'
loop:
- install_frr
- configure_frr_anycast_vm
- import_role:
name: openvpn_pritunl
tags: ['pritunl_server']
- hosts: kubernetes_master
gather_facts: true
become: True
any_errors_fatal: true
tags: ['k3s_apps']
tasks:
- import_role:
name: rancher
tags: ['rancher']
- hosts: baremetal_hosts
gather_facts: true
become: True
any_errors_fatal: false
tags: ['miscellaneous_docker']
tasks:
- import_role:
name: webtop
tags: ['webtop']
- import_role:
name: portainer
tags: ['portainer']
- hosts: baremetal_hosts
gather_facts: true
become: True
any_errors_fatal: false
#tags: ['miscellaneous_docker']
tasks:
- import_role:
name: elasticsearch
tags: ['elasticsearch']
- hosts: baremetal_hosts
gather_facts: true
become: True
any_errors_fatal: false
tags: ['networking_docker_bridges']
tasks:
- import_role:
name: networking_docker_bridges
tags: ['networking_docker_bridges']