Crash-looping containers can cause the Ansible docker playbook to fail
Example output with a crash-looping container:
TASK [float-base-docker : Get list of running containers] ************************************ fatal: [host2]: FAILED! => {"changed": false, "cmd": "podman ps --format='{{.Names}}'", "delta": "0:00:20.062922", "end": "2021-02-02 17:56:38.893583", "msg": "non-zero return code", "rc": 125, "start": "2021-02-02 17:56:18.830661", "stderr": "Error: container 34c6f69886f68eb9c9ee3744bc170a4defcb1831d80a9cc707125fdd4dd55687 does not exist in database: no such container", "stderr_lines": ["Error: container 34c6f69886f68eb9c9ee3744bc170a4defcb1831d80a9cc707125fdd4dd55687 does not exist in database: no such container"], "stdout": "", "stdout_lines": []}
this is where we're getting the list of running containers, to stop those that should not be there. It would be best if the "stopping" task was conditional on the "podman ps" one succeeding, so that in case of problems obtaining the list of running containers we could just skip the removal step (and hope that it'll be fixed in the next push)