From 8bb29eed197ec79225af274d9eafd48455686cc3 Mon Sep 17 00:00:00 2001 From: Erik Stambaugh Date: Sat, 20 Jan 2024 08:51:52 -0800 Subject: [PATCH] Create a stub certificate so that nginx can launch --- ansible/roles/certbot/tasks/main.yaml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) 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