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: