Added method webroot to avoid restarting servers

This commit is contained in:
Valentin Gostev
2019-02-06 22:16:39 +03:00
parent 00dc226101
commit 993e742d5c
4 changed files with 29 additions and 0 deletions
+13
View File
@@ -0,0 +1,13 @@
---
- name: Check if certificate already exists.
stat:
path: /etc/letsencrypt/live/{{ cert_item.domains | first | replace('*.', '') }}/cert.pem
register: letsencrypt_cert
- name: Override certbot command variable to use webroot
include_vars: "webroot.yml"
when: not letsencrypt_cert.stat.exists
- name: Generate new certificate if one doesn't exist.
command: "{{ certbot_create_command }}"
when: not letsencrypt_cert.stat.exists
+8
View File
@@ -15,5 +15,13 @@
loop_control:
loop_var: cert_item
- include_tasks: create-cert-webroot.yml
with_items: "{{ certbot_certs }}"
when:
- certbot_create_if_missing
- certbot_create_method == 'webroot'
loop_control:
loop_var: cert_item
- import_tasks: renew-cron.yml
when: certbot_auto_renew