Replace docker-compose restart hack with shell handler hack

The docker-compose integration would start 2 of the same container, which does bad things to things like databases!
This commit is contained in:
Jake Howard
2020-06-28 20:13:12 +01:00
parent 71086ca291
commit 86a398d6b4
34 changed files with 112 additions and 271 deletions

View File

@ -16,14 +16,8 @@
register: compose_file
become: true
- name: Cycle calibre container
docker_compose:
project_src: /opt/calibre
pull: true
remove_orphans: true
remove_volumes: true
state: "{{ item }}"
- name: restart calibre
shell:
chdir: /opt/calibre
cmd: "{{ docker_update_command }}"
when: compose_file.changed
loop:
- absent
- present

View File

@ -16,14 +16,8 @@
register: compose_file
become: true
- name: Cycle folding@home container
docker_compose:
project_src: /opt/folding-at-home
pull: true
remove_orphans: true
remove_volumes: true
state: "{{ item }}"
- name: restart folding-at-home
shell:
chdir: /opt/folding-at-home
cmd: "{{ docker_update_command }}"
when: compose_file.changed
loop:
- absent
- present

View File

@ -44,14 +44,8 @@
register: git_mirror_config_file
become: true
- name: Cycle gitea container
docker_compose:
project_src: /opt/gitea
pull: true
remove_orphans: true
remove_volumes: true
state: "{{ item }}"
- name: restart gitea
shell:
chdir: /opt/gitea
cmd: "{{ docker_update_command }}"
when: compose_file.changed or gitea_config_file.changed or git_mirror_config_file.changed
loop:
- absent
- present

View File

@ -16,14 +16,9 @@
register: compose_file
become: true
- name: Cycle gotify container
docker_compose:
project_src: /opt/gotify
pull: true
remove_orphans: true
remove_volumes: true
state: "{{ item }}"
- name: restart gotify
shell:
chdir: /opt/gotify
cmd: "{{ docker_update_command }}"
when: compose_file.changed
loop:
- absent
- present

View File

@ -16,17 +16,11 @@
register: compose_file
become: true
- name: Cycle jellyfin container
docker_compose:
project_src: /opt/jellyfin
pull: true
remove_orphans: true
remove_volumes: true
state: "{{ item }}"
- name: restart jellyfin
shell:
chdir: /opt/jellyfin
cmd: "{{ docker_update_command }}"
when: compose_file.changed
loop:
- absent
- present
- name: Set media permissions
cron:

View File

@ -19,14 +19,8 @@
register: compose_file
become: true
- name: Cycle librespeed container
docker_compose:
project_src: /opt/librespeed
pull: true
remove_orphans: true
remove_volumes: true
state: "{{ item }}"
- name: restart librespeed
shell:
chdir: /opt/librespeed
cmd: "{{ docker_update_command }}"
when: compose_file.changed
loop:
- absent
- present

View File

@ -35,14 +35,8 @@
register: config_file
become: true
- name: Cycle nextcloud container
docker_compose:
project_src: /opt/nextcloud
pull: true
remove_orphans: true
remove_volumes: true
state: "{{ item }}"
- name: restart nextcloud
shell:
chdir: /opt/nextcloud
cmd: "{{ docker_update_command }}"
when: compose_file.changed or config_file.changed
loop:
- absent
- present

View File

@ -16,14 +16,8 @@
register: compose_file
become: true
- name: Cycle quassel container
docker_compose:
project_src: /opt/quassel
pull: true
remove_orphans: true
remove_volumes: true
state: "{{ item }}"
- name: restart quassel
shell:
chdir: /opt/quassel
cmd: "{{ docker_update_command }}"
when: compose_file.changed
loop:
- absent
- present

View File

@ -28,17 +28,11 @@
register: homeserver_config
become: true
- name: Cycle synapse container
docker_compose:
project_src: /opt/synapse
pull: true
remove_orphans: true
remove_volumes: true
state: "{{ item }}"
- name: restart synapse
shell:
chdir: /opt/synapse
cmd: "{{ docker_update_command }}"
when: compose_file.changed or homeserver_config.changed
loop:
- absent
- present
- name: Install helper scripts
git:

View File

@ -19,14 +19,8 @@
register: compose_file
become: true
- name: Cycle todoist-github container
docker_compose:
project_src: /opt/todoist-github
pull: true
remove_orphans: true
remove_volumes: true
state: "{{ item }}"
- name: restart todoist-github
shell:
chdir: /opt/todoist-github
cmd: "{{ docker_update_command }}"
when: compose_file.changed
loop:
- absent
- present

View File

@ -16,14 +16,8 @@
register: compose_file
become: true
- name: Cycle torrent container
docker_compose:
project_src: /opt/torrent
pull: true
remove_orphans: true
remove_volumes: true
state: "{{ item }}"
- name: restart torrent
shell:
chdir: /opt/torrent
cmd: "{{ docker_update_command }}"
when: compose_file.changed
loop:
- absent
- present

View File

@ -32,14 +32,8 @@
register: config_file
become: true
- name: Cycle tt-rss container
docker_compose:
project_src: /opt/tt-rss
pull: true
remove_orphans: true
remove_volumes: true
state: "{{ item }}"
- name: restart tt-rss
shell:
chdir: /opt/tt-rss
cmd: "{{ docker_update_command }}"
when: compose_file.changed or config_file.changed
loop:
- absent
- present

View File

@ -19,14 +19,8 @@
register: compose_file
become: true
- name: Cycle wallabag container
docker_compose:
project_src: /opt/wallabag
pull: true
remove_orphans: true
remove_volumes: true
state: "{{ item }}"
- name: restart wallabag
shell:
chdir: /opt/wallabag
cmd: "{{ docker_update_command }}"
when: compose_file.changed
loop:
- absent
- present

View File

@ -16,14 +16,8 @@
register: compose_file
become: true
- name: Cycle web-rng container
docker_compose:
project_src: /opt/web-rng
pull: true
remove_orphans: true
remove_volumes: true
state: "{{ item }}"
- name: restart web-rng
shell:
chdir: /opt/web-rng
cmd: "{{ docker_update_command }}"
when: compose_file.changed
loop:
- absent
- present

View File

@ -16,14 +16,8 @@
register: compose_file
become: true
- name: Cycle whoami container
docker_compose:
project_src: /opt/whoami
pull: true
remove_orphans: true
remove_volumes: true
state: "{{ item }}"
when: compose_file.changed
loop:
- absent
- present
- name: restart whoami
shell:
chdir: /opt/whoami
cmd: "{{ docker_update_command }}"
when: compose_file.changed or config_file.changed