archlinux.tf 9.5 KB
Newer Older
1
terraform {
2
  backend "pg" {
3
    schema_name = "terraform_remote_state_stage1"
4
  }
5
6
}

7
data "external" "hetzner_cloud_api_key" {
8
  program = ["${path.module}/../misc/get_key.py", "misc/vault_hetzner.yml", "hetzner_cloud_api_key", "--format", "json"]
9
}
10

11
12
data "hcloud_image" "archlinux" {
  with_selector = "custom_image=archlinux"
13
14
  most_recent   = true
  with_status   = ["available"]
15
16
17
}

provider "hcloud" {
18
  token = data.external.hetzner_cloud_api_key.result.hetzner_cloud_api_key
19
20
}

Sven-Hendrik Haase's avatar
Sven-Hendrik Haase committed
21
resource "hcloud_rdns" "quassel_ipv4" {
22
23
  server_id  = hcloud_server.quassel.id
  ip_address = hcloud_server.quassel.ipv4_address
24
  dns_ptr    = "quassel.archlinux.org"
25
26
}

Sven-Hendrik Haase's avatar
Sven-Hendrik Haase committed
27
28
29
30
31
32
resource "hcloud_rdns" "quassel_ipv6" {
  server_id  = hcloud_server.quassel.id
  ip_address = hcloud_server.quassel.ipv6_address
  dns_ptr    = "quassel.archlinux.org"
}

Jelle van der Waa's avatar
Jelle van der Waa committed
33
resource "hcloud_server" "quassel" {
34
  name        = "quassel.archlinux.org"
35
  image       = data.hcloud_image.archlinux.id
Jelle van der Waa's avatar
Jelle van der Waa committed
36
  server_type = "cx11"
37
38
39
  lifecycle {
    ignore_changes = [image]
  }
Jelle van der Waa's avatar
Jelle van der Waa committed
40
}
Jelle van der Waa's avatar
Jelle van der Waa committed
41

Sven-Hendrik Haase's avatar
Sven-Hendrik Haase committed
42
resource "hcloud_rdns" "phrik_ipv4" {
43
44
  server_id  = hcloud_server.phrik.id
  ip_address = hcloud_server.phrik.ipv4_address
Jelle van der Waa's avatar
Jelle van der Waa committed
45
46
47
  dns_ptr    = "phrik.archlinux.org"
}

Sven-Hendrik Haase's avatar
Sven-Hendrik Haase committed
48
49
50
51
52
53
resource "hcloud_rdns" "phrik_ipv6" {
  server_id  = hcloud_server.phrik.id
  ip_address = hcloud_server.phrik.ipv6_address
  dns_ptr    = "phrik.archlinux.org"
}

Jelle van der Waa's avatar
Jelle van der Waa committed
54
55
resource "hcloud_server" "phrik" {
  name        = "phrik.archlinux.org"
56
  image       = data.hcloud_image.archlinux.id
Jelle van der Waa's avatar
Jelle van der Waa committed
57
  server_type = "cx11"
58
59
60
  lifecycle {
    ignore_changes = [image]
  }
Jelle van der Waa's avatar
Jelle van der Waa committed
61
}
Jelle van der Waa's avatar
Jelle van der Waa committed
62

Sven-Hendrik Haase's avatar
Sven-Hendrik Haase committed
63
resource "hcloud_rdns" "bbs_ipv4" {
64
65
  server_id  = hcloud_server.bbs.id
  ip_address = hcloud_server.bbs.ipv4_address
Jelle van der Waa's avatar
Jelle van der Waa committed
66
67
68
  dns_ptr    = "bbs.archlinux.org"
}

Sven-Hendrik Haase's avatar
Sven-Hendrik Haase committed
69
70
71
72
73
74
resource "hcloud_rdns" "bbs_ipv6" {
  server_id  = hcloud_server.bbs.id
  ip_address = hcloud_server.bbs.ipv6_address
  dns_ptr    = "bbs.archlinux.org"
}

Jelle van der Waa's avatar
Jelle van der Waa committed
75
76
resource "hcloud_server" "bbs" {
  name        = "bbs.archlinux.org"
77
  image       = data.hcloud_image.archlinux.id
Jelle van der Waa's avatar
Jelle van der Waa committed
78
  server_type = "cx21"
79
80
81
82
83
  lifecycle {
    ignore_changes = [image]
  }
}

Sven-Hendrik Haase's avatar
Sven-Hendrik Haase committed
84
resource "hcloud_rdns" "gitlab_ipv4" {
85
86
  server_id  = hcloud_server.gitlab.id
  ip_address = hcloud_server.gitlab.ipv4_address
87
88
89
  dns_ptr    = "gitlab.archlinux.org"
}

