archlinux.tf 1019 Bytes
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
13
14

# Find the id using `hcloud image list`
variable "archlinux_image_id" {
  default = "2923545"
}

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

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

Jelle van der Waa's avatar
Jelle van der Waa committed
24
resource "hcloud_server" "quassel" {
25
26
  name        = "quassel.archlinux.org"
  image       = "${var.archlinux_image_id}"
Jelle van der Waa's avatar
Jelle van der Waa committed
27
28
  server_type = "cx11"
}
Jelle van der Waa's avatar
Jelle van der Waa committed
29
30
31
32
33
34
35
36
37
38
39
40

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"
  image       = "${var.archlinux_image_id}"
  server_type = "cx11"
}