aboutsummaryrefslogtreecommitdiff
path: root/os/config/roles/consul
diff options
context:
space:
mode:
authorQuentin Dufour <quentin@deuxfleurs.fr>2020-10-22 17:57:02 +0200
committerQuentin Dufour <quentin@deuxfleurs.fr>2020-10-22 17:57:02 +0200
commit6858f17766fcd6fd0f05c43393188b79d29be5e5 (patch)
treebd8225399059557be803302d0c45e3f62010ad55 /os/config/roles/consul
parent5c31fbf0b12632b32912fa92be3d53b6e3902b91 (diff)
downloadinfrastructure-6858f17766fcd6fd0f05c43393188b79d29be5e5.tar.gz
infrastructure-6858f17766fcd6fd0f05c43393188b79d29be5e5.zip
Rework Ansible to support ipv6
Diffstat (limited to 'os/config/roles/consul')
-rw-r--r--os/config/roles/consul/tasks/main.yml5
-rw-r--r--os/config/roles/consul/templates/consul.json.j24
-rw-r--r--os/config/roles/consul/templates/resolv.conf.j22
3 files changed, 4 insertions, 7 deletions
diff --git a/os/config/roles/consul/tasks/main.yml b/os/config/roles/consul/tasks/main.yml
index 2b77080..761c1f8 100644
--- a/os/config/roles/consul/tasks/main.yml
+++ b/os/config/roles/consul/tasks/main.yml
@@ -1,6 +1,6 @@
- name: "Set consul version"
set_fact:
- consul_version: 1.8.0
+ consul_version: 1.8.4
- name: "Download and install Consul for x86_64"
unarchive:
@@ -21,6 +21,3 @@
- name: "Enable consul systemd service at boot"
service: name=consul state=started enabled=yes daemon_reload=yes
-
-- name: "Deploy resolv.conf to use Consul"
- template: src=resolv.conf.j2 dest=/etc/resolv.conf
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 }}