copr/certbot: fixup cert restoration

- no need to create another live/ sub-directory
- don't run the reload script when restored from backups
This commit is contained in:
Pavel Raiskup 2022-01-30 20:08:40 +01:00
parent 4adada983a
commit 43ee0392b4

View file

@ -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