From 6858f17766fcd6fd0f05c43393188b79d29be5e5 Mon Sep 17 00:00:00 2001 From: Quentin Dufour Date: Thu, 22 Oct 2020 17:57:02 +0200 Subject: Rework Ansible to support ipv6 --- os/config/roles/consul/templates/consul.json.j2 | 4 ++-- os/config/roles/consul/templates/resolv.conf.j2 | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'os/config/roles/consul/templates') diff --git a/os/config/roles/consul/templates/consul.json.j2 b/os/config/roles/consul/templates/consul.json.j2 index b6c86aa..76632a6 100644 --- a/os/config/roles/consul/templates/consul.json.j2 +++ b/os/config/roles/consul/templates/consul.json.j2 @@ -1,14 +1,14 @@ { "data_dir": "/var/lib/consul", "bind_addr": "0.0.0.0", - "advertise_addr": "{{ public_ip }}", + "advertise_addr": "{{ ipv4 }}", "addresses": { "dns": "0.0.0.0", "http": "0.0.0.0" }, "retry_join": [ {% for selected_host in groups['cluster_nodes']|reject("sameas", ansible_fqdn) %}{# @FIXME: Reject doesn't work #} - "{{ hostvars[selected_host]['private_ip'] }}" {{ "," if not loop.last else "" }} + "{{ hostvars[selected_host]['ipv4'] }}" {{ "," if not loop.last else "" }} {% endfor %} ], "bootstrap_expect": 3, diff --git a/os/config/roles/consul/templates/resolv.conf.j2 b/os/config/roles/consul/templates/resolv.conf.j2 index 2404034..db64711 100644 --- a/os/config/roles/consul/templates/resolv.conf.j2 +++ b/os/config/roles/consul/templates/resolv.conf.j2 @@ -1,2 +1,2 @@ -nameserver {{ private_ip }} +nameserver {{ ipv4 }} nameserver {{ dns_server }} -- cgit v1.2.3