archlinux.tf 3.23 KB
Newer Older
1
terraform {
2
3
  backend "pg" {
  }
4
5
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

resource "hcloud_server" "ciprototype" {
  name        = "ciprototype.archlinux.org"
103
  image       = data.hcloud_image.archlinux.id
104
105
106
107
108
  server_type = "cx21"
  lifecycle {
    ignore_changes = [image]
  }
}
109
110

resource "hcloud_rdns" "acccounts" {
111
112
  server_id  = hcloud_server.accounts.id
  ip_address = hcloud_server.accounts.ipv4_address
113
114
115
116
117
  dns_ptr    = "accounts.archlinux.org"
}

resource "hcloud_server" "accounts" {
  name        = "accounts.archlinux.org"
118
  image       = data.hcloud_image.archlinux.id
119
120
121
122
123
  server_type = "cx11"
  lifecycle {
    ignore_changes = [image]
  }
}
124
125

resource "hcloud_rdns" "mirror" {
126
127
  server_id  = hcloud_server.mirror.id
  ip_address = hcloud_server.mirror.ipv4_address
128
129
130
131
132
  dns_ptr    = "mirror.pkgbuild.com"
}

resource "hcloud_server" "mirror" {
  name        = "mirror.pkgbuild.com"
133
  image       = data.hcloud_image.archlinux.id
134
135
136
137
138
  server_type = "cx11"
  lifecycle {
    ignore_changes = [image]
  }
}
139