Improve dns

This commit is contained in:
Tobias Reisinger 2024-10-02 00:24:11 +02:00
parent 48a4f72e4f
commit 5d10e75ade
Signed by: serguzim
GPG key ID: 13AD60C237A28DFE
3 changed files with 41 additions and 19 deletions

View file

@ -1,69 +1,89 @@
{ {
"*": { "catch-all-serguzim.me": {
"target": "*", "target": "*",
"domain": "serguzim.me", "domain": "serguzim.me",
"host": "node002" "host": "node002"
}, },
"auth": { "acme_dns": {
"target": "acme",
"domain": "serguzim.me",
"host": "node003"
},
"authentik": {
"target": "auth", "target": "auth",
"domain": "serguzim.me", "domain": "serguzim.me",
"host": "node002" "host": "node002"
}, },
"faas": { "openfaas": {
"target": "faas", "target": "faas",
"domain": "serguzim.me", "domain": "serguzim.me",
"host": "node002" "host": "node002"
}, },
"mail": { "mailcow": {
"target": "mail", "target": "mail",
"domain": "serguzim.me", "domain": "serguzim.me",
"host": "node003" "host": "node003"
}, },
"matrix": { "synapse": {
"target": "matrix", "target": "matrix",
"domain": "serguzim.me", "domain": "serguzim.me",
"host": "node002" "host": "node002"
}, },
"s3": { "linkwarden": {
"target": "bookmarks",
"domain": "serguzim.me",
"host": "node003"
},
"minio": {
"target": "s3", "target": "s3",
"domain": "serguzim.me", "domain": "serguzim.me",
"host": "node002" "host": "node002"
}, },
"s3-console": { "minio-console": {
"target": "console.s3", "target": "console.s3",
"domain": "serguzim.me", "domain": "serguzim.me",
"alias": "s3" "alias": "minio"
}, },
"serguzim.me": { "umami": {
"target": "analytics",
"domain": "serguzim.me",
"host": "node003"
},
"webpage-serguzim.me": {
"target": "@", "target": "@",
"domain": "serguzim.me", "domain": "serguzim.me",
"alias": "faas" "alias": "openfaas"
},
"wiki_js": {
"target": "wiki",
"domain": "serguzim.me",
"host": "node003"
}, },
"matrix_msrg": { "synapse_msrg.cc": {
"target": "matrix", "target": "matrix",
"domain": "msrg.cc", "domain": "msrg.cc",
"alias": "matrix" "alias": "synapse"
}, },
"link": { "shlink": {
"target": "@", "target": "@",
"domain": "msrg.cc", "domain": "msrg.cc",
"host": "node002" "host": "node002"
}, },
"link_msvg": { "shlink-msvg.cc": {
"target": "@", "target": "@",
"domain": "msvg.cc", "domain": "msvg.cc",
"alias": "link" "alias": "shlink"
}, },
"reitanlage": { "reitanlage_oranienburg": {
"target": "@", "target": "@",
"domain": "reitanlage-oranienburg.de", "domain": "reitanlage-oranienburg.de",
"host": "node002" "host": "node002"
}, },
"reitanlage_www": { "reitanlage_oranienburg-www": {
"target": "www", "target": "www",
"domain": "reitanlage-oranienburg.de", "domain": "reitanlage-oranienburg.de",
"alias": "reitanlage" "alias": "reitanlage_oranienburg"
} }
} }

View file

@ -85,7 +85,7 @@ D("serguzim.me", REG_OVH, DnsProvider(DSP_OVH),
"reitanlage-oranienburg.de" "reitanlage-oranienburg.de"
]), ]),
NS("acme", "node002.serguzim.net."), NS("acme", services["acme_dns"].resolve_host().fqdn + "."),
CNAME("db", "node002.vpn.serguzim.net."), CNAME("db", "node002.vpn.serguzim.net."),

View file

@ -2,6 +2,8 @@ output "hosts" {
value = { value = {
for subdomain in distinct([for record in ovh_domain_zone_record.server_records : record.subdomain]) : for subdomain in distinct([for record in ovh_domain_zone_record.server_records : record.subdomain]) :
subdomain => { subdomain => {
"hostname" = subdomain
"fqdn" = "${subdomain}.${ovh_domain_zone_record.server_records["${subdomain}:ipv4"].zone}"
"ipv4_address" = try( "ipv4_address" = try(
ovh_domain_zone_record.server_records["${subdomain}:ipv4"].target, ovh_domain_zone_record.server_records["${subdomain}:ipv4"].target,
null null