Sven-Hendrik Haase's avatar
Sven-Hendrik Haase committed
90
91
92
93
94
95
resource "hcloud_rdns" "gitlab_ipv6" {
  server_id  = hcloud_server.gitlab.id
  ip_address = hcloud_server.gitlab.ipv6_address
  dns_ptr    = "gitlab.archlinux.org"
}

96
97
resource "hcloud_server" "gitlab" {
  name        = "gitlab.archlinux.org"
98
  image       = data.hcloud_image.archlinux.id
99
  server_type = "cx51"
100
101
102
  lifecycle {
    ignore_changes = [image]
  }
Jelle van der Waa's avatar
Jelle van der Waa committed
103
}
Sven-Hendrik Haase's avatar
Sven-Hendrik Haase committed
104

Sven-Hendrik Haase's avatar
Sven-Hendrik Haase committed
105
resource "hcloud_rdns" "matrix_ipv4" {
106
107
  server_id  = hcloud_server.matrix.id
  ip_address = hcloud_server.matrix.ipv4_address
Jelle van der Waa's avatar
Jelle van der Waa committed
108
109
110
  dns_ptr    = "matrix.archlinux.org"
}

Sven-Hendrik Haase's avatar
Sven-Hendrik Haase committed
111
112
113
114
115
116
resource "hcloud_rdns" "matrix_ipv6" {
  server_id  = hcloud_server.matrix.id
  ip_address = hcloud_server.matrix.ipv6_address
  dns_ptr    = "matrix.archlinux.org"
}

Jelle van der Waa's avatar
Jelle van der Waa committed
117
118
resource "hcloud_server" "matrix" {
  name        = "matrix.archlinux.org"
119
  image       = data.hcloud_image.archlinux.id
120
  server_type = "cpx31"
Jelle van der Waa's avatar
Jelle van der Waa committed
121
122
123
124
  lifecycle {
    ignore_changes = [image]
  }
}
125

Sven-Hendrik Haase's avatar
Sven-Hendrik Haase committed
126
resource "hcloud_rdns" "acccounts_ipv4" {
127
128
  server_id  = hcloud_server.accounts.id
  ip_address = hcloud_server.accounts.ipv4_address
129
130
131
  dns_ptr    = "accounts.archlinux.org"
}

Sven-Hendrik Haase's avatar
Sven-Hendrik Haase committed
132
133
134
135
136
137
resource "hcloud_rdns" "acccounts_ipv6" {
  server_id  = hcloud_server.accounts.id
  ip_address = hcloud_server.accounts.ipv6_address
  dns_ptr    = "accounts.archlinux.org"
}

138
139
resource "hcloud_server" "accounts" {
  name        = "accounts.archlinux.org"
140
  image       = data.hcloud_image.archlinux.id
141
  server_type = "cx11"
142
143
144
145
  provisioner "local-exec" {
    working_dir = ".."
    command = "ansible-playbook --ssh-extra-args '-o StrictHostKeyChecking=no' playbooks/accounts.archlinux.org.yml"
  }
146
147
148
149
  lifecycle {
    ignore_changes = [image]
  }
}
150

151
152
153
154
155
156
resource "hcloud_volume" "mirror" {
  name = "mirror"
  size = 100
  server_id = hcloud_server.mirror.id
}

Sven-Hendrik Haase's avatar
Sven-Hendrik Haase committed
157
resource "hcloud_rdns" "mirror_ipv4" {
158
159
  server_id  = hcloud_server.mirror.id
  ip_address = hcloud_server.mirror.ipv4_address
160
161
162
  dns_ptr    = "mirror.pkgbuild.com"
}

Sven-Hendrik Haase's avatar
Sven-Hendrik Haase committed
163
164
165
166
167
168
resource "hcloud_rdns" "mirror_ipv6" {
  server_id  = hcloud_server.mirror.id
  ip_address = hcloud_server.mirror.ipv6_address
  dns_ptr    = "mirror.pkgbuild.com"
}

169
170
resource "hcloud_server" "mirror" {
  name        = "mirror.pkgbuild.com"
171
  image       = data.hcloud_image.archlinux.id
172
173
174
175
176
  server_type = "cx11"
  lifecycle {
    ignore_changes = [image]
  }
}
177

Sven-Hendrik Haase's avatar
Sven-Hendrik Haase committed
178
resource "hcloud_rdns" "homedir_ipv4" {
179
180
181
182
183
  server_id  = hcloud_server.homedir.id
  ip_address = hcloud_server.homedir.ipv4_address
  dns_ptr    = "homedir.archlinux.org"
}

