From 9572ac5ffbb869f59f354303556f90e86bd67bcc Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Fri, 23 Dec 2022 09:11:34 +0100 Subject: concourse --- terraform/concourse/concourse.tf | 4 ++-- terraform/concourse/dns.tf | 10 ++++++++++ terraform/concourse/main.tf | 4 ++++ 3 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 terraform/concourse/dns.tf (limited to 'terraform/concourse') diff --git a/terraform/concourse/concourse.tf b/terraform/concourse/concourse.tf index 28b6d21..9bbb3b4 100644 --- a/terraform/concourse/concourse.tf +++ b/terraform/concourse/concourse.tf @@ -31,7 +31,7 @@ resource "docker_container" "concourse" { } labels { label = "traefik.http.routers.concourse.rule" - value = "Host(`concourse.vpn.trygvis.io`)" + value = "Host(`${local.domain_name}`)" } labels { label = "traefik.http.routers.concourse.entrypoints" @@ -49,7 +49,7 @@ resource "docker_container" "concourse" { "CONCOURSE_POSTGRES_DATABASE=concourse", "CONCOURSE_POSTGRES_PORT=5432", "CONCOURSE_POSTGRES_SSLMODE=require", - "CONCOURSE_EXTERNAL_URL=https://concourse.vpn.trygvis.io", + "CONCOURSE_EXTERNAL_URL=https://${local.domain_name}", "CONCOURSE_WORKER_BAGGAGECLAIM_DRIVER=overlay", "CONCOURSE_CLIENT_SECRET=Y29uY291cnNlLXdlYgo=", "CONCOURSE_TSA_CLIENT_SECRET=Y29uY291cnNlLXdvcmtlcgo=", diff --git a/terraform/concourse/dns.tf b/terraform/concourse/dns.tf new file mode 100644 index 0000000..68e1764 --- /dev/null +++ b/terraform/concourse/dns.tf @@ -0,0 +1,10 @@ +data "linode_domain" "root" { + domain = "trygvis.io" +} + +resource "linode_domain_record" "concourse-vpn" { + domain_id = data.linode_domain.root.id + name = "concourse.vpn" + record_type = "CNAME" + target = local.domain_name +} diff --git a/terraform/concourse/main.tf b/terraform/concourse/main.tf index fc4b088..49bad5e 100644 --- a/terraform/concourse/main.tf +++ b/terraform/concourse/main.tf @@ -42,3 +42,7 @@ provider "ansiblevault" { data "docker_network" "traefik" { name = "traefik" } + +locals { + domain_name = "concourse.vpn.trygvis.io" +} -- cgit v1.2.3