Issue #12: Add basic standalone certbot cert generation.

This commit is contained in:
Jeff Geerling
2017-12-06 22:48:30 -06:00
parent 574c0843c8
commit 7651f0ac0b
4 changed files with 71 additions and 0 deletions
+23
View File
@@ -0,0 +1,23 @@
---
- name: Check if certificate already exists.
stat:
path: /etc/letsencrypt/live/{{ item.domains | first }}/cert.pem
register: letsencrypt_cert
- name: Stop services to allow certbot to generate a cert.
service:
name: "{{ item }}"
state: stopped
when: not letsencrypt_cert.stat.exists
with_items: certbot_create_stop_services
- name: Generate new certificate if one doesn't exist.
shell: "{{ certbot_create_command }}"
when: not letsencrypt_cert.stat.exists
- name: Start services after cert has been generated.
service:
name: "{{ item }}"
state: started
when: not letsencrypt_cert.stat.exists
with_items: certbot_create_stop_services
+4
View File
@@ -7,5 +7,9 @@
- include: install-from-source.yml
when: certbot_install_from_source
- include: create-cert-standalone.yml
with_items: "{{ certbot_certs }}"
when: certbot_create_if_missing
- include: renew-cron.yml
when: certbot_auto_renew