summaryrefslogtreecommitdiffstats
path: root/pillar/global/macros.jinja
diff options
context:
space:
mode:
authorGeorg Pfuetzenreuter2023-01-26 23:05:21 +0100
committerGeorg Pfuetzenreuter2023-01-26 23:05:21 +0100
commit698234c0402eeff37517869695c75682a3fad332 (patch)
treee23a9ce4be37b8134d9bf14c1046d5ecf73ad540 /pillar/global/macros.jinja
parentf949c0aba0bd9863474a35e1613eb23554acc449 (diff)
downloadsalt-698234c0402eeff37517869695c75682a3fad332.tar.gz
salt-698234c0402eeff37517869695c75682a3fad332.tar.bz2
salt-698234c0402eeff37517869695c75682a3fad332.zip
Manage common SSH server
Signed-off-by: Georg Pfuetzenreuter <mail@georg-pfuetzenreuter.net>
Diffstat (limited to 'pillar/global/macros.jinja')
-rw-r--r--pillar/global/macros.jinja17
1 files changed, 17 insertions, 0 deletions
diff --git a/pillar/global/macros.jinja b/pillar/global/macros.jinja
new file mode 100644
index 0000000..3cc8848
--- /dev/null
+++ b/pillar/global/macros.jinja
@@ -0,0 +1,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 -%}