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

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

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

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

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

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

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

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

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

resource "hcloud_server" "bbs" {
  name        = "bbs.archlinux.org"
57
  image       = "${data.hcloud_image.archlinux.id}"
Jelle van der Waa's avatar
Jelle van der Waa committed
58
  server_type = "cx21"
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
  lifecycle {
    ignore_changes = [image]
  }
}

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

resource "hcloud_server" "gitlab" {
  name        = "gitlab.archlinux.org"
  image       = "${data.hcloud_image.archlinux.id}"
  server_type = "cx21"
  lifecycle {
    ignore_changes = [image]
  }
Jelle van der Waa's avatar
Jelle van der Waa committed
77
}
Sven-Hendrik Haase's avatar
Sven-Hendrik Haase committed
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92

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

resource "hcloud_server" "ldap" {
  name        = "ldap.archlinux.org"
  image       = "${data.hcloud_image.archlinux.id}"
  server_type = "cx11"
  lifecycle {
    ignore_changes = [image]
  }
}
Jelle van der Waa's avatar
Jelle van der Waa committed
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107

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

resource "hcloud_server" "matrix" {
  name        = "matrix.archlinux.org"
  image       = "${data.hcloud_image.archlinux.id}"
  server_type = "cx21"
  lifecycle {
    ignore_changes = [image]
  }
}