mirror of
https://github.com/geerlingguy/ansible-role-certbot.git
synced 2025-04-19 17:01:37 +02:00
22 lines
695 B
YAML
22 lines
695 B
YAML
---
|
|
- name: Check if certificate already exists.
|
|
stat:
|
|
path: /etc/letsencrypt/live/{{ cert_item.domains | first | replace('*.', '') }}/cert.pem
|
|
register: letsencrypt_cert
|
|
|
|
- name: Ensure cloud-init directory exists.
|
|
file:
|
|
path: /var/lib/cloud/scripts/per-instance
|
|
state: directory
|
|
|
|
- name: Ensure cloud-init creates certificates.
|
|
template:
|
|
src: certbot-init.sh.j2
|
|
dest: "/var/lib/cloud/scripts/per-instance/certbot-init-{{ cert_item.domains | first | replace('*.', '') }}.sh"
|
|
|
|
- name: Ensure test certificates are created.
|
|
command: "{{ certbot_create_command }} --test-cert"
|
|
when:
|
|
- not letsencrypt_cert.stat.exists
|
|
- certbot_cloud_init_test_certificates
|