mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-08-15 08:30:46 +02:00
Optimized docker compose ensure logic
This commit is contained in:
parent
766ef8619f
commit
a9d77de2a4
@ -3,12 +3,16 @@
|
||||
args:
|
||||
chdir: "{{ docker_compose.directories.instance }}"
|
||||
register: docker_ps
|
||||
changed_when: (docker_ps.stdout | trim) == ""
|
||||
changed_when: >
|
||||
(docker_ps.stdout | trim) == ""
|
||||
# The failed when catches the condition when an docker compose file will be dynamicly build after the file routine
|
||||
# Also if an .env file isn't present
|
||||
failed_when: >
|
||||
docker_ps.rc != 0
|
||||
and
|
||||
'no configuration file provided: not found' not in (docker_ps.stderr | default(''))
|
||||
and (
|
||||
(docker_ps.stderr | default(''))
|
||||
| regex_search('(no configuration file provided|no such file or directory|env file .* not found)') is none
|
||||
)
|
||||
when: >
|
||||
not (
|
||||
docker_compose_template.changed | default(false)
|
||||
|
Loading…
x
Reference in New Issue
Block a user