diff --git a/roles/buku/handlers/main.yml b/roles/buku/handlers/main.yml index b8e64ec..b0627e1 100644 --- a/roles/buku/handlers/main.yml +++ b/roles/buku/handlers/main.yml @@ -1,7 +1,7 @@ --- - name: buku | Restart buku - community.docker.docker_compose: - project_src: "{{ buku__path }}" - state: present - restarted: yes + ansible.builtin.command: docker compose up --detach + args: + chdir: "{{ buku__path }}" + become: true diff --git a/roles/buku/tasks/main.yml b/roles/buku/tasks/main.yml index 7011398..b38f4b7 100644 --- a/roles/buku/tasks/main.yml +++ b/roles/buku/tasks/main.yml @@ -19,8 +19,7 @@ notify: buku | Restart buku - name: Buku | Pull image and start service - community.docker.docker_compose: - project_src: "{{ buku__path }}" - pull: yes - state: present + ansible.builtin.command: docker compose up --detach + args: + chdir: "{{ buku__path }}" become: true diff --git a/roles/buku/templates/docker-compose.j2 b/roles/buku/templates/docker-compose.j2 index a02759e..763bdb7 100644 --- a/roles/buku/templates/docker-compose.j2 +++ b/roles/buku/templates/docker-compose.j2 @@ -16,10 +16,11 @@ services: # - BUKUSERVER_SECRET_KEY=123456789012345678901234 # - BUKUSERVER_URL_RENDER_MODE=full # - BUKUSERVER_DISABLE_FAVICON=false + networks: + - caddy-net volumes: - "{{ buku__path}}/data:/root/.local/share/buku" networks: - default: - external: - name: caddy-net + caddy-net: + external: true diff --git a/roles/caddy/handlers/main.yml b/roles/caddy/handlers/main.yml index aa91c84..4fa9622 100644 --- a/roles/caddy/handlers/main.yml +++ b/roles/caddy/handlers/main.yml @@ -1,7 +1,7 @@ --- - name: Caddy | Restart Caddy - community.docker.docker_compose: - project_src: "{{ caddy__path }}" - state: present - restarted: yes + ansible.builtin.command: docker compose up --detach + args: + chdir: "{{ caddy__path }}" + become: true diff --git a/roles/caddy/tasks/docker.yml b/roles/caddy/tasks/docker.yml index da5c6c7..09eb0c3 100644 --- a/roles/caddy/tasks/docker.yml +++ b/roles/caddy/tasks/docker.yml @@ -1,5 +1,4 @@ --- - - name: Caddy | Docker | Copy docker-compose.yml template: src: docker-compose.j2 @@ -10,8 +9,7 @@ notify: Caddy | Restart Caddy - name: Caddy | Docker | Pull image and start service - community.docker.docker_compose: - project_src: "{{ caddy__path }}" - pull: yes - state: present + ansible.builtin.command: docker compose up --detach + args: + chdir: "{{ caddy__path }}" become: true diff --git a/roles/grafana/handlers/main.yml b/roles/grafana/handlers/main.yml index 7f3c6b2..355cbaf 100644 --- a/roles/grafana/handlers/main.yml +++ b/roles/grafana/handlers/main.yml @@ -1,7 +1,6 @@ --- - - name: Grafana | Restart Grafana - community.docker.docker_compose: - project_src: "{{ grafana__path }}" - state: present - restarted: yes + ansible.builtin.command: docker compose up --detach + args: + chdir: "{{ grafana__path }}" + become: true diff --git a/roles/grafana/tasks/main.yml b/roles/grafana/tasks/main.yml index 89f5fb7..e06afaa 100644 --- a/roles/grafana/tasks/main.yml +++ b/roles/grafana/tasks/main.yml @@ -1,5 +1,4 @@ --- - - name: Grafana | Make sure Grafana datasources path exists file: path: "{{ grafana__path }}/provisioning/datasources" @@ -62,8 +61,7 @@ notify: Grafana | Restart Grafana - name: Grafana | Pull image and start service - community.docker.docker_compose: - project_src: "{{ grafana__path }}" - pull: yes - state: present + ansible.builtin.command: docker compose up --detach + args: + chdir: "{{ grafana__path }}" become: true diff --git a/roles/grafana/templates/docker-compose.j2 b/roles/grafana/templates/docker-compose.j2 index ed63a53..117e025 100644 --- a/roles/grafana/templates/docker-compose.j2 +++ b/roles/grafana/templates/docker-compose.j2 @@ -22,5 +22,5 @@ services: networks: default: - external: - name: caddy-net + name: caddy-net + external: true diff --git a/roles/mealie/handlers/main.yml b/roles/mealie/handlers/main.yml index 3ccfe89..8efa53d 100644 --- a/roles/mealie/handlers/main.yml +++ b/roles/mealie/handlers/main.yml @@ -1,7 +1,7 @@ --- - name: Mealie | Restart Mealie - community.docker.docker_compose: - project_src: "{{ mealie__path }}" - state: present - restarted: yes + ansible.builtin.command: docker compose up --detach + args: + chdir: "{{ mealie__path }}" + become: true diff --git a/roles/mealie/tasks/main.yml b/roles/mealie/tasks/main.yml index 2c4ceee..b89579b 100644 --- a/roles/mealie/tasks/main.yml +++ b/roles/mealie/tasks/main.yml @@ -21,10 +21,9 @@ notify: Mealie | Restart Mealie - name: Mealie | Pull image and start service - community.docker.docker_compose: - project_src: "{{ mealie__path }}" - pull: yes - state: present + ansible.builtin.command: docker compose up --detach + args: + chdir: "{{ mealie__path }}" become: true - name: Mealie | Copy backup script diff --git a/roles/papermerge/handlers/main.yml b/roles/papermerge/handlers/main.yml index 916ba61..ffa9ea2 100644 --- a/roles/papermerge/handlers/main.yml +++ b/roles/papermerge/handlers/main.yml @@ -1,7 +1,6 @@ --- - - name: Papermerge | Restart Papermerge - community.docker.docker_compose: - project_src: "{{ papermerge__path }}" - state: present - restarted: yes + ansible.builtin.command: docker compose up --detach + args: + chdir: "{{ papermerge__path }}" + become: true diff --git a/roles/papermerge/tasks/main.yml b/roles/papermerge/tasks/main.yml index a6e678a..6d12bc5 100644 --- a/roles/papermerge/tasks/main.yml +++ b/roles/papermerge/tasks/main.yml @@ -30,10 +30,9 @@ notify: Papermerge | Restart Papermerge - name: Papermerge | Pull image and start service - community.docker.docker_compose: - project_src: "{{ papermerge__path }}" - pull: yes - state: present + ansible.builtin.command: docker compose up --detach + args: + chdir: "{{ papermerge__path }}" become: true - name: Papermerge | Set up database backup cron job diff --git a/roles/prometheus/handlers/main.yml b/roles/prometheus/handlers/main.yml index 95c8c4b..7ffa155 100644 --- a/roles/prometheus/handlers/main.yml +++ b/roles/prometheus/handlers/main.yml @@ -1,7 +1,7 @@ --- - name: Prometheus | Restart Prometheus - community.docker.docker_compose: - project_src: "{{ prometheus__path }}" - state: present - restarted: yes + ansible.builtin.command: docker compose up --detach + args: + chdir: "{{ prometheus__path }}" + become: true diff --git a/roles/prometheus/tasks/main.yml b/roles/prometheus/tasks/main.yml index 1149f14..245a6b5 100644 --- a/roles/prometheus/tasks/main.yml +++ b/roles/prometheus/tasks/main.yml @@ -1,5 +1,4 @@ --- - - name: Prometheus | Make sure Prometheus path exists file: path: "{{ prometheus__path }}" @@ -27,8 +26,7 @@ notify: Prometheus | Restart Prometheus - name: Prometheus | Pull image and start service - community.docker.docker_compose: - project_src: "{{ prometheus__path }}" - pull: yes - state: present + ansible.builtin.command: docker compose up --detach + args: + chdir: "{{ prometheus__path }}" become: true diff --git a/roles/prometheus/templates/docker-compose.j2 b/roles/prometheus/templates/docker-compose.j2 index dbdd395..e1a8651 100644 --- a/roles/prometheus/templates/docker-compose.j2 +++ b/roles/prometheus/templates/docker-compose.j2 @@ -59,5 +59,5 @@ services: networks: default: - external: - name: caddy-net + name: caddy-net + external: true diff --git a/roles/syncthing/handlers/main.yml b/roles/syncthing/handlers/main.yml index 6d847d1..d974700 100644 --- a/roles/syncthing/handlers/main.yml +++ b/roles/syncthing/handlers/main.yml @@ -1,7 +1,6 @@ --- - - name: Syncthing | Restart Syncthing - community.docker.docker_compose: - project_src: "{{ syncthing__path }}" - state: present - restarted: yes + ansible.builtin.command: docker compose up --detach + args: + chdir: "{{ syncthing__path }}" + become: true diff --git a/roles/syncthing/tasks/main.yml b/roles/syncthing/tasks/main.yml index 615a7a5..bc048a2 100644 --- a/roles/syncthing/tasks/main.yml +++ b/roles/syncthing/tasks/main.yml @@ -1,5 +1,4 @@ --- - - name: Syncthing | Make sure Syncthing path exists file: path: "{{ syncthing__path }}" @@ -18,10 +17,9 @@ notify: Syncthing | Restart Syncthing - name: Syncthing | Pull image and start service - community.docker.docker_compose: - project_src: "{{ syncthing__path }}" - pull: yes - state: present + ansible.builtin.command: docker compose up --detach + args: + chdir: "{{ syncthing__path }}" become: true - name: Docker | Set up ufw rules diff --git a/roles/syncthing/templates/docker-compose.j2 b/roles/syncthing/templates/docker-compose.j2 index a03efc4..63602d2 100644 --- a/roles/syncthing/templates/docker-compose.j2 +++ b/roles/syncthing/templates/docker-compose.j2 @@ -20,5 +20,5 @@ services: networks: default: - external: - name: caddy-net + name: caddy-net + external: true diff --git a/roles/watchtower/handlers/main.yml b/roles/watchtower/handlers/main.yml index 5eaf069..a96ff52 100644 --- a/roles/watchtower/handlers/main.yml +++ b/roles/watchtower/handlers/main.yml @@ -1,7 +1,7 @@ --- - name: Watchtower | Restart Watchtower - community.docker.docker_compose: - project_src: "{{ watchtower__path }}" - state: present - restarted: yes + ansible.builtin.command: docker compose up --detach + args: + chdir: "{{ watchtower__path }}" + become: true diff --git a/roles/watchtower/tasks/main.yml b/roles/watchtower/tasks/main.yml index 9e5db54..683cbc1 100644 --- a/roles/watchtower/tasks/main.yml +++ b/roles/watchtower/tasks/main.yml @@ -18,8 +18,7 @@ notify: Watchtower | Restart Watchtower - name: Watchtower | Pull image and start service - community.docker.docker_compose: - project_src: "{{ watchtower__path }}" - pull: yes - state: present + ansible.builtin.command: docker compose up --detach + args: + chdir: "{{ watchtower__path }}" become: true diff --git a/roles/watchtower/templates/docker-compose.j2 b/roles/watchtower/templates/docker-compose.j2 index aa8ed83..4f71713 100644 --- a/roles/watchtower/templates/docker-compose.j2 +++ b/roles/watchtower/templates/docker-compose.j2 @@ -21,5 +21,5 @@ services: networks: default: - external: - name: caddy-net + name: caddy-net + external: true