diff options
Diffstat (limited to 'roles/x509/acmetool/cert/prepare')
-rw-r--r-- | roles/x509/acmetool/cert/prepare/tasks/main.yml | 1 | ||||
-rw-r--r-- | roles/x509/acmetool/cert/prepare/templates/reload.sh.j2 | 5 |
2 files changed, 5 insertions, 1 deletions
diff --git a/roles/x509/acmetool/cert/prepare/tasks/main.yml b/roles/x509/acmetool/cert/prepare/tasks/main.yml index 62f34d01..f750c5fe 100644 --- a/roles/x509/acmetool/cert/prepare/tasks/main.yml +++ b/roles/x509/acmetool/cert/prepare/tasks/main.yml @@ -42,6 +42,7 @@ x509_certificate_path_cert: "/var/lib/acme/live/{{ acmetool_cert_hostnames[0] }}/cert" x509_certificate_path_chain: "/var/lib/acme/live/{{ acmetool_cert_hostnames[0] }}/chain" x509_certificate_path_fullchain: "/var/lib/acme/live/{{ acmetool_cert_hostnames[0] }}/fullchain" + x509_certificate_path_ca_cert: "" - name: setup custom renewal script when: x509_certificate_renewal is defined diff --git a/roles/x509/acmetool/cert/prepare/templates/reload.sh.j2 b/roles/x509/acmetool/cert/prepare/templates/reload.sh.j2 index d707357b..8e1c00c6 100644 --- a/roles/x509/acmetool/cert/prepare/templates/reload.sh.j2 +++ b/roles/x509/acmetool/cert/prepare/templates/reload.sh.j2 @@ -18,7 +18,10 @@ while read name; do {% 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 'group' in file %} -g {{ file.group }}{% endif %} /dev/null "{{ file.dest }}.new" {% for src in file.src %} - cat "{{ hostvars[inventory_hostname]['x509_certificate_path_' + src] }}" >> "{{ file.dest }}.new" +{% set src_file = lookup('vars', 'x509_certificate_path_' + src) %} +{% if src_file != "" %} + cat "{{ src_file }}" >> "{{ file.dest }}.new" +{% endif %} {% endfor %} mv "{{ file.dest }}.new" "{{ file.dest }}" {% endfor %} |