changed Files: roles/mgrote_docker_compose_inline/tasks/main.yml
All checks were successful
ansible-lint / gitleaks (pull_request) Successful in 4s
ansible-lint / Ansible Lint (pull_request) Successful in 49s

Signed-off-by: Michael Grote <michael.grote@posteo.de>
This commit is contained in:
Michael Grote 2024-11-15 20:34:36 +00:00
parent 6ae911b82d
commit ae87e28245

View file

@ -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