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:
parent
4adada983a
commit
43ee0392b4
1 changed files with 5 additions and 18 deletions
|
@ -65,25 +65,10 @@
|
||||||
- letsencrypt.backup_to is defined
|
- letsencrypt.backup_to is defined
|
||||||
- item.content 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
|
- name: restore the backed up certificates
|
||||||
copy:
|
copy:
|
||||||
content: "{{ item.content | b64decode }}"
|
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
|
owner: root
|
||||||
group: root
|
group: root
|
||||||
mode: 0644
|
mode: 0644
|
||||||
|
@ -134,8 +119,10 @@
|
||||||
/usr/libexec/auto-certbot-deploy \
|
/usr/libexec/auto-certbot-deploy \
|
||||||
--init {{ item.item.key }}
|
--init {{ item.item.key }}
|
||||||
when:
|
when:
|
||||||
- letsencrypt.predefined_deploy_script is defined
|
- letsencrypt.predefined_deploy_script is defined
|
||||||
- not item.stat.exists
|
- not item.stat.exists
|
||||||
|
- not some_cert_restored.changed
|
||||||
|
with_items: "{{ le_stat_checks.results }}"
|
||||||
with_items: "{{ le_stat_checks.results }}"
|
with_items: "{{ le_stat_checks.results }}"
|
||||||
tags:
|
tags:
|
||||||
- certbot
|
- certbot
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue