From ae87e28245755dcf1832f0cf76d9707df3c96a5a Mon Sep 17 00:00:00 2001 From: Michael Grote Date: Fri, 15 Nov 2024 20:34:36 +0000 Subject: [PATCH] changed Files: roles/mgrote_docker_compose_inline/tasks/main.yml Signed-off-by: Michael Grote --- roles/mgrote_docker_compose_inline/tasks/main.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/roles/mgrote_docker_compose_inline/tasks/main.yml b/roles/mgrote_docker_compose_inline/tasks/main.yml index a954f734..224a0bed 100644 --- a/roles/mgrote_docker_compose_inline/tasks/main.yml +++ b/roles/mgrote_docker_compose_inline/tasks/main.yml @@ -51,9 +51,17 @@ when: - 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 become: true - ansible.builtin.command: "docker-compose pull && docker-compose up -d" + ansible.builtin.command: docker-compose up -d args: chdir: "{{ compose_dest_basedir }}/{{ item.name }}" register: start_result # speichere ergebnis in var