ansible-consul/vars/main.yml

24 lines
910 B
YAML
Raw Normal View History

2022-03-07 20:22:15 +00:00
---
# vars file for ansible-consul
2022-03-08 20:07:38 +00:00
_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) }}"