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' }
|
- { src: 'docker-compose.yml.j2', dest: 'docker-compose.yml' }
|
||||||
register: cloud_copy_templates_results
|
register: cloud_copy_templates_results
|
||||||
|
|
||||||
- name: Force update and restart container
|
- name: Update and restart container
|
||||||
community.docker.docker_compose:
|
community.docker.docker_compose:
|
||||||
project_src: cloud
|
project_src: cloud
|
||||||
state: present
|
state: present
|
||||||
pull: true
|
pull: true
|
||||||
restarted: true
|
restarted: "{{ cloud_copy_files_results.changed or cloud_copy_templates_results.changed }}"
|
||||||
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
|
|
||||||
become: true
|
become: true
|
|
@ -14,19 +14,10 @@
|
||||||
- { src: 'docker-compose.yml.j2', dest: 'docker-compose.yml' }
|
- { src: 'docker-compose.yml.j2', dest: 'docker-compose.yml' }
|
||||||
register: home_assistant_copy_templates_results
|
register: home_assistant_copy_templates_results
|
||||||
|
|
||||||
- name: Force update and restart container
|
- name: Update and restart container
|
||||||
community.docker.docker_compose:
|
community.docker.docker_compose:
|
||||||
project_src: home_assistant
|
project_src: home_assistant
|
||||||
state: present
|
state: present
|
||||||
pull: true
|
pull: true
|
||||||
restarted: true
|
restarted: "{{ home_assistant_copy_templates_results.changed }}"
|
||||||
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
|
|
||||||
become: true
|
become: true
|
|
@ -21,19 +21,10 @@
|
||||||
- { src: 'docker-compose.yml.j2', dest: 'docker-compose.yml' }
|
- { src: 'docker-compose.yml.j2', dest: 'docker-compose.yml' }
|
||||||
register: matrix_copy_templates_results
|
register: matrix_copy_templates_results
|
||||||
|
|
||||||
- name: Force update and restart container
|
- name: Update and restart container
|
||||||
community.docker.docker_compose:
|
community.docker.docker_compose:
|
||||||
project_src: matrix
|
project_src: matrix
|
||||||
state: present
|
state: present
|
||||||
pull: true
|
pull: true
|
||||||
restarted: true
|
restarted: "{{ matrix_copy_files_results.changed or matrix_copy_templates_results.changed }}"
|
||||||
when: 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
|
become: true
|
|
@ -14,19 +14,10 @@
|
||||||
- { src: 'docker-compose.yml.j2', dest: 'docker-compose.yml' }
|
- { src: 'docker-compose.yml.j2', dest: 'docker-compose.yml' }
|
||||||
register: n8n_copy_templates_results
|
register: n8n_copy_templates_results
|
||||||
|
|
||||||
- name: Force update and restart container
|
- name: Update and restart container
|
||||||
community.docker.docker_compose:
|
community.docker.docker_compose:
|
||||||
project_src: n8n
|
project_src: n8n
|
||||||
state: present
|
state: present
|
||||||
pull: true
|
pull: true
|
||||||
restarted: true
|
restarted: "{{ n8n_copy_templates_results.changed }}"
|
||||||
when: 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
|
become: true
|
|
@ -32,19 +32,10 @@
|
||||||
msg: Please run init.sh in protonmail folder and set variable protonmail.initialized to true and restart tasks
|
msg: Please run init.sh in protonmail folder and set variable protonmail.initialized to true and restart tasks
|
||||||
when: not protonmail.initialized
|
when: not protonmail.initialized
|
||||||
|
|
||||||
- name: Force update and restart container
|
- name: Update and restart container
|
||||||
community.docker.docker_compose:
|
community.docker.docker_compose:
|
||||||
project_src: protonmail
|
project_src: protonmail
|
||||||
state: present
|
state: present
|
||||||
pull: true
|
pull: true
|
||||||
restarted: true
|
restarted: "{{ protonmail.initialized and (protonmail_copy_templates_results.changed or protonmail_copy_files_results.changed) }}"
|
||||||
when: 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
|
become: true
|
|
@ -28,19 +28,10 @@
|
||||||
state: present
|
state: present
|
||||||
become: true
|
become: true
|
||||||
|
|
||||||
- name: Force update and restart container
|
- name: Update and restart container
|
||||||
community.docker.docker_compose:
|
community.docker.docker_compose:
|
||||||
project_src: traefik
|
project_src: traefik
|
||||||
state: present
|
state: present
|
||||||
pull: true
|
pull: true
|
||||||
restarted: true
|
restarted: "{{ traefik_copy_files_results.changed or traefik_copy_templates_results.changed }}"
|
||||||
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
|
|
||||||
become: true
|
become: true
|
|
@ -19,14 +19,5 @@
|
||||||
project_src: whoami
|
project_src: whoami
|
||||||
state: present
|
state: present
|
||||||
pull: true
|
pull: true
|
||||||
restarted: true
|
restarted: "{{ whoami_copy_templates_results.changed }}"
|
||||||
when: 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
|
become: true
|
Loading…
Reference in a new issue