summaryrefslogtreecommitdiff
path: root/roles/x509/ownca/cert/prepare/templates
diff options
context:
space:
mode:
Diffstat (limited to 'roles/x509/ownca/cert/prepare/templates')
-rw-r--r--roles/x509/ownca/cert/prepare/templates/updated.sh.j215
1 files changed, 15 insertions, 0 deletions
diff --git a/roles/x509/ownca/cert/prepare/templates/updated.sh.j2 b/roles/x509/ownca/cert/prepare/templates/updated.sh.j2
new file mode 100644
index 00000000..15f68cd9
--- /dev/null
+++ b/roles/x509/ownca/cert/prepare/templates/updated.sh.j2
@@ -0,0 +1,15 @@
+#!/bin/sh
+{% if 'install' in x509_certificate_renewal %}
+{% for file in x509_certificate_renewal.install %}
+
+install{% if 'mode' in file %} -m {{ file.mode }}{% endif %}{% if 'owner' in file %} -o {{ file.owner }}{% endif %}{% if 'owner' in file %} -g {{ file.group }}{% endif %} /dev/null "{{ file.dest }}.new"
+{% for src in file.src %}
+cat "{{ lookup('vars', 'x509_certificate_path_' + src) }}" >> "{{ file.dest }}.new"
+mv "{{ file.dest }}.new" "{{ file.dest }}"
+{% endfor %}
+{% endfor %}
+{% endif %}
+{% if 'reload' in x509_certificate_renewal %}
+
+{{ x509_certificate_renewal.reload | trim }}
+{% endif %}