summaryrefslogtreecommitdiffstats
path: root/pillar/global/macros.jinja
blob: 90e73e294919084a2bdaed35515eee965dca90d7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
{%- macro listeners() -%}
{%- set listen_ips = [] -%}
{%- set minion = grains['id'] -%}
{%- set legal6s = ('fd29', '2a01:4f8:11e:2200') -%}
{%- for ip in salt.saltutil.runner('mine.get', tgt=minion, fun='network.ip_addrs', tgt_type='glob')[minion] -%}
{%- if salt['network.is_private'](ip) -%}
{%- do listen_ips.append(ip) -%}
{%- endif -%}
{%- endfor -%}
{%- for ip in salt.saltutil.runner('mine.get', tgt=minion, fun='network.ip_addrs6', tgt_type='glob')[minion] -%}
{%- if ip.startswith(legal6s) -%}
{%- do listen_ips.append(ip) -%}
{%- endif -%}
{%- endfor -%}
{%- for ip in listen_ips %}
- {{ ip }}
{%- endfor %}
{%- endmacro -%}