From ba6522ce5b0c2a4f851fe4826aa9f077a4d3d381 Mon Sep 17 00:00:00 2001 From: Georg Pfuetzenreuter Date: Mon, 30 Jan 2023 05:43:53 +0100 Subject: Refactor map/macro sourcing - move pillar macros and map to base directory - move listener logic from macro to map - update includes respectively Signed-off-by: Georg Pfuetzenreuter --- pillar/global/macros.jinja | 26 -------------------------- 1 file changed, 26 deletions(-) delete mode 100644 pillar/global/macros.jinja (limited to 'pillar/global/macros.jinja') diff --git a/pillar/global/macros.jinja b/pillar/global/macros.jinja deleted file mode 100644 index 1d3eade..0000000 --- a/pillar/global/macros.jinja +++ /dev/null @@ -1,26 +0,0 @@ -{%- macro listeners() -%} -{%- set listen_ips = [] -%} -{%- set minion = grains['id'] -%} -{%- set legal6s = ('fd29', '2a01:4f8:11e:2200') -%} -{%- set ip4s = salt.saltutil.runner('mine.get', tgt=minion, fun='network.ip_addrs', tgt_type='glob') -%} -{%- set ip6s = salt.saltutil.runner('mine.get', tgt=minion, fun='network.ip_addrs6', tgt_type='glob') -%} -{%- if minion in ip4s -%}{%- for ip in ip4s[minion] -%} -{%- if salt['network.is_private'](ip) -%} -{%- do listen_ips.append(ip) -%} -{%- endif -%} -{%- endfor -%}{%- endif -%} -{%- if minion in ip6s -%}{%- for ip in ip6s[minion] -%} -{%- if ip.startswith(legal6s) -%} -{%- do listen_ips.append(ip) -%} -{%- endif -%} -{%- endfor -%}{%- endif -%} -{%- for ip in listen_ips %} -- {{ ip }} -{%- endfor %} -{%- endmacro -%} - -{%- macro firewall_interfaces(interfaces) -%} -{%- if interfaces | length -%} -interfaces: {{ interfaces }} -{%- endif -%} -{%- endmacro -%} -- cgit v1.2.3