Sven-Hendrik Haase's avatar
Sven-Hendrik Haase committed
184
185
186
187
188
189
resource "hcloud_rdns" "homedir_ipv6" {
  server_id  = hcloud_server.homedir.id
  ip_address = hcloud_server.homedir.ipv6_address
  dns_ptr    = "homedir.archlinux.org"
}

190
191
192
193
194
195
196
197
198
199
200
201
202
203
resource "hcloud_server" "homedir" {
  name        = "homedir.archlinux.org"
  image       = data.hcloud_image.archlinux.id
  server_type = "cx11"
  lifecycle {
    ignore_changes = [image]
  }
}

resource "hcloud_volume" "homedir" {
  name = "homedir"
  size = 100
  server_id = hcloud_server.homedir.id
}
204

Sven-Hendrik Haase's avatar
Sven-Hendrik Haase committed
205
resource "hcloud_rdns" "bugs_ipv4" {
206
207
208
209
210
  server_id  = hcloud_server.bugs.id
  ip_address = hcloud_server.bugs.ipv4_address
  dns_ptr    = "bugs.archlinux.org"
}

Sven-Hendrik Haase's avatar
Sven-Hendrik Haase committed
211
212
213
214
215
216
resource "hcloud_rdns" "bugs_ipv6" {
  server_id  = hcloud_server.bugs.id
  ip_address = hcloud_server.bugs.ipv6_address
  dns_ptr    = "bugs.archlinux.org"
}

217
218
219
220
221
222
223
224
resource "hcloud_server" "bugs" {
  name        = "bugs.archlinux.org"
  image       = data.hcloud_image.archlinux.id
  server_type = "cx11"
  lifecycle {
    ignore_changes = [image]
  }
}
225

Sven-Hendrik Haase's avatar
Sven-Hendrik Haase committed
226
resource "hcloud_rdns" "aur_ipv4" {
227
228
229
230
231
  server_id  = hcloud_server.aur.id
  ip_address = hcloud_server.aur.ipv4_address
  dns_ptr    = "aur.archlinux.org"
}

Sven-Hendrik Haase's avatar
Sven-Hendrik Haase committed
232
233
234
235
236
237
resource "hcloud_rdns" "aur_ipv6" {
  server_id  = hcloud_server.aur.id
  ip_address = hcloud_server.aur.ipv6_address
  dns_ptr    = "aur.archlinux.org"
}

238
239
240
resource "hcloud_server" "aur" {
  name        = "aur.archlinux.org"
  image       = data.hcloud_image.archlinux.id
Sven-Hendrik Haase's avatar
Sven-Hendrik Haase committed
241
242
  server_type = "cpx41"
  keep_disk   = true
243
244
245
246
247
  lifecycle {
    ignore_changes = [image]
  }
}

Sven-Hendrik Haase's avatar
Sven-Hendrik Haase committed
248
resource "hcloud_rdns" "aur-dev_ipv4" {
249
250
251
252
253
  server_id  = hcloud_server.aur-dev.id
  ip_address = hcloud_server.aur-dev.ipv4_address
  dns_ptr    = "aur-dev.archlinux.org"
}

Sven-Hendrik Haase's avatar
Sven-Hendrik Haase committed
254
255
256
257
258
259
resource "hcloud_rdns" "aur-dev_ipv6" {
  server_id  = hcloud_server.aur-dev.id
  ip_address = hcloud_server.aur-dev.ipv6_address
  dns_ptr    = "aur-dev.archlinux.org"
}

260
261
262
263
264
265
266
267
resource "hcloud_server" "aur-dev" {
  name        = "aur-dev.archlinux.org"
  image       = data.hcloud_image.archlinux.id
  server_type = "cx11"
  lifecycle {
    ignore_changes = [image]
  }
}
268

Sven-Hendrik Haase's avatar
Sven-Hendrik Haase committed
269
resource "hcloud_rdns" "mailman3_ipv4" {
270
271
272
273
274
  server_id  = hcloud_server.mailman3.id
  ip_address = hcloud_server.mailman3.ipv4_address
  dns_ptr    = "mailman3.archlinux.org"
}

Sven-Hendrik Haase's avatar
Sven-Hendrik Haase committed
275
276
277
278
279
280
resource "hcloud_rdns" "mailman3_ipv6" {
  server_id  = hcloud_server.mailman3.id
  ip_address = hcloud_server.mailman3.ipv6_address
  dns_ptr    = "mailman3.archlinux.org"
}

