Skip to content
Snippets Groups Projects
Verified Commit e67a1651 authored by Sheogorath's avatar Sheogorath :european_castle:
Browse files

terraform: Make IPv6 DNS entires optional

parent e26cc7b0
No related branches found
No related tags found
No related merge requests found
......@@ -25,7 +25,7 @@ resource "cloudflare_record" "dns-a" {
}
resource "cloudflare_record" "dns-aaaa" {
count = var.instance_count
count = var.enable_IPv6 == true ? var.instance_count : 0
zone_id = var.dns_zone_id
name = element(hcloud_server.server.*.name, count.index)
value = "${element(hcloud_server.server.*.ipv6_address, count.index)}1"
......@@ -41,7 +41,7 @@ resource "hcloud_rdns" "dns-ptr-ipv4" {
}
resource "hcloud_rdns" "dns-ptr-ipv6" {
count = var.instance_count
count = var.enable_IPv6 == true ? var.instance_count : 0
server_id = element(hcloud_server.server.*.id, count.index)
ip_address = "${element(hcloud_server.server.*.ipv6_address, count.index)}1"
dns_ptr = element(hcloud_server.server.*.name, count.index)
......
......@@ -94,3 +94,9 @@ variable "subnet" {
description = "Id of the additional internal network"
default = null
}
variable "enable_IPv6" {
type = bool
description = "Enable or disable setting up IPv6"
default = true
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment