Closed ShaneMcC closed 3 months ago
Sorry, I forgot to adjust that part of the example when copying it over from the docker_compose module. I'm fixing it in #917.
I've decided to not add the services
dictionary as in the docker_compose module since IMO a list is more flexible. If you want to group the containers by service, you can use output.containers | groupby("Service")
. If you simply want all containers for a service, you can use output.containers | selectattr("Service", "equalto", "name-of-service")
. If you want the first container, add | first
.
SUMMARY
When using
docker_compose_v2
withregister: output
it is no longer possible (despite documentation suggesting otherwise in the examples) to test against the value ofoutput.services.service.container.state.running
becauseservices
is no longer populated in the output dict.output.containers
exists, but this is just a list so can not be tested against as easily because the container name is not used as a key.ISSUE TYPE
COMPONENT NAME
docker_compose_v2
ANSIBLE VERSION
COLLECTION VERSION
CONFIGURATION
OS / ENVIRONMENT
Linux
STEPS TO REPRODUCE
EXPECTED RESULTS
Playbook TASK
Check services are running
to run successfully without errors.ACTUAL RESULTS