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