ansible-collections / community.docker

Community Docker Collection for Ansible: modules and plugins for working with Docker
https://galaxy.ansible.com/ui/repo/published/community/docker//
GNU General Public License v3.0
193 stars 108 forks source link

Show global state (docker ps or docker-compose ps) #862

Open fredbcode opened 1 month ago

fredbcode commented 1 month ago

Maybe I missed something but I found no way to show all containers state ?

Something like:

community.docker.docker_container_info: name: all

I'm just searching a way to see the containers state of my compose or at least for all the containers (with or without compose)

felixfontein commented 1 month ago

You can use the community.docker.docker_host_info module with containers: true, containers_all: true, and verbose_output: true. You can use containers_filters to filter for specific groups of containers.

For Docker Compose there's no specific module to show the running containers for a Compose.