archlinux.tf 6.72 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
}

21
resource "hcloud_rdns" "quassel" {
22
23
  server_id  = hcloud_server.quassel.id
  ip_address = hcloud_server.quassel.ipv4_address
24
  dns_ptr    = "quassel.archlinux.org"
25
26
}

Jelle van der Waa's avatar
Jelle van der Waa committed
27
resource "hcloud_server" "quassel" {
28
  name        = "quassel.archlinux.org"
29
  image       = data.hcloud_image.archlinux.id
Jelle van der Waa's avatar
Jelle van der Waa committed
30
  server_type = "cx11"
31
32
33
  lifecycle {
    ignore_changes = [image]
  }
Jelle van der Waa's avatar
Jelle van der Waa committed
34
}
Jelle van der Waa's avatar
Jelle van der Waa committed
35
36

resource "hcloud_rdns" "phrik" {
37
38
  server_id  = hcloud_server.phrik.id
  ip_address = hcloud_server.phrik.ipv4_address
Jelle van der Waa's avatar
Jelle van der Waa committed
39
40
41
42
43
  dns_ptr    = "phrik.archlinux.org"
}

resource "hcloud_server" "phrik" {
  name        = "phrik.archlinux.org"
44
  image       = data.hcloud_image.archlinux.id
Jelle van der Waa's avatar
Jelle van der Waa committed
45
  server_type = "cx11"
46
47
48
  lifecycle {
    ignore_changes = [image]
  }
Jelle van der Waa's avatar
Jelle van der Waa committed
49
}
Jelle van der Waa's avatar
Jelle van der Waa committed
50
51

resource "hcloud_rdns" "bbs" {
52
53
  server_id  = hcloud_server.bbs.id
  ip_address = hcloud_server.bbs.ipv4_address
Jelle van der Waa's avatar
Jelle van der Waa committed
54
55
56
57
58
  dns_ptr    = "bbs.archlinux.org"
}

resource "hcloud_server" "bbs" {
  name        = "bbs.archlinux.org"
59
  image       = data.hcloud_image.archlinux.id
Jelle van der Waa's avatar
Jelle van der Waa committed
60
  server_type = "cx21"
61
62
63
64
65
66
  lifecycle {
    ignore_changes = [image]
  }
}

resource "hcloud_rdns" "gitlab" {
67
68
  server_id  = hcloud_server.gitlab.id
  ip_address = hcloud_server.gitlab.ipv4_address
69
70
71
72
73
  dns_ptr    = "gitlab.archlinux.org"
}

resource "hcloud_server" "gitlab" {
  name        = "gitlab.archlinux.org"
74
  image       = data.hcloud_image.archlinux.id
75
  server_type = "cx51"
76
77
78
  lifecycle {
    ignore_changes = [image]
  }
Jelle van der Waa's avatar
Jelle van der Waa committed
79
}
Sven-Hendrik Haase's avatar
Sven-Hendrik Haase committed
80

Jelle van der Waa's avatar
Jelle van der Waa committed
81
resource "hcloud_rdns" "matrix" {
82
83
  server_id  = hcloud_server.matrix.id
  ip_address = hcloud_server.matrix.ipv4_address
Jelle van der Waa's avatar
Jelle van der Waa committed
84
85
86
87
88
  dns_ptr    = "matrix.archlinux.org"
}

resource "hcloud_server" "matrix" {
  name        = "matrix.archlinux.org"
89
  image       = data.hcloud_image.archlinux.id
90
  server_type = "cpx31"
Jelle van der Waa's avatar
Jelle van der Waa committed
91
92
93
94
  lifecycle {
    ignore_changes = [image]
  }
}
95

96
resource "hcloud_rdns" "acccounts" {
97
98
  server_id  = hcloud_server.accounts.id
  ip_address = hcloud_server.accounts.ipv4_address
99
100
101
102
103
  dns_ptr    = "accounts.archlinux.org"
}

resource "hcloud_server" "accounts" {
  name        = "accounts.archlinux.org"
104
  image       = data.hcloud_image.archlinux.id
105
  server_type = "cx11"
106
107
108
109
  provisioner "local-exec" {
    working_dir = ".."
    command = "ansible-playbook --ssh-extra-args '-o StrictHostKeyChecking=no' playbooks/accounts.archlinux.org.yml"
  }
110
111
112
113
  lifecycle {
    ignore_changes = [image]
  }
}
114

115
116
117
118
119
120
resource "hcloud_volume" "mirror" {
  name = "mirror"
  size = 100
  server_id = hcloud_server.mirror.id
}

121
resource "hcloud_rdns" "mirror" {
122
123
  server_id  = hcloud_server.mirror.id
  ip_address = hcloud_server.mirror.ipv4_address
124
125
126
127
128
  dns_ptr    = "mirror.pkgbuild.com"
}

resource "hcloud_server" "mirror" {
  name        = "mirror.pkgbuild.com"
129
  image       = data.hcloud_image.archlinux.id
130
131
132
133
134
  server_type = "cx11"
  lifecycle {
    ignore_changes = [image]
  }
}
135

136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
resource "hcloud_rdns" "homedir" {
  server_id  = hcloud_server.homedir.id
  ip_address = hcloud_server.homedir.ipv4_address
  dns_ptr    = "homedir.archlinux.org"
}

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
}
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170

resource "hcloud_rdns" "bugs" {
  server_id  = hcloud_server.bugs.id
  ip_address = hcloud_server.bugs.ipv4_address
  dns_ptr    = "bugs.archlinux.org"
}

resource "hcloud_server" "bugs" {
  name        = "bugs.archlinux.org"
  image       = data.hcloud_image.archlinux.id
  server_type = "cx11"
  lifecycle {
    ignore_changes = [image]
  }
}
171

172
173
174
175
176
177
178
179
180
resource "hcloud_rdns" "aur" {
  server_id  = hcloud_server.aur.id
  ip_address = hcloud_server.aur.ipv4_address
  dns_ptr    = "aur.archlinux.org"
}

resource "hcloud_server" "aur" {
  name        = "aur.archlinux.org"
  image       = data.hcloud_image.archlinux.id
181
  server_type = "cpx31"
182
183
184
185
186
  lifecycle {
    ignore_changes = [image]
  }
}

187
188
189
190
191
192
193
194
195
196
197
198
199
200
resource "hcloud_rdns" "aur-dev" {
  server_id  = hcloud_server.aur-dev.id
  ip_address = hcloud_server.aur-dev.ipv4_address
  dns_ptr    = "aur-dev.archlinux.org"
}

resource "hcloud_server" "aur-dev" {
  name        = "aur-dev.archlinux.org"
  image       = data.hcloud_image.archlinux.id
  server_type = "cx11"
  lifecycle {
    ignore_changes = [image]
  }
}
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

resource "hcloud_rdns" "mailman3" {
  server_id  = hcloud_server.mailman3.id
  ip_address = hcloud_server.mailman3.ipv4_address
  dns_ptr    = "mailman3.archlinux.org"
}

resource "hcloud_server" "mailman3" {
  name        = "mailman3.archlinux.org"
  image       = data.hcloud_image.archlinux.id
  server_type = "cx11"
  lifecycle {
    ignore_changes = [image]
  }
}

resource "hcloud_rdns" "reproducible" {
  server_id  = hcloud_server.reproducible.id
  ip_address = hcloud_server.reproducible.ipv4_address
  dns_ptr    = "reproducible.archlinux.org"
}

resource "hcloud_server" "reproducible" {
  name        = "reproducible.archlinux.org"
  image       = data.hcloud_image.archlinux.id
  server_type = "cx11"
  lifecycle {
    ignore_changes = [image]
  }
}
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245

resource "hcloud_rdns" "monitoring" {
  server_id  = hcloud_server.monitoring.id
  ip_address = hcloud_server.monitoring.ipv4_address
  dns_ptr    = "monitoring.archlinux.org"
}

resource "hcloud_server" "monitoring" {
  name        = "monitoring.archlinux.org"
  image       = data.hcloud_image.archlinux.id
  server_type = "cx11"
  lifecycle {
    ignore_changes = [image]
  }
}
246

247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
resource "hcloud_rdns" "secure-runner2" {
  server_id  = hcloud_server.secure-runner2.id
  ip_address = hcloud_server.secure-runner2.ipv4_address
  dns_ptr    = "secure-runner2.archlinux.org"
}

resource "hcloud_server" "secure-runner2" {
  name        = "secure-runner2.archlinux.org"
  image       = data.hcloud_image.archlinux.id
  server_type = "cx11"
  lifecycle {
    ignore_changes = [image]
  }
}

262
263
264
265
266
267
268
269
resource "hcloud_server" "svn2gittest" {
  name        = "svn2gittest"
  image       = data.hcloud_image.archlinux.id
  server_type = "cx11"
  lifecycle {
    ignore_changes = [image]
  }
}
270
271

resource "hcloud_rdns" "mail" {
Sven-Hendrik Haase's avatar
Sven-Hendrik Haase committed
272
273
  server_id  = hcloud_server.mail.id
  ip_address = hcloud_server.mail.ipv4_address
274
275
276
277
278
279
280
281
282
283
284
  dns_ptr    = "mail.archlinux.org"
}

resource "hcloud_server" "mail" {
  name        = "mail.archlinux.org"
  image       = data.hcloud_image.archlinux.id
  server_type = "cx11"
  lifecycle {
    ignore_changes = [image]
  }
}