Skip to content
This repository has been archived by the owner on Aug 18, 2023. It is now read-only.

Fix dns forwarders in bastion node #57

Merged
merged 1 commit into from
Oct 19, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions modules/3_helpernode/helpernode.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,20 @@
################################################################

locals {
forwarders = tolist(split(";", var.dns_forwarders))

helpernode_vars = {
cluster_domain = var.cluster_domain
cluster_id = var.cluster_id
bastion_ip = var.bastion_ip
forwarders = var.dns_forwarders
gateway_ip = var.gateway_ip
netmask = cidrnetmask(var.cidr)
broadcast = cidrhost(var.cidr,-1)
ipid = cidrhost(var.cidr, 0)
pool = var.allocation_pools[0]

forwarder1 = local.forwarders[0]
forwarder2 = length(local.forwarders) > 1 ? join(";", slice(local.forwarders, 1, length(local.forwarders))) : ""

bootstrap_info = {
ip = var.bootstrap_ip,
mac = var.bootstrap_mac,
Expand Down
3 changes: 2 additions & 1 deletion modules/3_helpernode/templates/helpernode_vars.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ helper:
dns:
domain: "${cluster_domain}"
clusterid: "${cluster_id}"
forwarder1: "${forwarders}"
forwarder1: "${forwarder1}"
forwarder2: "${forwarder2}"
dhcp:
router: "${gateway_ip}"
bcast: "${broadcast}"
Expand Down