Skip to content

Commit

Permalink
update docker commands
Browse files Browse the repository at this point in the history
  • Loading branch information
stehessel committed Dec 10, 2023
1 parent a21c9bf commit 764a738
Show file tree
Hide file tree
Showing 21 changed files with 68 additions and 82 deletions.
8 changes: 4 additions & 4 deletions roles/buku/handlers/main.yml
Original file line number Diff line number Diff line change
@@ -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
7 changes: 3 additions & 4 deletions roles/buku/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
7 changes: 4 additions & 3 deletions roles/buku/templates/docker-compose.j2
Original file line number Diff line number Diff line change
Expand Up @@ -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
8 changes: 4 additions & 4 deletions roles/caddy/handlers/main.yml
Original file line number Diff line number Diff line change
@@ -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
8 changes: 3 additions & 5 deletions roles/caddy/tasks/docker.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---

- name: Caddy | Docker | Copy docker-compose.yml
template:
src: docker-compose.j2
Expand All @@ -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
9 changes: 4 additions & 5 deletions roles/grafana/handlers/main.yml
Original file line number Diff line number Diff line change
@@ -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
8 changes: 3 additions & 5 deletions roles/grafana/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---

- name: Grafana | Make sure Grafana datasources path exists
file:
path: "{{ grafana__path }}/provisioning/datasources"
Expand Down Expand Up @@ -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
4 changes: 2 additions & 2 deletions roles/grafana/templates/docker-compose.j2
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ services:

networks:
default:
external:
name: caddy-net
name: caddy-net
external: true
8 changes: 4 additions & 4 deletions roles/mealie/handlers/main.yml
Original file line number Diff line number Diff line change
@@ -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
7 changes: 3 additions & 4 deletions roles/mealie/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 4 additions & 5 deletions roles/papermerge/handlers/main.yml
Original file line number Diff line number Diff line change
@@ -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
7 changes: 3 additions & 4 deletions roles/papermerge/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions roles/prometheus/handlers/main.yml
Original file line number Diff line number Diff line change
@@ -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
8 changes: 3 additions & 5 deletions roles/prometheus/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---

- name: Prometheus | Make sure Prometheus path exists
file:
path: "{{ prometheus__path }}"
Expand Down Expand Up @@ -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
4 changes: 2 additions & 2 deletions roles/prometheus/templates/docker-compose.j2
Original file line number Diff line number Diff line change
Expand Up @@ -59,5 +59,5 @@ services:

networks:
default:
external:
name: caddy-net
name: caddy-net
external: true
9 changes: 4 additions & 5 deletions roles/syncthing/handlers/main.yml
Original file line number Diff line number Diff line change
@@ -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
8 changes: 3 additions & 5 deletions roles/syncthing/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---

- name: Syncthing | Make sure Syncthing path exists
file:
path: "{{ syncthing__path }}"
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions roles/syncthing/templates/docker-compose.j2
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ services:

networks:
default:
external:
name: caddy-net
name: caddy-net
external: true
8 changes: 4 additions & 4 deletions roles/watchtower/handlers/main.yml
Original file line number Diff line number Diff line change
@@ -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
7 changes: 3 additions & 4 deletions roles/watchtower/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions roles/watchtower/templates/docker-compose.j2
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ services:

networks:
default:
external:
name: caddy-net
name: caddy-net
external: true

0 comments on commit 764a738

Please sign in to comment.