summaryrefslogtreecommitdiffstats
path: root/roles
diff options
context:
space:
mode:
Diffstat (limited to 'roles')
-rw-r--r--roles/openshift_health_checker/openshift_checks/etcd_volume.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/roles/openshift_health_checker/openshift_checks/etcd_volume.py b/roles/openshift_health_checker/openshift_checks/etcd_volume.py
index ad88ae44d..b742f7603 100644
--- a/roles/openshift_health_checker/openshift_checks/etcd_volume.py
+++ b/roles/openshift_health_checker/openshift_checks/etcd_volume.py
@@ -14,9 +14,10 @@ class EtcdVolume(OpenShiftCheck):
@classmethod
def is_active(cls, task_vars):
- # TODO: only execute this check on hosts in the 'ectd' group?
- # Maybe also 'masters' if there are no standalone etcd hosts?
- return super(EtcdVolume, cls).is_active(task_vars)
+ etcd_hosts = get_var(task_vars, "groups", "etcd", default=[]) or get_var(task_vars, "groups", "masters",
+ default=[]) or []
+ is_etcd_host = get_var(task_vars, "ansible_ssh_host") in etcd_hosts
+ return super(EtcdVolume, cls).is_active(task_vars) and is_etcd_host
def run(self, tmp, task_vars):
mount_info = self._etcd_mount_info(task_vars)