diff --git a/roles/copr/certbot/tasks/letsencrypt.yml b/roles/copr/certbot/tasks/letsencrypt.yml index 983ae0238c..b12e0b398a 100644 --- a/roles/copr/certbot/tasks/letsencrypt.yml +++ b/roles/copr/certbot/tasks/letsencrypt.yml @@ -65,25 +65,10 @@ - letsencrypt.backup_to is defined - item.content is defined -- name: create the host live directory - file: - state: directory - path: "{{ le_source_path }}/{{ item.item.0.item.key }}/live" - owner: root - group: root - # this is readable by anyone, per certbot defaults - mode: 0755 - loop: "{{ backed_up_certificates.results }}" - tags: - - certbot - when: - - letsencrypt.backup_to is defined - - item.content is defined - - name: restore the backed up certificates copy: content: "{{ item.content | b64decode }}" - dest: "{{ le_source_path }}/{{ item.item.0.item.key }}/live/{{ item.item.1 }}" + dest: "{{ le_source_path }}/{{ item.item.0.item.key }}/{{ item.item.1 }}" owner: root group: root mode: 0644 @@ -134,8 +119,10 @@ /usr/libexec/auto-certbot-deploy \ --init {{ item.item.key }} when: - - letsencrypt.predefined_deploy_script is defined - - not item.stat.exists + - letsencrypt.predefined_deploy_script is defined + - not item.stat.exists + - not some_cert_restored.changed + with_items: "{{ le_stat_checks.results }}" with_items: "{{ le_stat_checks.results }}" tags: - certbot