mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-09-07 18:57:12 +02:00
Optimized snipe-it und bbb
This commit is contained in:
18
roles/docker-compose/tasks/04_ensure_up.yml
Normal file
18
roles/docker-compose/tasks/04_ensure_up.yml
Normal file
@@ -0,0 +1,18 @@
|
||||
- name: "Check if any container is running in {{ docker_compose.directories.instance }}"
|
||||
command: docker compose ps -q --filter status=running
|
||||
args:
|
||||
chdir: "{{ docker_compose.directories.instance }}"
|
||||
register: docker_ps
|
||||
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
|
||||
failed_when: >
|
||||
docker_ps.rc != 0
|
||||
and
|
||||
'no configuration file provided: not found' not in (docker_ps.stderr | default(''))
|
||||
when: >
|
||||
not (
|
||||
docker_compose_template.changed | default(false)
|
||||
or
|
||||
env_template.changed | default(false)
|
||||
)
|
||||
notify: docker compose up
|
Reference in New Issue
Block a user