add boostrap_expect

This commit is contained in:
vincent 2022-03-11 10:57:10 +01:00
parent 904a6bb6d8
commit b9786ad344
2 changed files with 4 additions and 3 deletions

View File

@ -4,7 +4,7 @@ consul_server: True
consul_ui: True
consul_iface: "{{ ansible_default_ipv4.interface }}"
consul_bind_address: "{{ hostvars[inventory_hostname]['ansible_'+ consul_iface | replace('-', '_')]['ipv4']['address']}}"
consul_client_addr: ""
consul_client_addr: "127.0.0.1"
consul_bootstrap: False
consul_data_dir: "/opt/consul"
@ -24,3 +24,4 @@ consul_servers_list: "\
consul_join: []
consul_join_wan: []
consul_bootstrap_expect: 3

View File

@ -1,7 +1,7 @@
bootstrap= {{consul_bootstrap|lower}}
server= {{consul_server|lower}}
bootstrap_expect= {{consul_bootstrap_expect}}
{% if consul_bind_address %}
bind_addr="{{consul_bind_address}}"
{% endif %}
@ -29,7 +29,7 @@ acl {
}
{% for server in _consul_lan_servers %}
{% set _ = consul_join.append(hostvars[server]['consul_bind_address'] | default(hostvars[server]['ansible_default_ipv4']['address'],true) | mandatory) %}
{% set _ = consul_join.append(hostvars.server['consul_bind_address'] | default(hostvars[server]['ansible_default_ipv4']['address'],true) | mandatory) %}
{% endfor %}
retry_join= {{ consul_join | map('ipwrap') | list | to_json }}