diff --git a/ansible/roles/certbot/tasks/main.yaml b/ansible/roles/certbot/tasks/main.yaml index d1afda9..b094e8a 100644 --- a/ansible/roles/certbot/tasks/main.yaml +++ b/ansible/roles/certbot/tasks/main.yaml @@ -47,9 +47,15 @@ ssl_stapling on; ssl_stapling_verify on; +- name: create the dir for the cert if needed + command: "docker exec -t certbot mkdir -p /etc/letsencrypt/live/{{domain_name}}/" + args: + creates: "/srv/certbot/etc/live/{{domain_name}}" - -# diffie helman parameters +- name: seed a fake cert if needed + command: "docker exec -t certbot openssl req -nodes -new -x509 -subj '/CN=localhost' -out /etc/letsencrypt/live/{{domain_name}}/fullchain.pem -keyout /etc/letsencrypt/live/{{domain_name}}/privkey.pem" + args: + creates: "/srv/certbot/etc/live/{{domain_name}}/fullchain.pem" - name: launch certbot command: docker compose up -d