From d40d585358fe1fea1f47066953a6a1074a7d3368 Mon Sep 17 00:00:00 2001 From: Ian Fijolek Date: Thu, 23 Jun 2022 20:12:09 -0700 Subject: [PATCH] Install consul dns forwarding --- nomad/setup-cluster.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/nomad/setup-cluster.yml b/nomad/setup-cluster.yml index 5917811..65f9692 100644 --- a/nomad/setup-cluster.yml +++ b/nomad/setup-cluster.yml @@ -35,6 +35,18 @@ telemetry: prometheus_retention_time: "2h" + # DNS forwarding + consul_dnsmasq_enable: true + consul_dnsmasq_servers: + # TODO: use addresses of other nomad nodes? + # Maybe this can be [] to get the values from dhcp + - 1.1.1.1 + - 1.0.0.1 + consul_dnsmasq_bind_interfaces: true + consul_dnsmasq_listen_addresses: + # Listen only to loopback interface + - 127.0.0.1 + become: true tasks: @@ -44,6 +56,9 @@ name: consul become: true + # If DNS is broken after dnsmasq, then need to set /etc/resolv.conf to something + # pointing to 127.0.0.1 and possibly restart Docker and Nomad + - name: Add values block: - name: Install python-consul