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