initial commit
This commit is contained in:
12
roles/docker/tasks/get-containerstatus.yml
Normal file
12
roles/docker/tasks/get-containerstatus.yml
Normal file
@@ -0,0 +1,12 @@
|
||||
---
|
||||
- name: Ensure Docker Compose project is up
|
||||
community.docker.docker_compose_v2:
|
||||
project_src: "{{ docker_compose_path }}"
|
||||
state: present
|
||||
register: compose_status
|
||||
|
||||
- name: Set fact for container status
|
||||
set_fact:
|
||||
container_status: "{{ container_status | default({}) | combine({item.Name: (item.State == 'running')}) }}"
|
||||
verbosity: 0
|
||||
with_items: "{{ compose_status.containers }}"
|
||||
Reference in New Issue
Block a user