fix role docker_compose: pull and restart #243
1 changed files with 9 additions and 1 deletions
|
@ -51,9 +51,17 @@
|
||||||
when:
|
when:
|
||||||
- item.network is defined
|
- item.network is defined
|
||||||
|
|
||||||
|
- name: Pull images
|
||||||
|
become: true
|
||||||
|
ansible.builtin.command: docker-compose pull
|
||||||
|
args:
|
||||||
|
chdir: "{{ compose_dest_basedir }}/{{ item.name }}"
|
||||||
|
register: pull_result # speichere ergebnis in var
|
||||||
|
changed_when: "pull_result.rc == 0" # markiere tasks als changed when exit-code == 0
|
||||||
|
|
||||||
- name: (re)start container
|
- name: (re)start container
|
||||||
become: true
|
become: true
|
||||||
ansible.builtin.command: "docker-compose pull && docker-compose up -d"
|
ansible.builtin.command: docker-compose up -d
|
||||||
args:
|
args:
|
||||||
chdir: "{{ compose_dest_basedir }}/{{ item.name }}"
|
chdir: "{{ compose_dest_basedir }}/{{ item.name }}"
|
||||||
register: start_result # speichere ergebnis in var
|
register: start_result # speichere ergebnis in var
|
||||||
|
|
Loading…
Reference in a new issue