aboutsummaryrefslogtreecommitdiff
path: root/ansible/roles/consul/templates/consul.json.j2
diff options
context:
space:
mode:
authorQuentin <quentin@deuxfleurs.fr>2019-06-01 16:02:49 +0200
committerQuentin Dufour <quentin@deuxfleurs.fr>2019-07-11 09:33:07 +0200
commit61d009f18d5886db8b22ae41e04bb41a4ba2fddb (patch)
treee44bb326caf3107653c7a48749527cfd77f02cf2 /ansible/roles/consul/templates/consul.json.j2
downloadinfrastructure-61d009f18d5886db8b22ae41e04bb41a4ba2fddb.tar.gz
infrastructure-61d009f18d5886db8b22ae41e04bb41a4ba2fddb.zip
Initial commit
Diffstat (limited to 'ansible/roles/consul/templates/consul.json.j2')
-rw-r--r--ansible/roles/consul/templates/consul.json.j227
1 files changed, 27 insertions, 0 deletions
diff --git a/ansible/roles/consul/templates/consul.json.j2 b/ansible/roles/consul/templates/consul.json.j2
new file mode 100644
index 0000000..d1bd2d8
--- /dev/null
+++ b/ansible/roles/consul/templates/consul.json.j2
@@ -0,0 +1,27 @@
+{
+ "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
+ },
+ "encrypt": "{{ consul_gossip_encrypt }}",
+ "domain": "2.cluster.deuxfleurs.fr",
+ "performance": {
+ "raft_multiplier": 10,
+ "rpc_hold_timeout": "30s",
+ "leave_drain_time": "30s"
+ }
+}