Compare commits

..

No commits in common. "e5bfeaf936b554941650c6a3bea4b99f6d912010" and "98ea3238ed399a0b8c6a974e7259f01a79b5fcde" have entirely different histories.

4 changed files with 13 additions and 7 deletions

View File

@ -14,7 +14,6 @@ certbot_hsts: false
certbot_create_if_missing: false
certbot_create_method: standalone
certbot_admin_email: email@example.com
certbot_expand: false
# Default webroot, overwritten by individual per-cert webroot directories
certbot_webroot: /var/www/letsencrypt
@ -36,7 +35,6 @@ certbot_create_command: >-
{{ '--test-cert' if certbot_testmode else '' }}
--noninteractive --agree-tos
--email {{ cert_item.email | default(certbot_admin_email) }}
{{ '--expand' if certbot_expand else '' }}
{{ '--webroot-path ' if certbot_create_method == 'webroot' else '' }}
{{ cert_item.webroot | default(certbot_webroot) if certbot_create_method == 'webroot' else '' }}
{{ certbot_create_extra_args }}

View File

@ -1,7 +1,7 @@
---
- name: Converge
hosts: all
# become: true
become: true
vars:
certbot_auto_renew_user: root

View File

@ -1,4 +1,9 @@
---
- name: Check if certificate already exists.
stat:
path: /etc/letsencrypt/live/{{ cert_item.domains | first | replace('*.', '') }}/cert.pem
register: letsencrypt_cert
- name: Ensure pre and post hook folders exist.
file:
path: /etc/letsencrypt/renewal-hooks/{{ item }}
@ -34,5 +39,4 @@
- name: Generate new certificate if one doesn't exist.
command: "{{ certbot_create_command }}"
register: certbot_create
changed_when: "'no action taken' not in certbot_create.stdout"
when: not letsencrypt_cert.stat.exists

View File

@ -1,4 +1,9 @@
---
- name: Check if certificate already exists.
stat:
path: /etc/letsencrypt/live/{{ cert_item.domains | first }}/cert.pem
register: letsencrypt_cert
- name: Create webroot directory if it doesn't exist yet
file:
path: "{{ cert_item.webroot | default(certbot_webroot) }}"
@ -6,5 +11,4 @@
- name: Generate new certificate if one doesn't exist.
command: "{{ certbot_create_command }}"
register: certbot_create
changed_when: "'no action taken' not in certbot_create.stdout"
when: not letsencrypt_cert.stat.exists