acme.sh: request a certificate when the configuration did not change but no certificate is present.

This commit is contained in:
Andrea Dell'Amico 2019-11-08 16:42:28 +01:00
parent 9b5acb19b3
commit faf5b50aef
1 changed files with 6 additions and 3 deletions

View File

@ -84,12 +84,15 @@
tags: [ 'letsencrypt', 'letsencrypt_acme_sh' ] tags: [ 'letsencrypt', 'letsencrypt_acme_sh' ]
- block: - block:
- name: Remove the ok_certificate_issued file when the env file has been changed so that we can force a new request
file: dest={{ letsencrypt_acme_sh_base_data_dir }}/data/ok_certificate_issued state=absent
when: acme_sh_issue is changed
- name: Request the certificates. As root because we must bind on port 80 - name: Request the certificates. As root because we must bind on port 80
shell: /usr/local/bin/acme-sh-request-cert shell: /usr/local/bin/acme-sh-request-cert
#args: args:
# creates: '{{ letsencrypt_acme_sh_base_data_dir }}/data/ok_certificate_issued' creates: '{{ letsencrypt_acme_sh_base_data_dir }}/data/ok_certificate_issued'
register: acme_sh_certificate_issued register: acme_sh_certificate_issued
when: acme_sh_issue is changed
ignore_errors: True ignore_errors: True
- name: Check if the 'live' path is a symling. It is, if acmetool was installed - name: Check if the 'live' path is a symling. It is, if acmetool was installed