summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeorg Pfuetzenreuter2023-02-05 10:04:09 +0100
committerGeorg Pfuetzenreuter2023-02-05 10:04:09 +0100
commit4581bd4a6a800e6dae21ebdbbb89f496de83ccf9 (patch)
tree2813583ea15fa21f0da0beff029c44e9d027d8a4
parent3f2b8d2ee79ba53027b60c932c0dc41a1a5cd3f5 (diff)
downloadsalt-4581bd4a6a800e6dae21ebdbbb89f496de83ccf9.tar.gz
salt-4581bd4a6a800e6dae21ebdbbb89f496de83ccf9.tar.bz2
salt-4581bd4a6a800e6dae21ebdbbb89f496de83ccf9.zip
Add nginx crtkeypair macro
For use in nginx pillars. Signed-off-by: Georg Pfuetzenreuter <mail@georg-pfuetzenreuter.net>
-rw-r--r--pillar/macros.jinja6
-rw-r--r--pillar/map.jinja3
2 files changed, 9 insertions, 0 deletions
diff --git a/pillar/macros.jinja b/pillar/macros.jinja
index 1d3eade..91d149c 100644
--- a/pillar/macros.jinja
+++ b/pillar/macros.jinja
@@ -24,3 +24,9 @@
interfaces: {{ interfaces }}
{%- endif -%}
{%- endmacro -%}
+
+{%- macro nginx_crtkeypair(name, ssldir) -%}
+tls_{{ name }}:
+ - ssl_certificate: {{ sslbase }}/{{ ssldir }}/crt
+ - ssl_certificate_key: {{ sslbase }}/{{ ssldir }}/key
+{%- endmacro -%}
diff --git a/pillar/map.jinja b/pillar/map.jinja
index bb0a536..849eb15 100644
--- a/pillar/map.jinja
+++ b/pillar/map.jinja
@@ -1,6 +1,9 @@
+{%- set sslbase = '/etc/ssl' -%}
+{%- from 'macros.jinja' import nginx_crtkeypair with context -%}
{%- from 'macros.jinja' import firewall_interfaces, listeners -%}
{%- set firewall_interfaces = firewall_interfaces -%}
{%- set listeners = listeners -%}
+{%- set nginx_crtkeypair = nginx_crtkeypair -%}
{%- set minion = grains['id'] -%}
{#- START Listener detection logic -#}