From 8ca6fadfef7e75ea15b06a83dfcc38f349dfdf51 Mon Sep 17 00:00:00 2001 From: yohan <783b8c87@scimetis.net> Date: Thu, 31 Oct 2024 23:19:58 +0100 Subject: [PATCH] Do not overwrite Let's encrypt reverse-proxy configuration. --- roles/role_deploy_gitea/tasks/main.yml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/roles/role_deploy_gitea/tasks/main.yml b/roles/role_deploy_gitea/tasks/main.yml index 063688f..0dca6ec 100644 --- a/roles/role_deploy_gitea/tasks/main.yml +++ b/roles/role_deploy_gitea/tasks/main.yml @@ -113,6 +113,12 @@ line: "127.0.0.1 git2.{{ DOMAIN }} git2" become: true +- name: Check if lets encrypt certificate installation is already done + stat: + path: /mnt/volumes/reverse-proxy_conf/data/reverse-proxy-gitea-le-ssl.conf + register: gitea_certificate_flag + become: true + - name: Template reverse-proxy configuration ansible.builtin.template: src: "{{ item }}.j2" @@ -124,18 +130,14 @@ become: true with_items: - reverse-proxy-gitea.conf + when: not gitea_certificate_flag.stat.exists - name: Enable reverse-proxy configuration containers.podman.podman_container_exec: name: reverse-proxy command: 'sh -c ''a2ensite reverse-proxy-gitea && service apache2 reload''' become: true - -- name: Check if lets encrypt certificate installation is already done - stat: - path: /mnt/volumes/reverse-proxy_conf/data/reverse-proxy-gitea-le-ssl.conf - register: gitea_certificate_flag - become: true + when: not gitea_certificate_flag.stat.exists - name: Install lets encrypt certificate containers.podman.podman_container_exec: