archlinux.tf 4.97 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", "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 = "cx31"
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

resource "hcloud_rdns" "mirror" {
116
117
  server_id  = hcloud_server.mirror.id
  ip_address = hcloud_server.mirror.ipv4_address
118
119
120
121
122
  dns_ptr    = "mirror.pkgbuild.com"
}

resource "hcloud_server" "mirror" {
  name        = "mirror.pkgbuild.com"
123
  image       = data.hcloud_image.archlinux.id
124
125
126
127
128
  server_type = "cx11"
  lifecycle {
    ignore_changes = [image]
  }
}
129

130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
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
}
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164

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]
  }
}
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179

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]
  }
}
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

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]
  }
}