From e8e05f839184b80b6a54c95fdd9595171afbe197 Mon Sep 17 00:00:00 2001 From: Marius Alwan Meyer <22202402+sporqist@users.noreply.github.com> Date: Sat, 29 Apr 2023 20:22:03 +0000 Subject: [PATCH] =?UTF-8?q?[FIX]=20Starte=20Gitea=20neu,=20wenn=20die=20Co?= =?UTF-8?q?nfig=20ge=C3=A4ndert=20wurde?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- handlers/main.yaml | 5 +++++ tasks/main.yaml | 21 ++++++++------------- 2 files changed, 13 insertions(+), 13 deletions(-) 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