From 4581bd4a6a800e6dae21ebdbbb89f496de83ccf9 Mon Sep 17 00:00:00 2001 From: Georg Pfuetzenreuter Date: Sun, 5 Feb 2023 10:04:09 +0100 Subject: Add nginx crtkeypair macro For use in nginx pillars. Signed-off-by: Georg Pfuetzenreuter --- pillar/macros.jinja | 6 ++++++ pillar/map.jinja | 3 +++ 2 files changed, 9 insertions(+) (limited to 'pillar') 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 -#} -- cgit v1.2.3