From 77fa1cd083302575622abed78dc63937315a1267 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christer=20War=C3=A9n?= Date: Sun, 5 May 2024 19:59:56 +0300 Subject: [PATCH] Update --- tasks/installer.yml | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/tasks/installer.yml b/tasks/installer.yml index 805717f..cd164fa 100644 --- a/tasks/installer.yml +++ b/tasks/installer.yml @@ -100,7 +100,7 @@ state: directory vars: paths: - - /root/certs + - /root/certs/mpp - /etc/letsencrypt/renewal-hooks/pre loop: "{{ paths }}" loop_control: @@ -134,6 +134,26 @@ tags: - certbot +- name: "Installer - Certbot - Self-Signed Certificates - Generate Private Key" + community.crypto.openssl_privatekey: + path: "/root/certs/mpp/privatekey.pem" + type: RSA + size: 2048 + regenerate: never + +- name: "Installer - Certbot - Self-Signed Certificates - Create Certificate Signing Request" + community.crypto.openssl_csr: + common_name: "{{ ansible_facts.fqdn }}" + privatekey_path: "/root/certs/mpp/privatekey.pem" + path: "/root/certs/mpp/csr.pem" + +- name: "Installer - Certbot - Self-Signed Certificates - Generate Certificate" + community.crypto.x509_certificate: + path: "/root/certs/mpp/fullchain.pem" + privatekey_path: "/root/certs/mpp/privatekey.pem" + csr_path: "/root/certs/mpp/csr.pem" + provider: selfsigned + - name: "Installer - Certbot - Auth Hook" copy: src: "../files/certbot/nginx.sh"