2023-03-10 21:00:37 +00:00
|
|
|
---
|
|
|
|
- name: Verify
|
|
|
|
hosts: all
|
|
|
|
gather_facts: false
|
|
|
|
tasks:
|
2023-04-12 22:29:29 +00:00
|
|
|
- ansible.builtin.include_vars:
|
2023-03-10 21:00:37 +00:00
|
|
|
file: ../../defaults/main.yml
|
|
|
|
|
|
|
|
- name: Get Grafana container state
|
2023-04-15 13:11:49 +00:00
|
|
|
community.docker.docker_container_info:
|
2023-03-10 21:00:37 +00:00
|
|
|
name: "{{ stats_grafana_container_name }}"
|
|
|
|
register: result_grafana
|
|
|
|
|
|
|
|
- name: Get Prometheus container state
|
2023-04-15 13:11:49 +00:00
|
|
|
community.docker.docker_container_info:
|
2023-03-10 21:00:37 +00:00
|
|
|
name: "{{ stats_prometheus_container_name }}"
|
|
|
|
register: result_prometheus
|
|
|
|
|
|
|
|
- name: Get Telegraf container state
|
2023-04-15 13:11:49 +00:00
|
|
|
community.docker.docker_container_info:
|
2023-03-10 21:00:37 +00:00
|
|
|
name: "{{ stats_telegraf_container_name }}"
|
|
|
|
register: result_telegraf
|
|
|
|
|
|
|
|
- name: Get Smartctl container state
|
2023-04-15 13:11:49 +00:00
|
|
|
community.docker.docker_container_info:
|
2023-03-10 21:00:37 +00:00
|
|
|
name: "{{ stats_smartctl_container_name }}"
|
|
|
|
register: result_smartctl
|
|
|
|
|
|
|
|
- name: Get Speedtest container state
|
2023-04-15 13:11:49 +00:00
|
|
|
community.docker.docker_container_info:
|
2023-03-10 21:00:37 +00:00
|
|
|
name: "{{ stats_speedtest_container_name }}"
|
|
|
|
register: result_speedtest
|
|
|
|
|
|
|
|
- name: Check if stats docker containers are running
|
2023-04-12 22:29:29 +00:00
|
|
|
ansible.builtin.assert:
|
2023-03-10 21:00:37 +00:00
|
|
|
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
|