From 84519dc68ca5e4d3d73de76863e79c966a65622e Mon Sep 17 00:00:00 2001
From: Giancarlo Razzolini <grazzolini@archlinux.org>
Date: Fri, 18 Dec 2020 12:38:13 -0300
Subject: [PATCH] tf-stage1/archlinux: Escape the value on gitlab pages
 verification code

Escape the value, since TXT records need it.
---
 tf-stage1/archlinux.tf | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git a/tf-stage1/archlinux.tf b/tf-stage1/archlinux.tf
index 49dd6b476..5c7aaf441 100644
--- a/tf-stage1/archlinux.tf
+++ b/tf-stage1/archlinux.tf
@@ -1051,6 +1051,37 @@ resource "hcloud_server" "gitlab" {
   }
 }
 
+resource "hcloud_floating_ip" "gitlab_pages" {
+  type        = "ipv4"
+  description = "GitLab Pages"
+  server_id   = hcloud_server.gitlab.id
+}
+
+variable "gitlab_pages_ipv6" {
+  default = "2a01:4f8:c2c:5d2d::2"
+}
+
+resource "hetznerdns_record" "gitlab_pages_test_a" {
+  zone_id = hetznerdns_zone.archlinux.id
+  name    = "test"
+  value   = hcloud_floating_ip.gitlab_pages.ip_address
+  type    = "A"
+}
+
+resource "hetznerdns_record" "gitlab_pages_test_aaaa" {
+  zone_id = hetznerdns_zone.archlinux.id
+  name    = "test"
+  value   = var.gitlab_pages_ipv6
+  type    = "AAAA"
+}
+
+resource "hetznerdns_record" "gitlab_pages_test_verification" {
+  zone_id = hetznerdns_zone.archlinux.id
+  name    = "_gitlab-pages-verification-code.test"
+  value   = "\"gitlab-pages-verification-code=04ee0a6d7284e43a85bee57bf401bb03\""
+  type    = "TXT"
+}
+
 resource "hcloud_volume" "gitlab" {
   name      = "gitlab"
   size      = 1000
-- 
GitLab