diff --git a/.terraform.lock.hcl b/.terraform.lock.hcl index d370574..96fd4c4 100644 --- a/.terraform.lock.hcl +++ b/.terraform.lock.hcl @@ -5,6 +5,7 @@ provider "registry.terraform.io/hetznercloud/hcloud" { version = "1.25.1" constraints = "1.25.1" hashes = [ + "h1:XW5O6di97cS0+ffDimANalLvQzlNuffnBFNMgjPNPZQ=", "h1:eZ6iSN6XxMX/BDClUnMB6r3Hm+JEJ3X07qH43JRK3WQ=", "zh:0057b6b5e8649227a92bb4e1f005f6001b3c3990caa6aef4b61be4dc10887035", "zh:166920d8adbb1424769faa5654274801a16c4945afda558f5314e1c3158cc109", diff --git a/main.tf b/main.tf index 02f0a06..36c980a 100644 --- a/main.tf +++ b/main.tf @@ -10,7 +10,7 @@ terraform { variable "hcloud_token" {} locals { - ssh_keys = ["mrcage"] + ssh_keys = ["mrcage", "glaubinix"] location = "nbg1" } @@ -95,7 +95,7 @@ resource "hcloud_server" "test" { ssh_keys = local.ssh_keys user_data = templatefile("cloud_config.yaml", { hostname = "test.etoa.net" - public_ip = "116.202.178.35" + public_ip = "116.202.178.35" # todo test doesn't have the floating IP anymore webapp_branch = "master" data_disk = hcloud_volume.test_data.linux_device }) @@ -116,3 +116,34 @@ resource "hcloud_volume_attachment" "test_data" { volume_id = hcloud_volume.test_data.id server_id = hcloud_server.test.id } + + +resource "hcloud_server" "round21" { + name = "round21.etoa.net" + image = "ubuntu-18.04" + server_type = "cx11" + location = local.location + ssh_keys = local.ssh_keys + user_data = templatefile("cloud_config.yaml", { + hostname = "round21.etoa.net" + public_ip = "116.202.178.35" + webapp_branch = "3.6-stable" + data_disk = hcloud_volume.round21_data.linux_device + }) + firewall_ids = [] + depends_on = [ + hcloud_volume.round21_data, + ] +} + +resource "hcloud_volume" "round21_data" { + name = "round21-data" + size = 10 + location = local.location + format = "ext4" +} + +resource "hcloud_volume_attachment" "round21_data" { + volume_id = hcloud_volume.round21_data.id + server_id = hcloud_server.round21.id +}