--- - name: Verify hosts: all gather_facts: false tasks: - ansible.builtin.include_vars: file: ../../defaults/main.yml - name: Get mosquitto container state community.docker.docker_container: name: "{{ mosquitto_container_name }}" register: result - name: Check if mosquitto containers are running ansible.builtin.assert: that: - result.container['State']['Status'] == "running" - result.container['State']['Restarting'] == false