Skip to content

Commit 62474d3

Browse files
committed
Merge branch 'devel' of github.com:brianshumate/ansible-consul into devel
2 parents 3f26fc1 + a3b19f2 commit 62474d3

File tree

4 files changed

+12
-3
lines changed

4 files changed

+12
-3
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,11 @@ Many role variables can also take their values from environment variables as wel
186186
- Interval for reconnection attempts to WAN servers
187187
- Default value: 30s
188188

189+
### `consul_retry_join_skip_hosts`
190+
191+
- If true, the config value for retry_join won't be populated by the default hosts servers. The value can be initialized using consul_join
192+
- Default value: false
193+
189194
### `consul_retry_max`
190195

191196
- Max reconnection attempts to LAN servers before failing (0 = infinite)

defaults/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ consul_raft_protocol: "\
8282
{% else %}\
8383
3\
8484
{% endif %}"
85+
consul_retry_join_skip_hosts: false
8586
consul_retry_interval: "30s"
8687
consul_retry_interval_wan: "30s"
8788
consul_retry_max: 0

templates/config.json.j2

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,11 @@
8383
"retry_max": {{ consul_retry_max | int }},
8484

8585
"retry_join":
86-
{% for server in _consul_lan_servers %}
87-
{% set _ = consul_join.append(hostvars[server]['consul_advertise_address'] | default(hostvars[server]['consul_bind_address'])) %}
88-
{% endfor %}
86+
{% if not consul_retry_join_skip_hosts %}
87+
{% for server in _consul_lan_servers %}
88+
{% set _ = consul_join.append(hostvars[server]['consul_advertise_address'] | default(hostvars[server]['consul_bind_address'])) %}
89+
{% endfor %}
90+
{% endif %}
8991
{{ consul_join | map('ipwrap') | list | to_json }},
9092

9193
{## Server/Client ##}

tests/test_vars.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ consul_raft_protocol: "\
8989
{% else %}\
9090
3\
9191
{% endif %}"
92+
consul_retry_join_skip_hosts: false
9293
consul_retry_interval: "30s"
9394
consul_retry_interval_wan: "30s"
9495
consul_retry_max: 0

0 commit comments

Comments
 (0)