From 034acc666af7a2b9b15e0e2c1f883ab659eae770 Mon Sep 17 00:00:00 2001
From: Evangelos Foutras <evangelos@foutrelis.com>
Date: Mon, 18 Jul 2022 12:41:13 +0300
Subject: [PATCH] tf-stage1: add state.archlinux.org to machines

There's a bit of a chicken and egg situation here but it's preferable to
manage the server's attributes the same way as all of the cloud servers.
---
 tf-stage1/archlinux.tf | 9 +++++----
 tf-stage1/templates.tf | 1 +
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/tf-stage1/archlinux.tf b/tf-stage1/archlinux.tf
index 367ffe9ed..0b74ad590 100644
--- a/tf-stage1/archlinux.tf
+++ b/tf-stage1/archlinux.tf
@@ -149,6 +149,11 @@ locals {
       server_type = "cx11"
       domain      = "security"
     }
+    "state.archlinux.org" = {
+      server_type = "cx11"
+      domain      = "state"
+      backups     = true
+    }
     "wiki.archlinux.org" = {
       server_type = "cpx21"
       domain      = "wiki"
@@ -271,10 +276,6 @@ locals {
       ipv4_address = "116.202.134.150"
       ipv6_address = "2a01:4f8:231:4e1e::2"
     }
-    state = {
-      ipv4_address = "116.203.16.252"
-      ipv6_address = "2a01:4f8:c2c:474::1"
-    }
     www = {
       ipv4_address = hcloud_server.machine["archlinux.org"].ipv4_address
       ipv6_address = hcloud_server.machine["archlinux.org"].ipv6_address
diff --git a/tf-stage1/templates.tf b/tf-stage1/templates.tf
index 459f1561d..901da1ff9 100644
--- a/tf-stage1/templates.tf
+++ b/tf-stage1/templates.tf
@@ -148,6 +148,7 @@ resource "hcloud_server" "machine" {
   name               = each.key
   image              = data.hcloud_image.archlinux.id
   server_type        = each.value.server_type
+  backups            = lookup(local.machines[each.key], "backups", false)
   keep_disk          = true
   location           = "fsn1"
   delete_protection  = true
-- 
GitLab