ansible-consul/vars/main.yml
2022-03-08 21:07:38 +01:00

24 lines
910 B
YAML

---
# vars file for ansible-consul
_consul_lan_servers: "\
{% set __consul_lan_servers = [] %}\
{% for server in consul_servers_list %}\
{% set _consul_datacenter = hostvars[server]['consul_datacenter'] | default('dc1', true) %}\
{% if _consul_datacenter == consul_datacenter %}\
{% if __consul_lan_servers.append(server) %}{% endif %}\
{% endif %}\
{% endfor %}\
{{ __consul_lan_servers }}"
_consul_lan_servercount: "{{ (_consul_lan_servers | length) }}"
_consul_wan_servers: "\
{% set __consul_wan_servers = [] %}\
{% for server in consul_servers_list %}\
{% set _consul_datacenter = hostvars[server]['consul_datacenter'] | default('dc1', true) %}\
{% if _consul_datacenter != consul_datacenter %}\
{% if __consul_wan_servers.append(server) %}{% endif %}\
{% endif %}\
{% endfor %}\
{{ __consul_wan_servers }}"
_consul_wan_servercount: "{{ (_consul_wan_servers | length) }}"