diff --git a/README.md b/README.md index 4f42d35..b028d34 100644 --- a/README.md +++ b/README.md @@ -13,5 +13,8 @@ This will enable the packing/deploying to client 'clouds'. 1. `choco install tfsec` +## Install your pre-commit hooks +1. `pre-commit install` + ## Running It! 1. `pre-commit run -a` \ No newline at end of file diff --git a/ahoskingit/terraform/dns_ahosking.tf b/ahoskingit/terraform/dns_ahosking.tf index 801586d..df1f30a 100644 --- a/ahoskingit/terraform/dns_ahosking.tf +++ b/ahoskingit/terraform/dns_ahosking.tf @@ -43,31 +43,14 @@ resource "cloudflare_record" "ahosking_home" { value = var.home_ip } -resource "cloudflare_record" "ahosking_code" { - zone_id = cloudflare_zone.ahosking_com.id - name = "code" - type = "CNAME" - ttl = "1" - value = join(".", [cloudflare_record.ahosking_home.name, cloudflare_zone.ahosking_com.zone]) - proxied = true -} - -resource "cloudflare_record" "ahosking_ombi" { - zone_id = cloudflare_zone.ahosking_com.id - name = "ombi.ahosking.com" - type = "CNAME" - ttl = "1" - value = join(".", [cloudflare_record.ahosking_home.name, cloudflare_zone.ahosking_com.zone]) - proxied = true -} - -resource "cloudflare_record" "ahosking_radarr" { - zone_id = cloudflare_zone.ahosking_com.id - name = "radarr.ahosking.com" - type = "CNAME" - ttl = "1" - value = join(".", [cloudflare_record.ahosking_home.name, cloudflare_zone.ahosking_com.zone]) - proxied = true +resource "cloudflare_record" "ahosking_cnames" { + for_each = toset(var.ahosking_com_cnames) + zone_id = cloudflare_zone.ahosking_com.id + name = each.key + type = "CNAME" + ttl = "1" + value = join(".", [cloudflare_record.ahosking_home.name, cloudflare_zone.ahosking_com.zone]) + proxied = true } # email MX value for DNS diff --git a/ahoskingit/terraform/dns_ahoskingit.tf b/ahoskingit/terraform/dns_ahoskingit.tf index 7fd0679..377c5aa 100644 --- a/ahoskingit/terraform/dns_ahoskingit.tf +++ b/ahoskingit/terraform/dns_ahoskingit.tf @@ -187,9 +187,9 @@ resource "cloudflare_record" "support_ahoskingit" { resource "cloudflare_record" "git_ahoskingit" { zone_id = cloudflare_zone.ahoskingit_com.id name = "git" - type = "A" - value = var.home_ip - #proxied = "true" + type = "CNAME" + value = join(".", [cloudflare_record.home_ahoskingit.name, cloudflare_zone.ahoskingit_com.zone]) + proxied = "true" } resource "cloudflare_record" "gitlab_ahoskingit" { diff --git a/ahoskingit/terraform/variables.tf b/ahoskingit/terraform/variables.tf index 2f617b1..86b97b8 100644 --- a/ahoskingit/terraform/variables.tf +++ b/ahoskingit/terraform/variables.tf @@ -38,3 +38,8 @@ variable "studi-odesign_ca" { default = "studi-odesign.ca" } #variable "vsphere_password" {} #variable "vsphere_server" {} variable "environment" {} + + +variable "ahosking_com_cnames" { + default = ["code", "radarr", "sonarr", "ombi", "git"] +} \ No newline at end of file