I am aware of community.docker.docker_container_info where one can mention the name of the container and obtain information about it. However I cannot find any information on what is the equivalent to obtaining a list of currently running containers on the device.
My goal is to perform a complete prune of the device, however the community.docker.docker_prune only provides pruning of non-running containers.
because docker ps -a --format=json provides distinct JSON structures as opposed to a list of JSON, this is why I need to format from from_json gymnastics in the middle.
I’d probably also set a fact for the docker ps -a --format=json output with a dict2items filter and then loop on that, but the way you have done it is fine, if it works .