diff --git a/tasks/main.yaml b/tasks/main.yaml index cb7ccba..071f3da 100644 --- a/tasks/main.yaml +++ b/tasks/main.yaml @@ -55,6 +55,7 @@ dest: "/opt/gitea/environment.env" owner: root mode: 0600 + register: gitea_env - name: Upload docker-compose.yaml ansible.builtin.template: @@ -62,9 +63,12 @@ dest: /opt/gitea/docker-compose.yaml owner: root mode: 0600 + register: gitea_container -- name: Create Gitea container +- name: Create / Recreate Gitea container community.docker.docker_compose: project_src: /opt/gitea state: present - recreate: smart + restarted: true + when: gitea_env.changed or gitea_container.changed +