281
282
283
284
285
286
287
288
289
resource "hcloud_server" "mailman3" {
  name        = "mailman3.archlinux.org"
  image       = data.hcloud_image.archlinux.id
  server_type = "cx11"
  lifecycle {
    ignore_changes = [image]
  }
}

Sven-Hendrik Haase's avatar
Sven-Hendrik Haase committed
290
resource "hcloud_rdns" "reproducible_ipv4" {
291
292
293
294
295
  server_id  = hcloud_server.reproducible.id
  ip_address = hcloud_server.reproducible.ipv4_address
  dns_ptr    = "reproducible.archlinux.org"
}

Sven-Hendrik Haase's avatar
Sven-Hendrik Haase committed
296
297
298
299
300
301
resource "hcloud_rdns" "reproducible_ipv6" {
  server_id  = hcloud_server.reproducible.id
  ip_address = hcloud_server.reproducible.ipv6_address
  dns_ptr    = "reproducible.archlinux.org"
}

302
303
304
305
306
307
308
309
resource "hcloud_server" "reproducible" {
  name        = "reproducible.archlinux.org"
  image       = data.hcloud_image.archlinux.id
  server_type = "cx11"
  lifecycle {
    ignore_changes = [image]
  }
}
310

Sven-Hendrik Haase's avatar
Sven-Hendrik Haase committed
311
resource "hcloud_rdns" "monitoring_ipv4" {
312
313
314
315
316
  server_id  = hcloud_server.monitoring.id
  ip_address = hcloud_server.monitoring.ipv4_address
  dns_ptr    = "monitoring.archlinux.org"
}

Sven-Hendrik Haase's avatar
Sven-Hendrik Haase committed
317
318
319
320
321
322
resource "hcloud_rdns" "monitoring_ipv6" {
  server_id  = hcloud_server.monitoring.id
  ip_address = hcloud_server.monitoring.ipv6_address
  dns_ptr    = "monitoring.archlinux.org"
}

323
324
325
326
327
328
329
330
resource "hcloud_server" "monitoring" {
  name        = "monitoring.archlinux.org"
  image       = data.hcloud_image.archlinux.id
  server_type = "cx11"
  lifecycle {
    ignore_changes = [image]
  }
}
331

Sven-Hendrik Haase's avatar
Sven-Hendrik Haase committed
332
resource "hcloud_rdns" "secure-runner2_ipv4" {
333
334
335
336
337
  server_id  = hcloud_server.secure-runner2.id
  ip_address = hcloud_server.secure-runner2.ipv4_address
  dns_ptr    = "secure-runner2.archlinux.org"
}

Sven-Hendrik Haase's avatar
Sven-Hendrik Haase committed
338
339
340
341
342
343
resource "hcloud_rdns" "secure-runner2_ipv6" {
  server_id  = hcloud_server.secure-runner2.id
  ip_address = hcloud_server.secure-runner2.ipv6_address
  dns_ptr    = "secure-runner2.archlinux.org"
}

344
345
346
347
348
349
350
351
352
resource "hcloud_server" "secure-runner2" {
  name        = "secure-runner2.archlinux.org"
  image       = data.hcloud_image.archlinux.id
  server_type = "cx11"
  lifecycle {
    ignore_changes = [image]
  }
}

353
354
355
356
357
358
359
360
resource "hcloud_server" "svn2gittest" {
  name        = "svn2gittest"
  image       = data.hcloud_image.archlinux.id
  server_type = "cx11"
  lifecycle {
    ignore_changes = [image]
  }
}
361

Sven-Hendrik Haase's avatar
Sven-Hendrik Haase committed
362
resource "hcloud_rdns" "mail_ipv4" {
Sven-Hendrik Haase's avatar
Sven-Hendrik Haase committed
363
364
  server_id  = hcloud_server.mail.id
  ip_address = hcloud_server.mail.ipv4_address
365
366
367
  dns_ptr    = "mail.archlinux.org"
}

Sven-Hendrik Haase's avatar
Sven-Hendrik Haase committed
368
369
370
371
372
373
resource "hcloud_rdns" "mail_ipv6" {
  server_id  = hcloud_server.mail.id
  ip_address = hcloud_server.mail.ipv6_address
  dns_ptr    = "mail.archlinux.org"
}

374
375
376
377
378
379
380
381
resource "hcloud_server" "mail" {
  name        = "mail.archlinux.org"
  image       = data.hcloud_image.archlinux.id
  server_type = "cx11"
  lifecycle {
    ignore_changes = [image]
  }
}