Compare commits

...

2 Commits

Author SHA1 Message Date
Ariadne Conill 1f871f55a7 fix DNS records
ci/woodpecker/push/dns Pipeline was successful Details
2022-07-17 20:19:22 +00:00
Ariadne Conill 25200dc9ec update to using glauca DNS
ci/woodpecker/push/dns Pipeline failed Details
2022-07-17 20:18:02 +00:00
1 changed files with 83 additions and 101 deletions

View File

@ -1,8 +1,8 @@
terraform {
required_providers {
linode = {
source = "linode/linode"
version = "1.26.0"
dns = {
source = "hashicorp/dns"
version = "3.2.3"
}
}
@ -16,162 +16,144 @@ terraform {
}
}
provider "linode" {
token = var.token
}
resource "linode_domain" "treehouse_domain" {
domain = "treehouse.systems"
soa_email = "admin@treehouse.systems"
type = "master"
provider "dns" {
update {
server = "ns1.as207960.net"
key_name = "treehouse.systems."
key_algorithm = "hmac-sha512"
key_secret = var.secret
}
}
// Treehouse cluster: kn-linode-dallas
// TODO(ariadne): Use linode data source to pull the kubernetes ingress
// IP addresses for this
resource "linode_domain_record" "kn_linode_dallas_ingress_v4" {
domain_id = "${linode_domain.treehouse_domain.id}"
resource "dns_a_record_set" "kn_linode_dallas_ingress_v4" {
zone = "treehouse.systems."
name = "kn-linode-dallas.ingress"
record_type = "A"
target = "50.116.20.32"
ttl_sec = 30
addresses = ["50.116.20.32"]
ttl = 3600
}
resource "linode_domain_record" "kn_linode_dallas_ingress_v6" {
domain_id = "${linode_domain.treehouse_domain.id}"
resource "dns_aaaa_record_set" "kn_linode_dallas_ingress_v6" {
zone = "treehouse.systems."
name = "kn-linode-dallas.ingress"
record_type = "AAAA"
target = "2600:3c00::f03c:93ff:fee2:d097"
ttl_sec = 30
addresses = ["2600:3c00::f03c:93ff:fee2:d097"]
ttl = 3600
}
// Treehouse cluster: kn-oci-sanjose
// TODO(ariadne): decommission me
resource "linode_domain_record" "kn_oci_sanjose_ingress_v4" {
domain_id = "${linode_domain.treehouse_domain.id}"
resource "dns_a_record_set" "kn_oci_sanjose_ingress_v4" {
zone = "treehouse.systems."
name = "kn-oci-sanjose.ingress"
record_type = "A"
target = "152.67.234.163"
ttl_sec = 30
addresses = ["152.67.234.163"]
ttl = 3600
}
resource "linode_domain_record" "kn_oci_sanjose_ingress_v6" {
domain_id = "${linode_domain.treehouse_domain.id}"
resource "dns_aaaa_record_set" "kn_oci_sanjose_ingress_v6" {
zone = "treehouse.systems."
name = "kn-oci-sanjose.ingress"
record_type = "AAAA"
target = "2603:c024:c000:100::80"
ttl_sec = 30
addresses = ["2603:c024:c000:100::80"]
ttl = 3600
}
// Treehouse services: Gitea
resource "linode_domain_record" "gitea_v4" {
domain_id = "${linode_domain.treehouse_domain.id}"
resource "dns_a_record_set" "gitea_v4" {
zone = "treehouse.systems."
name = "gitea"
record_type = "A"
target = "104.250.236.2"
ttl_sec = 30
addresses = ["104.250.236.2"]
ttl = 3600
}
resource "linode_domain_record" "gitea_v6" {
domain_id = "${linode_domain.treehouse_domain.id}"
resource "dns_aaaa_record_set" "gitea_v6" {
zone = "treehouse.systems."
name = "gitea"
record_type = "AAAA"
target = "2602:fd37:1:0:104:250:236:2"
ttl_sec = 30
addresses = ["2602:fd37:1:0:104:250:236:2"]
ttl = 3600
}
resource "linode_domain_record" "woodpecker_cname" {
domain_id = "${linode_domain.treehouse_domain.id}"
resource "dns_cname_record" "woodpecker_cname" {
zone = "treehouse.systems."
name = "woodpecker"
record_type = "CNAME"
target = "gitea.treehouse.systems"
ttl_sec = 30
cname = "gitea.treehouse.systems."
ttl = 3600
}
// Treehouse services: Mastodon (running on kn-linode-dallas)
resource "linode_domain_record" "social_cname" {
domain_id = "${linode_domain.treehouse_domain.id}"
resource "dns_cname_record" "social_cname" {
zone = "treehouse.systems."
name = "social"
record_type = "CNAME"
target = "kn-linode-dallas.ingress.treehouse.systems"
ttl_sec = 30
cname = "kn-linode-dallas.ingress.treehouse.systems."
ttl = 3600
}
resource "linode_domain_record" "cache_cname" {
domain_id = "${linode_domain.treehouse_domain.id}"
resource "dns_cname_record" "cache_cname" {
zone = "treehouse.systems."
name = "cache"
record_type = "CNAME"
target = "treehousesystems.b-cdn.net"
ttl_sec = 30
cname = "treehousesystems.b-cdn.net."
ttl = 3600
}
// Treehouse services: Discord redirector.
// TODO(ariadne): This is really now treehouse.systems/discord, but
// we need to keep this one for a while until it can be fully
// decommissioned.
resource "linode_domain_record" "discord_cname" {
domain_id = "${linode_domain.treehouse_domain.id}"
resource "dns_cname_record" "discord_cname" {
zone = "treehouse.systems."
name = "discord"
record_type = "CNAME"
target = "kn-oci-sanjose.ingress.treehouse.systems"
ttl_sec = 30
cname = "kn-oci-sanjose.ingress.treehouse.systems."
ttl = 3600
}
// Treehouse services: Minecraft (OVH, managed by Kenneth)
resource "linode_domain_record" "minecraft_cname" {
domain_id = "${linode_domain.treehouse_domain.id}"
resource "dns_cname_record" "minecraft_cname" {
zone = "treehouse.systems."
name = "survival.minecraft"
record_type = "CNAME"
target = "survival.treehouse.fork.run"
ttl_sec = 30
cname = "survival.treehouse.fork.run."
ttl = 3600
}
// Apex domain settings.
resource "linode_domain_record" "apex_v4" {
domain_id = "${linode_domain.treehouse_domain.id}"
name = ""
record_type = "A"
target = "152.67.234.163"
ttl_sec = 30
resource "dns_a_record_set" "apex_v4" {
zone = "treehouse.systems."
addresses = ["152.67.234.163"]
ttl = 3600
}
resource "linode_domain_record" "apex_v6" {
domain_id = "${linode_domain.treehouse_domain.id}"
name = ""
record_type = "AAAA"
target = "2603:c024:c000:100::80"
ttl_sec = 30
resource "dns_aaaa_record_set" "apex_v6" {
zone = "treehouse.systems."
addresses = ["2603:c024:c000:100::80"]
ttl = 3600
}
resource "linode_domain_record" "apex_mx" {
domain_id = "${linode_domain.treehouse_domain.id}"
name = ""
record_type = "MX"
target = "mx1.mailbun.net"
priority = "5"
ttl_sec = 30
resource "dns_mx_record_set" "apex_mx" {
zone = "treehouse.systems."
mx {
preference = 5
exchange = "mx1.mailbun.net."
}
ttl = 3600
}
resource "linode_domain_record" "apex_spf" {
domain_id = "${linode_domain.treehouse_domain.id}"
name = ""
record_type = "TXT"
target = "v=spf1 a mx include:spf.mailbun.net ~all"
ttl_sec = 30
resource "dns_txt_record_set" "apex_spf" {
zone = "treehouse.systems."
txt = ["v=spf1 a mx include:spf.mailbun.net ~all"]
ttl = 3600
}
resource "linode_domain_record" "apex_dmarc" {
domain_id = "${linode_domain.treehouse_domain.id}"
resource "dns_txt_record_set" "apex_dmarc" {
zone = "treehouse.systems."
name = "_dmarc"
record_type = "TXT"
target = "v=DMARC1; p=none; fo=1; rua=mailto:admin@treehouse.systems"
ttl_sec = 30
txt = ["v=DMARC1; p=none; fo=1; rua=mailto:admin@treehouse.systems"]
ttl = 3600
}
resource "linode_domain_record" "apex_domainkey" {
domain_id = "${linode_domain.treehouse_domain.id}"
resource "dns_txt_record_set" "apex_domainkey" {
zone = "treehouse.systems."
name = "mailbun._domainkey"
record_type = "TXT"
target = "v=DKIM1; k=rsa; s=email; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAlJGZN1aCAUd8CqyQA7Akzkvns+Wq/w70ft2xr0B8jFp0DtW8BtyLLAsErpIp5ZTDgReYGgL7cNcSsNQRn+d6ZaOBGlC/gH1T3KYfbsvavOdnbGx9gofi6x8I5QOOLhp7epK5YkaP/Igg58Zm0ni3jdeMCuX+qkJVqn2WVv8IcRtIA3zJrTYOW3lGCj1ieezl5ref+43mFvcUqidToR9XyHNmi1RowmWAofbZASXkNqZiR1P2Jw3s7q6p0fAEz6bODNOmngIlRAaKjBfDVezsaTeQJwsMg9g58GigVTSb9gMHRZon61yxWcCJtcivPug7xAVlVU+MMkDr7MfvUke5KQIDAQAB"
ttl_sec = 30
txt = ["v=DKIM1; k=rsa; s=email; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAlJGZN1aCAUd8CqyQA7Akzkvns+Wq/w70ft2xr0B8jFp0DtW8BtyLLAsErpIp5ZTDgReYGgL7cNcSsNQRn+d6ZaOBGlC/gH1T3KYfbsvavOdnbGx9gofi6x8I5QOOLhp7epK5YkaP/Igg58Zm0ni3jdeMCuX+qkJVqn2WVv8IcRtIA3zJrTYOW3lGCj1ieezl5ref+43mFvcUqidToR9XyHNmi1RowmWAofbZASXkNqZiR1P2Jw3s7q6p0fAEz6bODNOmngIlRAaKjBfDVezsaTeQJwsMg9g58GigVTSb9gMHRZon61yxWcCJtcivPug7xAVlVU+MMkDr7MfvUke5KQIDAQAB"]
ttl = 3600
}