diff --git a/handlers/main.yaml b/handlers/main.yaml index ad32af1..fec8721 100644 --- a/handlers/main.yaml +++ b/handlers/main.yaml @@ -20,6 +20,11 @@ - Backup Gitea register: backup +- name: Ensure Gitea is restarted + community.docker.docker_compose: + project_src: /opt/gitea + restarted: true + - name: Ensure Gitea is running community.docker.docker_compose: project_src: /opt/gitea diff --git a/tasks/main.yaml b/tasks/main.yaml index e71b162..0f3ef0f 100644 --- a/tasks/main.yaml +++ b/tasks/main.yaml @@ -70,6 +70,9 @@ dest: "/opt/gitea/environment.env" owner: root mode: "600" + notify: + - Ensure Gitea is restarted + - Check Gitea HTTP Response - name: Upload docker-compose.yaml ansible.builtin.template: @@ -79,21 +82,13 @@ mode: "600" notify: - Output Docker Compose State + - Ensure Gitea is restarted + - Check Gitea HTTP Response -- name: Try to start and reach Gitea +- name: Update Config block: - - - name: Start Gitea - community.docker.docker_compose: - project_src: /opt/gitea - - - name: Check if {{ gitea.hostname }}.{{ gitea.domain }} is available and returning status 200 - ansible.builtin.uri: - url: "https://{{ gitea.hostname }}.{{ gitea.domain }}" - register: _result - until: _result.status == 200 - retries: 30 - delay: 2 + - name: + meta: flush_handlers rescue: - name: Stop Gitea for Backup