26 lines
767 B
Django/Jinja
26 lines
767 B
Django/Jinja
{%- import_yaml "haproxy/defaults.yaml" as defaults -%}
|
|
|
|
{%- set haproxy = salt['pillar.get']('haproxy',
|
|
default=defaults.haproxy,
|
|
merge=True) -%}
|
|
|
|
{%- set users = salt['pillar.get']('htpasswds') -%}
|
|
{%- set net = salt['pillar.get']('net') -%}
|
|
{%- set fqdn = salt['grains.get']('fqdn') -%}
|
|
|
|
{% set peers = salt['mine.get'](
|
|
tgt='G@lb:true',
|
|
fun='internal_ip_addrs',
|
|
tgt_type='compound') %}
|
|
|
|
{% set peers_ip = [] %}
|
|
{%- for k,v in peers.items() %}
|
|
{%- if k != salt['grains.get']('fqdn') %}
|
|
{%- for i in v %}
|
|
{% set _ = peers_ip.append([k,i]) %}
|
|
{%- endfor %}
|
|
{%- endif %}
|
|
{%- endfor %}
|
|
|
|
{% do haproxy.config.update({"peers": peers_ip }) %}
|