Refactor Update or create container
This commit is contained in:
parent
49a6a3f712
commit
ede7570e68
7 changed files with 13 additions and 76 deletions
|
@ -21,19 +21,10 @@
|
|||
- { src: 'docker-compose.yml.j2', dest: 'docker-compose.yml' }
|
||||
register: cloud_copy_templates_results
|
||||
|
||||
- name: Force update and restart container
|
||||
- name: Update and restart container
|
||||
community.docker.docker_compose:
|
||||
project_src: cloud
|
||||
state: present
|
||||
pull: true
|
||||
restarted: true
|
||||
when: cloud_copy_files_results.changed or cloud_copy_templates_results.changed
|
||||
become: true
|
||||
|
||||
- name: Update or start container
|
||||
community.docker.docker_compose:
|
||||
project_src: cloud
|
||||
state: present
|
||||
pull: true
|
||||
when: not cloud_copy_files_results.changed and not cloud_copy_templates_results.changed
|
||||
restarted: "{{ cloud_copy_files_results.changed or cloud_copy_templates_results.changed }}"
|
||||
become: true
|
|
@ -14,19 +14,10 @@
|
|||
- { src: 'docker-compose.yml.j2', dest: 'docker-compose.yml' }
|
||||
register: home_assistant_copy_templates_results
|
||||
|
||||
- name: Force update and restart container
|
||||
- name: Update and restart container
|
||||
community.docker.docker_compose:
|
||||
project_src: home_assistant
|
||||
state: present
|
||||
pull: true
|
||||
restarted: true
|
||||
when: home_assistant_copy_templates_results.changed
|
||||
become: true
|
||||
|
||||
- name: Update or start container
|
||||
community.docker.docker_compose:
|
||||
project_src: home_assistant
|
||||
state: present
|
||||
pull: true
|
||||
when: not home_assistant_copy_templates_results.changed
|
||||
restarted: "{{ home_assistant_copy_templates_results.changed }}"
|
||||
become: true
|
|
@ -21,19 +21,10 @@
|
|||
- { src: 'docker-compose.yml.j2', dest: 'docker-compose.yml' }
|
||||
register: matrix_copy_templates_results
|
||||
|
||||
- name: Force update and restart container
|
||||
- name: Update and restart container
|
||||
community.docker.docker_compose:
|
||||
project_src: matrix
|
||||
state: present
|
||||
pull: true
|
||||
restarted: true
|
||||
when: matrix_copy_files_results.changed or matrix_copy_templates_results.changed
|
||||
restarted: "{{ matrix_copy_files_results.changed or matrix_copy_templates_results.changed }}"
|
||||
become: true
|
||||
|
||||
- name: Update or start container
|
||||
community.docker.docker_compose:
|
||||
project_src: matrix
|
||||
state: present
|
||||
pull: true
|
||||
when: not matrix_copy_files_results.changed and not matrix_copy_templates_results.changed
|
||||
become: true
|
|
@ -14,19 +14,10 @@
|
|||
- { src: 'docker-compose.yml.j2', dest: 'docker-compose.yml' }
|
||||
register: n8n_copy_templates_results
|
||||
|
||||
- name: Force update and restart container
|
||||
- name: Update and restart container
|
||||
community.docker.docker_compose:
|
||||
project_src: n8n
|
||||
state: present
|
||||
pull: true
|
||||
restarted: true
|
||||
when: n8n_copy_templates_results.changed
|
||||
restarted: "{{ n8n_copy_templates_results.changed }}"
|
||||
become: true
|
||||
|
||||
- name: Update or start container
|
||||
community.docker.docker_compose:
|
||||
project_src: n8n
|
||||
state: present
|
||||
pull: true
|
||||
when: not n8n_copy_templates_results.changed
|
||||
become: true
|
|
@ -32,19 +32,10 @@
|
|||
msg: Please run init.sh in protonmail folder and set variable protonmail.initialized to true and restart tasks
|
||||
when: not protonmail.initialized
|
||||
|
||||
- name: Force update and restart container
|
||||
- name: Update and restart container
|
||||
community.docker.docker_compose:
|
||||
project_src: protonmail
|
||||
state: present
|
||||
pull: true
|
||||
restarted: true
|
||||
when: protonmail.initialized and (protonmail_copy_templates_results.changed or protonmail_copy_files_results.changed)
|
||||
restarted: "{{ protonmail.initialized and (protonmail_copy_templates_results.changed or protonmail_copy_files_results.changed) }}"
|
||||
become: true
|
||||
|
||||
- name: Update or start container
|
||||
community.docker.docker_compose:
|
||||
project_src: protonmail
|
||||
state: present
|
||||
pull: true
|
||||
when: protonmail.initialized and not protonmail_copy_templates_results.changed and not protonmail_copy_files_results.changed
|
||||
become: true
|
|
@ -28,19 +28,10 @@
|
|||
state: present
|
||||
become: true
|
||||
|
||||
- name: Force update and restart container
|
||||
- name: Update and restart container
|
||||
community.docker.docker_compose:
|
||||
project_src: traefik
|
||||
state: present
|
||||
pull: true
|
||||
restarted: true
|
||||
when: traefik_copy_files_results.changed or traefik_copy_templates_results.changed
|
||||
become: true
|
||||
|
||||
- name: Update or start container
|
||||
community.docker.docker_compose:
|
||||
project_src: traefik
|
||||
state: present
|
||||
pull: true
|
||||
when: not traefik_copy_files_results.changed and not traefik_copy_templates_results.changed
|
||||
restarted: "{{ traefik_copy_files_results.changed or traefik_copy_templates_results.changed }}"
|
||||
become: true
|
|
@ -19,14 +19,5 @@
|
|||
project_src: whoami
|
||||
state: present
|
||||
pull: true
|
||||
restarted: true
|
||||
when: whoami_copy_templates_results.changed
|
||||
restarted: "{{ whoami_copy_templates_results.changed }}"
|
||||
become: true
|
||||
|
||||
- name: Update or start container
|
||||
community.docker.docker_compose:
|
||||
project_src: whoami
|
||||
state: present
|
||||
pull: true
|
||||
when: not whoami_copy_templates_results.changed
|
||||
become: true
|
Loading…
Reference in a new issue