archlinux.tf 984 Bytes
Newer Older
1
2
3
4
terraform {
  backend "pg" {}
}

5
6
7
data "external" "hetzner_cloud_api_key" {
  program = ["bash", "${path.module}/misc/get_hetzner_cloud_api_key_terraform.sh"]
}
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" "bbs" {
19
  server_id  = "${hcloud_server.bbs.id}"
20
  ip_address = "${hcloud_server.bbs.ipv4_address}"
21
  dns_ptr    = "bbs.archlinux.org"
22
23
24
}

resource "hcloud_server" "bbs" {
25
26
  name        = "bbs.archlinux.org"
  image       = "${var.archlinux_image_id}"
27
28
  server_type = "cx11"
}
Jelle van der Waa's avatar
Jelle van der Waa committed
29

30
resource "hcloud_rdns" "quassel" {
31
  server_id  = "${hcloud_server.quassel.id}"
32
  ip_address = "${hcloud_server.quassel.ipv4_address}"
33
  dns_ptr    = "quassel.archlinux.org"
34
35
}

Jelle van der Waa's avatar
Jelle van der Waa committed
36
resource "hcloud_server" "quassel" {
37
38
  name        = "quassel.archlinux.org"
  image       = "${var.archlinux_image_id}"
Jelle van der Waa's avatar
Jelle van der Waa committed
39
40
  server_type = "cx11"
}