mirror of
https://github.com/2martens/terraform.git
synced 2026-10-17 18:06:52 +02:00
change: Add rdns for load balancer
This commit is contained in:
@@ -17,6 +17,22 @@ resource "hcloud_load_balancer_network" "private" {
|
|||||||
ip = var.loadbalancer_ip
|
ip = var.loadbalancer_ip
|
||||||
}
|
}
|
||||||
|
|
||||||
|
resource "hcloud_rdns" "ipv4_load_balancer" {
|
||||||
|
count = var.number_nodes > 1 ? 1 : 0
|
||||||
|
|
||||||
|
load_balancer_id = hcloud_load_balancer.docker[count.index].id
|
||||||
|
ip_address = hcloud_load_balancer.docker[count.index].ipv4
|
||||||
|
dns_ptr = local.docker_network_domain
|
||||||
|
}
|
||||||
|
|
||||||
|
resource "hcloud_rdns" "ipv6_load_balancer" {
|
||||||
|
count = var.number_nodes > 1 ? 1 : 0
|
||||||
|
|
||||||
|
load_balancer_id = hcloud_load_balancer.docker[count.index].id
|
||||||
|
ip_address = hcloud_load_balancer.docker[count.index].ipv6
|
||||||
|
dns_ptr = local.docker_network_domain
|
||||||
|
}
|
||||||
|
|
||||||
resource "hcloud_load_balancer_target" "nodes" {
|
resource "hcloud_load_balancer_target" "nodes" {
|
||||||
count = var.number_nodes > 1 ? var.number_nodes : 0
|
count = var.number_nodes > 1 ? var.number_nodes : 0
|
||||||
|
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ resource "hcloud_rdns" "ipv6_node" {
|
|||||||
count = var.number_nodes
|
count = var.number_nodes
|
||||||
|
|
||||||
primary_ip_id = hcloud_primary_ip.ipv6_node_address[count.index].id
|
primary_ip_id = hcloud_primary_ip.ipv6_node_address[count.index].id
|
||||||
ip_address = hcloud_server.node[count.index].ipv6_address
|
ip_address = hcloud_primary_ip.ipv6_node_address[count.index].ip_address
|
||||||
dns_ptr = format("%s-%d.%s", "node", count.index, local.docker_network_domain)
|
dns_ptr = format("%s-%d.%s", "node", count.index, local.docker_network_domain)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ resource "hcloud_rdns" "ipv6_worker_node" {
|
|||||||
count = var.number_worker_nodes
|
count = var.number_worker_nodes
|
||||||
|
|
||||||
primary_ip_id = hcloud_primary_ip.ipv6_worker_node_address[count.index].id
|
primary_ip_id = hcloud_primary_ip.ipv6_worker_node_address[count.index].id
|
||||||
ip_address = hcloud_server.worker_node[count.index].ipv6_address
|
ip_address = hcloud_primary_ip.ipv6_worker_node_address[count.index].ip_address
|
||||||
dns_ptr = format("%s-%s-%d.%s", "worker", "node", count.index, local.docker_network_domain)
|
dns_ptr = format("%s-%s-%d.%s", "worker", "node", count.index, local.docker_network_domain)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user