feat: parametrize namecheap config
parent
53ff79a63a
commit
54838d400c
14
main.tf
14
main.tf
|
@ -13,6 +13,10 @@ terraform {
|
||||||
source = "vultr/vultr"
|
source = "vultr/vultr"
|
||||||
version = "2.11.4"
|
version = "2.11.4"
|
||||||
}
|
}
|
||||||
|
hetznerdns = {
|
||||||
|
source = "timohirt/hetznerdns"
|
||||||
|
version = ">=2.2.0"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -28,13 +32,21 @@ provider "vultr" {
|
||||||
|
|
||||||
module "dns" {
|
module "dns" {
|
||||||
source = "./modules/dns"
|
source = "./modules/dns"
|
||||||
|
|
||||||
|
nameservers = [
|
||||||
|
"ns1.linode.com",
|
||||||
|
"ns2.linode.com",
|
||||||
|
"ns3.linode.com",
|
||||||
|
"ns4.linode.com",
|
||||||
|
"ns5.linode.com"
|
||||||
|
]
|
||||||
|
|
||||||
domain = "monotremata.xyz"
|
domain = "monotremata.xyz"
|
||||||
|
|
||||||
caladan = {
|
caladan = {
|
||||||
ipv4 = "139.162.137.29"
|
ipv4 = "139.162.137.29"
|
||||||
ipv6 = "2a01:7e01::f03c:92ff:fea2:5d7c"
|
ipv6 = "2a01:7e01::f03c:92ff:fea2:5d7c"
|
||||||
domains = toset([
|
domains = toset([
|
||||||
"monotremata.xyz",
|
|
||||||
"git",
|
"git",
|
||||||
"gts",
|
"gts",
|
||||||
"kb",
|
"kb",
|
||||||
|
|
|
@ -1,18 +1,12 @@
|
||||||
provider "namecheap" {
|
provider "namecheap" {
|
||||||
user_name = "gthar"
|
user_name = "gthar"
|
||||||
api_user = "gthar"
|
api_user = "gthar"
|
||||||
client_ip = "139.162.137.29" // caladan's public IP
|
client_ip = var.caladan.ipv4 // caladan's public IP
|
||||||
use_sandbox = false
|
use_sandbox = false
|
||||||
}
|
}
|
||||||
|
|
||||||
resource "namecheap_domain_records" "namecheap-monotremata-xyz" {
|
resource "namecheap_domain_records" "namecheap-monotremata-xyz" {
|
||||||
domain = "monotremata.xyz"
|
domain = var.domain
|
||||||
mode = "OVERWRITE"
|
mode = "OVERWRITE"
|
||||||
nameservers = [
|
nameservers = var.nameservers
|
||||||
"ns1.linode.com",
|
|
||||||
"ns2.linode.com",
|
|
||||||
"ns3.linode.com",
|
|
||||||
"ns4.linode.com",
|
|
||||||
"ns5.linode.com"
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,3 +24,8 @@ variable "dkim_pub_key" {
|
||||||
type = string
|
type = string
|
||||||
description = "dkim public key"
|
description = "dkim public key"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
variable "nameservers" {
|
||||||
|
type = list(string)
|
||||||
|
description = "dns nameservers to use"
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue