Allow overriding /etc/letsencrypt location

This commit is contained in:
Márton Salomváry 2020-05-29 10:58:14 +02:00
parent 919c2ba7b5
commit 24580c85d2
3 changed files with 4 additions and 1 deletions

View File

@ -51,6 +51,8 @@ A list of domains (and other data) for which certs should be generated. You can
The `certbot_create_command` defines the command used to generate the cert. The `certbot_create_command` defines the command used to generate the cert.
The `certbot_etc` variable defaulting to `/etc/letsencrypt` allows using a non-standard location for Certbot configuration.
#### Standalone Certificate Generation #### Standalone Certificate Generation
certbot_create_standalone_stop_services: certbot_create_standalone_stop_services:

View File

@ -7,6 +7,7 @@ certbot_auto_renew_minute: "30"
certbot_auto_renew_options: "--quiet --no-self-upgrade" certbot_auto_renew_options: "--quiet --no-self-upgrade"
# Parameters used when creating new Certbot certs. # Parameters used when creating new Certbot certs.
certbot_etc: /etc/letsencrypt
certbot_create_if_missing: false certbot_create_if_missing: false
certbot_create_method: standalone certbot_create_method: standalone
certbot_admin_email: email@example.com certbot_admin_email: email@example.com

View File

@ -1,7 +1,7 @@
--- ---
- name: Check if certificate already exists. - name: Check if certificate already exists.
stat: stat:
path: /etc/letsencrypt/live/{{ cert_item.domains | first | replace('*.', '') }}/cert.pem path: "{{ certbot_etc }}/live/{{ cert_item.domains | first | replace('*.', '') }}/cert.pem"
register: letsencrypt_cert register: letsencrypt_cert
- name: Stop services to allow certbot to generate a cert. - name: Stop services to allow certbot to generate a cert.