Run backup before recreating container(s) if a new image has been downloaded.
This commit is contained in:
parent
81cd44918e
commit
93c291289c
3 changed files with 48 additions and 6 deletions
|
@ -28,7 +28,21 @@
|
|||
mode: '770'
|
||||
become: true
|
||||
|
||||
- name: Pull/Create/Restart project services
|
||||
- name: Pull project services
|
||||
community.docker.docker_compose:
|
||||
project_src: "{{ etebase_project_dir }}"
|
||||
recreate: never
|
||||
pull: true
|
||||
debug: true
|
||||
when: docker_pull_images | bool
|
||||
register: etebase_docker_compose_pull_result
|
||||
|
||||
- name: Include backup tasks
|
||||
include_tasks:
|
||||
file: backup.yml
|
||||
# Make a backup if we didn't already make one and we pulled a new image
|
||||
when: not run_backup and etebase_docker_compose_pull_result['actions'] | default([]) | selectattr('pulled_image', 'defined') | length > 0
|
||||
|
||||
- name: Create/Restart project services
|
||||
community.docker.docker_compose:
|
||||
project_src: "{{ etebase_project_dir }}"
|
||||
pull: "{{ docker_pull_images | bool }}"
|
||||
|
|
|
@ -45,9 +45,23 @@
|
|||
mode: '770'
|
||||
become: true
|
||||
|
||||
- name: Pull/Create/Restart project services
|
||||
- name: Pull project services
|
||||
community.docker.docker_compose:
|
||||
project_src: "{{ synapse_project_dir }}"
|
||||
recreate: never
|
||||
pull: true
|
||||
debug: true
|
||||
when: docker_pull_images | bool
|
||||
register: synapse_docker_compose_pull_result
|
||||
|
||||
- name: Include backup tasks
|
||||
include_tasks:
|
||||
file: backup.yml
|
||||
# Make a backup if we didn't already make one and we pulled a new image
|
||||
when: not run_backup and synapse_docker_compose_pull_result['actions'] | default([]) | selectattr('pulled_image', 'defined') | length > 0
|
||||
|
||||
- name: Create/Restart project services
|
||||
community.docker.docker_compose:
|
||||
project_src: "{{ synapse_project_dir }}"
|
||||
pull: "{{ docker_pull_images | bool }}"
|
||||
# Restart if config file(s) changed
|
||||
restarted: "{{ synapse_template_homeserver_result['changed'] | bool }}"
|
||||
|
|
|
@ -20,7 +20,21 @@
|
|||
mode: '770'
|
||||
become: true
|
||||
|
||||
- name: Pull/Create/Restart project services
|
||||
- name: Pull project services
|
||||
community.docker.docker_compose:
|
||||
project_src: "{{ vaultwarden_project_dir }}"
|
||||
recreate: never
|
||||
pull: true
|
||||
debug: true
|
||||
when: docker_pull_images | bool
|
||||
register: vaultwarden_docker_compose_pull_result
|
||||
|
||||
- name: Include backup tasks
|
||||
include_tasks:
|
||||
file: backup.yml
|
||||
# Make a backup if we didn't already make one and we pulled a new image
|
||||
when: not run_backup and vaultwarden_docker_compose_pull_result['actions'] | default([]) | selectattr('pulled_image', 'defined') | length > 0
|
||||
|
||||
- name: Create/Restart project services
|
||||
community.docker.docker_compose:
|
||||
project_src: "{{ vaultwarden_project_dir }}"
|
||||
pull: "{{ docker_pull_images | bool }}"
|
||||
|
|
Loading…
Reference in a new issue