From bd35cb12650ed797484ade17b9d3291631dc59e8 Mon Sep 17 00:00:00 2001 From: Ian Fijolek Date: Fri, 13 Jan 2023 15:17:23 -0800 Subject: [PATCH] Make sure there's a working DNS server when bootstrapping --- ansible_playbooks/setup-cluster.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/ansible_playbooks/setup-cluster.yml b/ansible_playbooks/setup-cluster.yml index d9322b7..1943d8d 100644 --- a/ansible_playbooks/setup-cluster.yml +++ b/ansible_playbooks/setup-cluster.yml @@ -1,4 +1,18 @@ --- +- name: Update DNS for bootstrapping with non-Nomad host + hosts: consul_instances + become: true + gather_facts: false + vars: + non_nomad_dns: 192.168.2.170 + + tasks: + - name: Add non-nomad bootstrap DNS + lineinfile: + dest: /etc/resolv.conf + create: true + line: "nameserver {{ non_nomad_dns }}" + - name: Build Consul cluster hosts: consul_instances any_errors_fatal: true