aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Goddard <mark@stackhpc.com>2018-09-04 16:09:41 +0100
committerBartosz Bezak <bartosz@stackhpc.com>2025-01-27 20:22:46 +0000
commitfa6535890c333b88b470fb0fc7504abf5c39ed97 (patch)
tree2fb586bca35331a209d5ba4ee262d88d002f112f
parent13e98d3db00cfc4ffd0b938146fded0c0c5c87ee (diff)
downloadkolla-ansible-fa6535890c333b88b470fb0fc7504abf5c39ed97.tar.gz
kolla-ansible-fa6535890c333b88b470fb0fc7504abf5c39ed97.zip
Reintroduce kolla-ansible check
This allows operators quickly diagnose all containers across all hosts by running kolla-ansible check. It returns a list of containers that are missing, not running or in unhealthy state for each OpenStack service. Change-Id: I36119ccdeb264aa3de928ec2254d6ff4cc955bfb Implements: blueprint check-containers Co-Authored-By: Roman KrĨek <roman.krcek@tietoevry.com>
-rw-r--r--ansible/roles/aodh/tasks/check.yml3
-rw-r--r--ansible/roles/barbican/tasks/check.yml4
-rw-r--r--ansible/roles/blazar/tasks/check.yml3
-rw-r--r--ansible/roles/ceilometer/tasks/check.yml3
-rw-r--r--ansible/roles/cinder/tasks/check.yml4
-rw-r--r--ansible/roles/cloudkitty/tasks/check.yml3
-rw-r--r--ansible/roles/collectd/tasks/check.yml3
-rw-r--r--ansible/roles/common/tasks/check.yml3
-rw-r--r--ansible/roles/cyborg/tasks/check.yml3
-rw-r--r--ansible/roles/designate/tasks/check.yml3
-rw-r--r--ansible/roles/etcd/tasks/check.yml3
-rw-r--r--ansible/roles/glance/tasks/check.yml4
-rw-r--r--ansible/roles/gnocchi/tasks/check.yml3
-rw-r--r--ansible/roles/grafana/tasks/check.yml3
-rw-r--r--ansible/roles/hacluster/tasks/check.yml3
-rw-r--r--ansible/roles/heat/tasks/check.yml3
-rw-r--r--ansible/roles/horizon/tasks/check.yml3
-rw-r--r--ansible/roles/influxdb/tasks/check.yml3
-rw-r--r--ansible/roles/ironic/tasks/check.yml3
-rw-r--r--ansible/roles/iscsi/tasks/check.yml3
-rw-r--r--ansible/roles/keystone/tasks/check.yml4
-rw-r--r--ansible/roles/kuryr/tasks/check.yml3
-rw-r--r--ansible/roles/letsencrypt/tasks/check.yml4
-rw-r--r--ansible/roles/loadbalancer/tasks/check.yml3
-rw-r--r--ansible/roles/magnum/tasks/check.yml3
-rw-r--r--ansible/roles/manila/tasks/check.yml3
-rw-r--r--ansible/roles/mariadb/tasks/check.yml7
-rw-r--r--ansible/roles/masakari/tasks/check.yml3
-rw-r--r--ansible/roles/memcached/tasks/check.yml3
-rw-r--r--ansible/roles/mistral/tasks/check.yml3
-rw-r--r--ansible/roles/multipathd/tasks/check.yml3
-rw-r--r--ansible/roles/neutron/tasks/check.yml3
-rw-r--r--ansible/roles/nova-cell/tasks/check.yml3
-rw-r--r--ansible/roles/nova/tasks/check.yml3
-rw-r--r--ansible/roles/octavia/tasks/check.yml3
-rw-r--r--ansible/roles/opensearch/tasks/check.yml3
-rw-r--r--ansible/roles/openvswitch/tasks/check.yml3
-rw-r--r--ansible/roles/ovn-controller/tasks/check.yml4
-rw-r--r--ansible/roles/ovn-db/tasks/check.yml4
-rw-r--r--ansible/roles/ovs-dpdk/tasks/check.yml3
-rw-r--r--ansible/roles/placement/tasks/check.yml3
-rw-r--r--ansible/roles/prometheus/tasks/check.yml3
-rw-r--r--ansible/roles/rabbitmq/tasks/check.yml3
-rw-r--r--ansible/roles/redis/tasks/check.yml4
-rw-r--r--ansible/roles/service-check/defaults/main.yml3
-rw-r--r--ansible/roles/service-check/tasks/main.yml38
-rw-r--r--ansible/roles/service-check/vars/main.yml9
-rw-r--r--ansible/roles/skyline/tasks/check.yml3
-rw-r--r--ansible/roles/tacker/tasks/check.yml3
-rw-r--r--ansible/roles/telegraf/tasks/check.yml3
-rw-r--r--ansible/roles/trove/tasks/check.yml3
-rw-r--r--ansible/roles/venus/tasks/check.yml3
-rw-r--r--ansible/roles/watcher/tasks/check.yml3
-rw-r--r--ansible/roles/zun/tasks/check.yml3
-rw-r--r--kolla_ansible/cli/commands.py14
-rw-r--r--releasenotes/notes/reintroduce-check-2a385b77e044c507.yaml9
-rw-r--r--setup.cfg2
-rwxr-xr-xtests/deploy.sh2
58 files changed, 238 insertions, 4 deletions
diff --git a/ansible/roles/aodh/tasks/check.yml b/ansible/roles/aodh/tasks/check.yml
index ed97d539c..c278b658f 100644
--- a/ansible/roles/aodh/tasks/check.yml
+++ b/ansible/roles/aodh/tasks/check.yml
@@ -1 +1,4 @@
---
+- name: Checking Aodh containers
+ import_role:
+ role: service-check
diff --git a/ansible/roles/barbican/tasks/check.yml b/ansible/roles/barbican/tasks/check.yml
new file mode 100644
index 000000000..ebc210110
--- /dev/null
+++ b/ansible/roles/barbican/tasks/check.yml
@@ -0,0 +1,4 @@
+---
+- name: Checking Barbican containers
+ import_role:
+ role: service-check
diff --git a/ansible/roles/blazar/tasks/check.yml b/ansible/roles/blazar/tasks/check.yml
index ed97d539c..8eca8c337 100644
--- a/ansible/roles/blazar/tasks/check.yml
+++ b/ansible/roles/blazar/tasks/check.yml
@@ -1 +1,4 @@
---
+- name: Checking Blazar containers
+ import_role:
+ role: service-check
diff --git a/ansible/roles/ceilometer/tasks/check.yml b/ansible/roles/ceilometer/tasks/check.yml
index ed97d539c..28ea6b2ab 100644
--- a/ansible/roles/ceilometer/tasks/check.yml
+++ b/ansible/roles/ceilometer/tasks/check.yml
@@ -1 +1,4 @@
---
+- name: Checking Ceilometer containers
+ import_role:
+ role: service-check
diff --git a/ansible/roles/cinder/tasks/check.yml b/ansible/roles/cinder/tasks/check.yml
new file mode 100644
index 000000000..3e457f5da
--- /dev/null
+++ b/ansible/roles/cinder/tasks/check.yml
@@ -0,0 +1,4 @@
+---
+- name: Checking Cinder containers
+ import_role:
+ role: service-check
diff --git a/ansible/roles/cloudkitty/tasks/check.yml b/ansible/roles/cloudkitty/tasks/check.yml
index ed97d539c..205b2e096 100644
--- a/ansible/roles/cloudkitty/tasks/check.yml
+++ b/ansible/roles/cloudkitty/tasks/check.yml
@@ -1 +1,4 @@
---
+- name: Checking Cloudkitty containers
+ import_role:
+ role: service-check
diff --git a/ansible/roles/collectd/tasks/check.yml b/ansible/roles/collectd/tasks/check.yml
index ed97d539c..6235423a1 100644
--- a/ansible/roles/collectd/tasks/check.yml
+++ b/ansible/roles/collectd/tasks/check.yml
@@ -1 +1,4 @@
---
+- name: Checking Collectd containers
+ import_role:
+ role: service-check
diff --git a/ansible/roles/common/tasks/check.yml b/ansible/roles/common/tasks/check.yml
index ed97d539c..b435981ef 100644
--- a/ansible/roles/common/tasks/check.yml
+++ b/ansible/roles/common/tasks/check.yml
@@ -1 +1,4 @@
---
+- name: Checking Common containers
+ import_role:
+ role: service-check
diff --git a/ansible/roles/cyborg/tasks/check.yml b/ansible/roles/cyborg/tasks/check.yml
index ed97d539c..b311ec09e 100644
--- a/ansible/roles/cyborg/tasks/check.yml
+++ b/ansible/roles/cyborg/tasks/check.yml
@@ -1 +1,4 @@
---
+- name: Checking Cyborg containers
+ import_role:
+ role: service-check
diff --git a/ansible/roles/designate/tasks/check.yml b/ansible/roles/designate/tasks/check.yml
index ed97d539c..357d69288 100644
--- a/ansible/roles/designate/tasks/check.yml
+++ b/ansible/roles/designate/tasks/check.yml
@@ -1 +1,4 @@
---
+- name: Checking Designate containers
+ import_role:
+ role: service-check
diff --git a/ansible/roles/etcd/tasks/check.yml b/ansible/roles/etcd/tasks/check.yml
index ed97d539c..323e0152e 100644
--- a/ansible/roles/etcd/tasks/check.yml
+++ b/ansible/roles/etcd/tasks/check.yml
@@ -1 +1,4 @@
---
+- name: Checking Etcd containers
+ import_role:
+ role: service-check
diff --git a/ansible/roles/glance/tasks/check.yml b/ansible/roles/glance/tasks/check.yml
new file mode 100644
index 000000000..f01d99737
--- /dev/null
+++ b/ansible/roles/glance/tasks/check.yml
@@ -0,0 +1,4 @@
+---
+- name: Checking Glance containers
+ import_role:
+ role: service-check
diff --git a/ansible/roles/gnocchi/tasks/check.yml b/ansible/roles/gnocchi/tasks/check.yml
index ed97d539c..0c11217b0 100644
--- a/ansible/roles/gnocchi/tasks/check.yml
+++ b/ansible/roles/gnocchi/tasks/check.yml
@@ -1 +1,4 @@
---
+- name: Checking Gnocchi containers
+ import_role:
+ role: service-check
diff --git a/ansible/roles/grafana/tasks/check.yml b/ansible/roles/grafana/tasks/check.yml
index ed97d539c..536695ad2 100644
--- a/ansible/roles/grafana/tasks/check.yml
+++ b/ansible/roles/grafana/tasks/check.yml
@@ -1 +1,4 @@
---
+- name: Checking Grafana containers
+ import_role:
+ role: service-check
diff --git a/ansible/roles/hacluster/tasks/check.yml b/ansible/roles/hacluster/tasks/check.yml
index ed97d539c..971a17abc 100644
--- a/ansible/roles/hacluster/tasks/check.yml
+++ b/ansible/roles/hacluster/tasks/check.yml
@@ -1 +1,4 @@
---
+- name: Checking Hacluster containers
+ import_role:
+ role: service-check
diff --git a/ansible/roles/heat/tasks/check.yml b/ansible/roles/heat/tasks/check.yml
index ed97d539c..3bf605b70 100644
--- a/ansible/roles/heat/tasks/check.yml
+++ b/ansible/roles/heat/tasks/check.yml
@@ -1 +1,4 @@
---
+- name: Checking Heat containers
+ import_role:
+ role: service-check
diff --git a/ansible/roles/horizon/tasks/check.yml b/ansible/roles/horizon/tasks/check.yml
index ed97d539c..fc0f18450 100644
--- a/ansible/roles/horizon/tasks/check.yml
+++ b/ansible/roles/horizon/tasks/check.yml
@@ -1 +1,4 @@
---
+- name: Checking Horizon containers
+ import_role:
+ role: service-check
diff --git a/ansible/roles/influxdb/tasks/check.yml b/ansible/roles/influxdb/tasks/check.yml
index ed97d539c..bac2c14f9 100644
--- a/ansible/roles/influxdb/tasks/check.yml
+++ b/ansible/roles/influxdb/tasks/check.yml
@@ -1 +1,4 @@
---
+- name: Checking Influxdb containers
+ import_role:
+ role: service-check
diff --git a/ansible/roles/ironic/tasks/check.yml b/ansible/roles/ironic/tasks/check.yml
index ed97d539c..876452eeb 100644
--- a/ansible/roles/ironic/tasks/check.yml
+++ b/ansible/roles/ironic/tasks/check.yml
@@ -1 +1,4 @@
---
+- name: Checking Ironic containers
+ import_role:
+ role: service-check
diff --git a/ansible/roles/iscsi/tasks/check.yml b/ansible/roles/iscsi/tasks/check.yml
index ed97d539c..8b29740eb 100644
--- a/ansible/roles/iscsi/tasks/check.yml
+++ b/ansible/roles/iscsi/tasks/check.yml
@@ -1 +1,4 @@
---
+- name: Checking iSCSI containers
+ import_role:
+ role: service-check
diff --git a/ansible/roles/keystone/tasks/check.yml b/ansible/roles/keystone/tasks/check.yml
new file mode 100644
index 000000000..2aa3f49b1
--- /dev/null
+++ b/ansible/roles/keystone/tasks/check.yml
@@ -0,0 +1,4 @@
+---
+- name: Checking Keystone containers
+ import_role:
+ role: service-check
diff --git a/ansible/roles/kuryr/tasks/check.yml b/ansible/roles/kuryr/tasks/check.yml
index ed97d539c..7067817b9 100644
--- a/ansible/roles/kuryr/tasks/check.yml
+++ b/ansible/roles/kuryr/tasks/check.yml
@@ -1 +1,4 @@
---
+- name: Checking Kuryr containers
+ import_role:
+ role: service-check
diff --git a/ansible/roles/letsencrypt/tasks/check.yml b/ansible/roles/letsencrypt/tasks/check.yml
new file mode 100644
index 000000000..dd3b331e2
--- /dev/null
+++ b/ansible/roles/letsencrypt/tasks/check.yml
@@ -0,0 +1,4 @@
+---
+- name: Checking LetsEncrypt containers
+ import_role:
+ role: service-check
diff --git a/ansible/roles/loadbalancer/tasks/check.yml b/ansible/roles/loadbalancer/tasks/check.yml
index ed97d539c..4ed4b9409 100644
--- a/ansible/roles/loadbalancer/tasks/check.yml
+++ b/ansible/roles/loadbalancer/tasks/check.yml
@@ -1 +1,4 @@
---
+- name: Checking Loadbalancer containers
+ import_role:
+ role: service-check
diff --git a/ansible/roles/magnum/tasks/check.yml b/ansible/roles/magnum/tasks/check.yml
index ed97d539c..cd4e4da1e 100644
--- a/ansible/roles/magnum/tasks/check.yml
+++ b/ansible/roles/magnum/tasks/check.yml
@@ -1 +1,4 @@
---
+- name: Checking Magnum containers
+ import_role:
+ role: service-check
diff --git a/ansible/roles/manila/tasks/check.yml b/ansible/roles/manila/tasks/check.yml
index ed97d539c..1b93701e0 100644
--- a/ansible/roles/manila/tasks/check.yml
+++ b/ansible/roles/manila/tasks/check.yml
@@ -1 +1,4 @@
---
+- name: Checking Manila containers
+ import_role:
+ role: service-check
diff --git a/ansible/roles/mariadb/tasks/check.yml b/ansible/roles/mariadb/tasks/check.yml
index 1697a9012..4d246c8f8 100644
--- a/ansible/roles/mariadb/tasks/check.yml
+++ b/ansible/roles/mariadb/tasks/check.yml
@@ -1,7 +1,8 @@
---
-# Explicitly wait for the database to be accessible via the load balancer.
-# Sometimes it can reject connections even when all database services are up,
-# due to the health check polling in HAProxy.
+- name: Checking Mariadb containers
+ import_role:
+ role: service-check
+
- name: Wait for MariaDB service to be ready through VIP
become: true
command: >
diff --git a/ansible/roles/masakari/tasks/check.yml b/ansible/roles/masakari/tasks/check.yml
index ed97d539c..c9425eba0 100644
--- a/ansible/roles/masakari/tasks/check.yml
+++ b/ansible/roles/masakari/tasks/check.yml
@@ -1 +1,4 @@
---
+- name: Checking Masakari containers
+ import_role:
+ role: service-check
diff --git a/ansible/roles/memcached/tasks/check.yml b/ansible/roles/memcached/tasks/check.yml
index ed97d539c..ac42c557f 100644
--- a/ansible/roles/memcached/tasks/check.yml
+++ b/ansible/roles/memcached/tasks/check.yml
@@ -1 +1,4 @@
---
+- name: Checking Memcached containers
+ import_role:
+ role: service-check
diff --git a/ansible/roles/mistral/tasks/check.yml b/ansible/roles/mistral/tasks/check.yml
index ed97d539c..89d318024 100644
--- a/ansible/roles/mistral/tasks/check.yml
+++ b/ansible/roles/mistral/tasks/check.yml
@@ -1 +1,4 @@
---
+- name: Checking Mistral containers
+ import_role:
+ role: service-check
diff --git a/ansible/roles/multipathd/tasks/check.yml b/ansible/roles/multipathd/tasks/check.yml
index ed97d539c..978cfc8da 100644
--- a/ansible/roles/multipathd/tasks/check.yml
+++ b/ansible/roles/multipathd/tasks/check.yml
@@ -1 +1,4 @@
---
+- name: Checking multipathd containers
+ import_role:
+ role: service-check
diff --git a/ansible/roles/neutron/tasks/check.yml b/ansible/roles/neutron/tasks/check.yml
index ed97d539c..34cb23882 100644
--- a/ansible/roles/neutron/tasks/check.yml
+++ b/ansible/roles/neutron/tasks/check.yml
@@ -1 +1,4 @@
---
+- name: Checking Neutron containers
+ import_role:
+ role: service-check
diff --git a/ansible/roles/nova-cell/tasks/check.yml b/ansible/roles/nova-cell/tasks/check.yml
index ed97d539c..6dd1ec9e7 100644
--- a/ansible/roles/nova-cell/tasks/check.yml
+++ b/ansible/roles/nova-cell/tasks/check.yml
@@ -1 +1,4 @@
---
+- name: Checking Nova-cell containers
+ import_role:
+ role: service-check
diff --git a/ansible/roles/nova/tasks/check.yml b/ansible/roles/nova/tasks/check.yml
index ed97d539c..9a05a49da 100644
--- a/ansible/roles/nova/tasks/check.yml
+++ b/ansible/roles/nova/tasks/check.yml
@@ -1 +1,4 @@
---
+- name: Checking Nova containers
+ import_role:
+ role: service-check
diff --git a/ansible/roles/octavia/tasks/check.yml b/ansible/roles/octavia/tasks/check.yml
index ed97d539c..991e11c71 100644
--- a/ansible/roles/octavia/tasks/check.yml
+++ b/ansible/roles/octavia/tasks/check.yml
@@ -1 +1,4 @@
---
+- name: Checking Octavia containers
+ import_role:
+ role: service-check
diff --git a/ansible/roles/opensearch/tasks/check.yml b/ansible/roles/opensearch/tasks/check.yml
index ed97d539c..31be0031b 100644
--- a/ansible/roles/opensearch/tasks/check.yml
+++ b/ansible/roles/opensearch/tasks/check.yml
@@ -1 +1,4 @@
---
+- name: Checking OpenSearch containers
+ import_role:
+ role: service-check
diff --git a/ansible/roles/openvswitch/tasks/check.yml b/ansible/roles/openvswitch/tasks/check.yml
index ed97d539c..2e6c2237d 100644
--- a/ansible/roles/openvswitch/tasks/check.yml
+++ b/ansible/roles/openvswitch/tasks/check.yml
@@ -1 +1,4 @@
---
+- name: Checking Openvswitch containers
+ import_role:
+ role: service-check
diff --git a/ansible/roles/ovn-controller/tasks/check.yml b/ansible/roles/ovn-controller/tasks/check.yml
new file mode 100644
index 000000000..f3e7af2f5
--- /dev/null
+++ b/ansible/roles/ovn-controller/tasks/check.yml
@@ -0,0 +1,4 @@
+---
+- name: Checking OVN-controller containers
+ import_role:
+ role: service-check
diff --git a/ansible/roles/ovn-db/tasks/check.yml b/ansible/roles/ovn-db/tasks/check.yml
new file mode 100644
index 000000000..28e6a6c37
--- /dev/null
+++ b/ansible/roles/ovn-db/tasks/check.yml
@@ -0,0 +1,4 @@
+---
+- name: Checking OVN-DB containers
+ import_role:
+ role: service-check
diff --git a/ansible/roles/ovs-dpdk/tasks/check.yml b/ansible/roles/ovs-dpdk/tasks/check.yml
index ed97d539c..2e59502e6 100644
--- a/ansible/roles/ovs-dpdk/tasks/check.yml
+++ b/ansible/roles/ovs-dpdk/tasks/check.yml
@@ -1 +1,4 @@
---
+- name: Checking OVN-DPDK containers
+ import_role:
+ role: service-check
diff --git a/ansible/roles/placement/tasks/check.yml b/ansible/roles/placement/tasks/check.yml
index ed97d539c..7b644e3e6 100644
--- a/ansible/roles/placement/tasks/check.yml
+++ b/ansible/roles/placement/tasks/check.yml
@@ -1 +1,4 @@
---
+- name: Checking Placement containers
+ import_role:
+ role: service-check
diff --git a/ansible/roles/prometheus/tasks/check.yml b/ansible/roles/prometheus/tasks/check.yml
index ed97d539c..fd01e03db 100644
--- a/ansible/roles/prometheus/tasks/check.yml
+++ b/ansible/roles/prometheus/tasks/check.yml
@@ -1 +1,4 @@
---
+- name: Checking Prometheus containers
+ import_role:
+ role: service-check
diff --git a/ansible/roles/rabbitmq/tasks/check.yml b/ansible/roles/rabbitmq/tasks/check.yml
index ed97d539c..c55e6ca31 100644
--- a/ansible/roles/rabbitmq/tasks/check.yml
+++ b/ansible/roles/rabbitmq/tasks/check.yml
@@ -1 +1,4 @@
---
+- name: Checking Rabbitmq containers
+ import_role:
+ role: service-check
diff --git a/ansible/roles/redis/tasks/check.yml b/ansible/roles/redis/tasks/check.yml
index bd4a16dcf..0e3c55039 100644
--- a/ansible/roles/redis/tasks/check.yml
+++ b/ansible/roles/redis/tasks/check.yml
@@ -1,4 +1,8 @@
---
+- name: Checking Redis containers
+ import_role:
+ role: service-check
+
- name: Redis ping pong check
become: true
command: "{{ kolla_container_engine }} exec redis redis-cli -h {{ api_interface_address }} -a {{ redis_master_password }} ping"
diff --git a/ansible/roles/service-check/defaults/main.yml b/ansible/roles/service-check/defaults/main.yml
new file mode 100644
index 000000000..100e4606c
--- /dev/null
+++ b/ansible/roles/service-check/defaults/main.yml
@@ -0,0 +1,3 @@
+---
+# Dict mapping service names to container configuration.
+service_check_services: {}
diff --git a/ansible/roles/service-check/tasks/main.yml b/ansible/roles/service-check/tasks/main.yml
new file mode 100644
index 000000000..0c0ddf72e
--- /dev/null
+++ b/ansible/roles/service-check/tasks/main.yml
@@ -0,0 +1,38 @@
+---
+# Check whether all necessary containers are running.
+- name: "{{ kolla_role_name | default(project_name) }} | Get container facts"
+ become: true
+ kolla_container_facts:
+ action: get_containers
+ container_engine: "{{ kolla_container_engine }}"
+ name: "{{ service_check_enabled_container_names }}"
+ register: container_facts
+ when: service_check_enabled_container_names | length > 0
+
+- name: "{{ kolla_role_name | default(project_name) }} | Fail if containers are missing or not running"
+ vars:
+ missing_containers: >-
+ {{ service_check_enabled_container_names | difference(container_facts) | list }}
+ fail:
+ msg: >
+ The following {{ kolla_role_name | default(project_name) }} containers are missing or not running:
+ {{ missing_containers | join(', ') }}
+ when:
+ - container_facts is defined
+ - missing_containers | length > 0
+
+- name: "{{ kolla_role_name | default(project_name) }} | Fail if containers are unhealthy"
+ vars:
+ unhealthy_containers: >-
+ {{ container_facts |
+ dict2items |
+ selectattr("value.Status", "defined") |
+ selectattr("value.Status", "search", "unhealthy") |
+ map(attribute='key') | list }}
+ fail:
+ msg: >
+ The following {{ kolla_role_name | default(project_name) }} containers are unhealthy:
+ {{ unhealthy_containers | join(', ') }}
+ when:
+ - container_facts is defined
+ - unhealthy_containers | length > 0
diff --git a/ansible/roles/service-check/vars/main.yml b/ansible/roles/service-check/vars/main.yml
new file mode 100644
index 000000000..460ee5cf0
--- /dev/null
+++ b/ansible/roles/service-check/vars/main.yml
@@ -0,0 +1,9 @@
+---
+# List of names of containers to check that are enabled and mapped to this
+# host.
+service_check_enabled_container_names: >-
+ {{ lookup('vars', (kolla_role_name | default(project_name)) + '_services') |
+ select_services_enabled_and_mapped_to_host |
+ dict2items |
+ map(attribute='value.container_name') |
+ list }}
diff --git a/ansible/roles/skyline/tasks/check.yml b/ansible/roles/skyline/tasks/check.yml
index ed97d539c..e5fa13177 100644
--- a/ansible/roles/skyline/tasks/check.yml
+++ b/ansible/roles/skyline/tasks/check.yml
@@ -1 +1,4 @@
---
+- name: Checking Skyline containers
+ import_role:
+ role: service-check
diff --git a/ansible/roles/tacker/tasks/check.yml b/ansible/roles/tacker/tasks/check.yml
index ed97d539c..694ef01e6 100644
--- a/ansible/roles/tacker/tasks/check.yml
+++ b/ansible/roles/tacker/tasks/check.yml
@@ -1 +1,4 @@
---
+- name: Checking Tacker containers
+ import_role:
+ role: service-check
diff --git a/ansible/roles/telegraf/tasks/check.yml b/ansible/roles/telegraf/tasks/check.yml
index ed97d539c..85fa450a5 100644
--- a/ansible/roles/telegraf/tasks/check.yml
+++ b/ansible/roles/telegraf/tasks/check.yml
@@ -1 +1,4 @@
---
+- name: Checking Telegraf containers
+ import_role:
+ role: service-check
diff --git a/ansible/roles/trove/tasks/check.yml b/ansible/roles/trove/tasks/check.yml
index ed97d539c..fdbca1667 100644
--- a/ansible/roles/trove/tasks/check.yml
+++ b/ansible/roles/trove/tasks/check.yml
@@ -1 +1,4 @@
---
+- name: Checking Trove containers
+ import_role:
+ role: service-check
diff --git a/ansible/roles/venus/tasks/check.yml b/ansible/roles/venus/tasks/check.yml
index ed97d539c..63d29a6f3 100644
--- a/ansible/roles/venus/tasks/check.yml
+++ b/ansible/roles/venus/tasks/check.yml
@@ -1 +1,4 @@
---
+- name: Checking Venus containers
+ import_role:
+ role: service-check
diff --git a/ansible/roles/watcher/tasks/check.yml b/ansible/roles/watcher/tasks/check.yml
index ed97d539c..c836a8512 100644
--- a/ansible/roles/watcher/tasks/check.yml
+++ b/ansible/roles/watcher/tasks/check.yml
@@ -1 +1,4 @@
---
+- name: Checking Watcher containers
+ import_role:
+ role: service-check
diff --git a/ansible/roles/zun/tasks/check.yml b/ansible/roles/zun/tasks/check.yml
index ed97d539c..02ed4f654 100644
--- a/ansible/roles/zun/tasks/check.yml
+++ b/ansible/roles/zun/tasks/check.yml
@@ -1 +1,4 @@
---
+- name: Checking Zun containers
+ import_role:
+ role: service-check
diff --git a/kolla_ansible/cli/commands.py b/kolla_ansible/cli/commands.py
index fa3b1908c..bbeeece89 100644
--- a/kolla_ansible/cli/commands.py
+++ b/kolla_ansible/cli/commands.py
@@ -469,3 +469,17 @@ class NovaLibvirtCleanup(KollaAnsibleMixin, Command):
playbooks = _choose_playbooks(parsed_args, "nova-libvirt-cleanup")
self.run_playbooks(parsed_args, playbooks)
+
+
+class Check(KollaAnsibleMixin, Command):
+ """Check container status"""
+
+ def take_action(self, parsed_args):
+ self.app.LOG.info("Checking container status")
+
+ extra_vars = {}
+ extra_vars["kolla_action"] = "check"
+
+ playbooks = _choose_playbooks(parsed_args)
+
+ self.run_playbooks(parsed_args, playbooks, extra_vars=extra_vars)
diff --git a/releasenotes/notes/reintroduce-check-2a385b77e044c507.yaml b/releasenotes/notes/reintroduce-check-2a385b77e044c507.yaml
new file mode 100644
index 000000000..ac2e449ac
--- /dev/null
+++ b/releasenotes/notes/reintroduce-check-2a385b77e044c507.yaml
@@ -0,0 +1,9 @@
+---
+features:
+ - |
+ Reintroduce kolla-ansible check.
+ This allows operators to quickly diagnose all containers across
+ all hosts by running kolla-ansible check. It returns a list
+ of containers that are missing, not running or in unhealthy state
+ for each OpenStack service.
+ `Blueprint check-containers <https://blueprints.launchpad.net/kolla-ansible/+spec/check-containers>`__
diff --git a/setup.cfg b/setup.cfg
index 68ccefff9..441072773 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -72,4 +72,4 @@ kolla-ansible.cli =
mariadb-backup = kolla_ansible.cli.commands:MariaDBBackup
mariadb-recovery = kolla_ansible.cli.commands:MariaDBRecovery
nova-libvirt-cleanup = kolla_ansible.cli.commands:NovaLibvirtCleanup
-
+ check = kolla_ansible.cli.commands:Check
diff --git a/tests/deploy.sh b/tests/deploy.sh
index bd68b3caa..e81dbf5dc 100755
--- a/tests/deploy.sh
+++ b/tests/deploy.sh
@@ -71,6 +71,8 @@ function deploy {
if [[ $HAS_UPGRADE == 'no' ]]; then
kolla-ansible validate-config -i ${RAW_INVENTORY} -vvv &> /tmp/logs/ansible/validate-config
+ #TODO(r-krcek) check can be moved out of the if statement in the flamingo cycle
+ kolla-ansible check -i ${RAW_INVENTORY} -vvv &> /tmp/logs/ansible/check
fi
}