aboutsummaryrefslogtreecommitdiff
path: root/os/config/roles/consul/templates
diff options
context:
space:
mode:
authorQuentin <quentin@deuxfleurs.fr>2020-09-13 12:03:07 +0200
committerQuentin <quentin@deuxfleurs.fr>2020-09-13 12:03:07 +0200
commit484c3fe667cd8c5a647256cb78f05c8a39b835b1 (patch)
tree7be3c868ce1d0e0c96125a4c94cadce429be9e1d /os/config/roles/consul/templates
parent0550647b9348d1e36431400e0832b4340564c658 (diff)
parentd5bfc38fe826aa12f46de64790195cc8e76756de (diff)
downloadinfrastructure-484c3fe667cd8c5a647256cb78f05c8a39b835b1.tar.gz
infrastructure-484c3fe667cd8c5a647256cb78f05c8a39b835b1.zip
Merge branch 'feature/rebase'
Diffstat (limited to 'os/config/roles/consul/templates')
-rw-r--r--os/config/roles/consul/templates/consul.json.j230
-rw-r--r--os/config/roles/consul/templates/resolv.conf.j22
2 files changed, 32 insertions, 0 deletions
diff --git a/os/config/roles/consul/templates/consul.json.j2 b/os/config/roles/consul/templates/consul.json.j2
new file mode 100644
index 0000000..b6c86aa
--- /dev/null
+++ b/os/config/roles/consul/templates/consul.json.j2
@@ -0,0 +1,30 @@
+{
+ "data_dir": "/var/lib/consul",
+ "bind_addr": "0.0.0.0",
+ "advertise_addr": "{{ public_ip }}",
+ "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 "" }}
+ {% endfor %}
+ ],
+ "bootstrap_expect": 3,
+ "server": true,
+ "ui": true,
+ "ports": {
+ "dns": 53
+ },
+ "recursors": [
+ "{{ dns_server }}"
+ ],
+ "encrypt": "{{ consul_gossip_encrypt }}",
+ "domain": "2.cluster.deuxfleurs.fr",
+ "performance": {
+ "raft_multiplier": 10,
+ "rpc_hold_timeout": "30s",
+ "leave_drain_time": "30s"
+ }
+}
diff --git a/os/config/roles/consul/templates/resolv.conf.j2 b/os/config/roles/consul/templates/resolv.conf.j2
new file mode 100644
index 0000000..2404034
--- /dev/null
+++ b/os/config/roles/consul/templates/resolv.conf.j2
@@ -0,0 +1,2 @@
+nameserver {{ private_ip }}
+nameserver {{ dns_server }}