--- - name: Verify hosts: all gather_facts: false tasks: - ansible.builtin.include_vars: file: ../../defaults/main.yml - name: Get Grafana container state docker_container_info: name: "{{ stats_grafana_container_name }}" register: result_grafana - name: Get Prometheus container state docker_container_info: name: "{{ stats_prometheus_container_name }}" register: result_prometheus - name: Get Telegraf container state docker_container_info: name: "{{ stats_telegraf_container_name }}" register: result_telegraf - name: Get Smartctl container state docker_container_info: name: "{{ stats_smartctl_container_name }}" register: result_smartctl - name: Get Speedtest container state docker_container_info: name: "{{ stats_speedtest_container_name }}" register: result_speedtest - name: Check if stats docker containers are running ansible.builtin.assert: that: - result_grafana.container['State']['Status'] == "running" - result_grafana.container['State']['Restarting'] == false - result_prometheus.container['State']['Status'] == "running" - result_prometheus.container['State']['Restarting'] == false - result_telegraf.container['State']['Status'] == "running" - result_telegraf.container['State']['Restarting'] == false - result_smartctl.container['State']['Status'] == "running" - result_smartctl.container['State']['Restarting'] == false - result_speedtest.container['State']['Status'] == "running" - result_speedtest.container['State']['Restarting'] == false