Make sure there's a working DNS server when bootstrapping

This commit is contained in:
IamTheFij 2023-01-13 15:17:23 -08:00
parent fd92573c16
commit bd35cb1265
1 changed files with 14 additions and 0 deletions

View File

@ -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