From 63374e662e8bfe0e2d5e4ea1b5adb79a90b6de43 Mon Sep 17 00:00:00 2001 From: nils Date: Mon, 9 Dec 2024 10:38:23 +0100 Subject: [PATCH] add nginx plugin --- tasks/create-cert-nginx.yml | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 tasks/create-cert-nginx.yml diff --git a/tasks/create-cert-nginx.yml b/tasks/create-cert-nginx.yml new file mode 100644 index 0000000..7038b8d --- /dev/null +++ b/tasks/create-cert-nginx.yml @@ -0,0 +1,9 @@ +--- +- name: Check if certificate already exists. + stat: + path: /etc/letsencrypt/live/{{ cert_item.domains | first }}/cert.pem + register: letsencrypt_cert + +- name: Generate new certificate if one doesn't exist. + command: "{{ certbot_create_command }}" + when: not letsencrypt_cert.stat.exists