add the rest of narwhal domains

main
Ricard Illa 2022-08-23 17:46:25 +02:00
parent a365c7831a
commit 115f391ab8
No known key found for this signature in database
GPG Key ID: F69A672B72E54902
1 changed files with 38 additions and 11 deletions

View File

@ -40,26 +40,53 @@ variable "caladan-hostnames" {
// letsencrypt certificates. No need to set the AAAA record. // letsencrypt certificates. No need to set the AAAA record.
variable "narwhal-hostnames" { variable "narwhal-hostnames" {
type = set(string) type = set(string)
default = ["authelia"] default = [
"authelia",
"calibre",
"dav",
"esphome",
"git.narwhal",
"gotify",
"grafana",
"hass",
"homer",
"influxdb",
"jellyfin",
"kodi",
"mirrors",
"mpd",
"music",
"nextcloud",
"nodered",
"openbooks",
"pg",
"rainloop",
"registry",
"rss-bridge",
"syncthing",
"transmission",
"wallabag",
"woodpecker",
]
} }
provider "namecheap" { provider "namecheap" {
user_name = "gthar" user_name = "gthar"
api_user = "gthar" api_user = "gthar"
client_ip = var.caladan-ips.v4 client_ip = var.caladan-ips.v4
use_sandbox = false use_sandbox = false
} }
resource "namecheap_domain_records" "monotremata-xyz" { resource "namecheap_domain_records" "monotremata-xyz" {
domain = "monotremata.xyz" domain = "monotremata.xyz"
mode = "MERGE" // maybe eventually move to OVERWRITE mode = "MERGE" // maybe eventually move to OVERWRITE
dynamic "record" { dynamic "record" {
for_each = var.caladan-hostnames for_each = var.caladan-hostnames
content { content {
hostname = record.value hostname = record.value
type = "A" type = "A"
address = var.caladan-ips.v4 address = var.caladan-ips.v4
} }
} }
@ -67,8 +94,8 @@ resource "namecheap_domain_records" "monotremata-xyz" {
for_each = var.narwhal-hostnames for_each = var.narwhal-hostnames
content { content {
hostname = record.value hostname = record.value
type = "A" type = "A"
address = var.caladan-ips.v4 address = var.caladan-ips.v4
} }
} }
@ -76,8 +103,8 @@ resource "namecheap_domain_records" "monotremata-xyz" {
for_each = var.caladan-hostnames for_each = var.caladan-hostnames
content { content {
hostname = record.value hostname = record.value
type = "AAAA" type = "AAAA"
address = var.caladan-ips.v6 address = var.caladan-ips.v6
} }
} }