summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjuanvallejo <jvallejo@redhat.com>2017-05-12 17:30:11 -0400
committerjuanvallejo <jvallejo@redhat.com>2017-05-12 17:30:11 -0400
commitc46a19ad719efae03362b75865cdf8dbd747b4cb (patch)
tree083650ea8394b5497afc3fddc50e3d2298a764d9
parent95fd767a8242c66f3d62428cb6fce88e2eca3c13 (diff)
downloadopenshift-c46a19ad719efae03362b75865cdf8dbd747b4cb.tar.gz
openshift-c46a19ad719efae03362b75865cdf8dbd747b4cb.tar.bz2
openshift-c46a19ad719efae03362b75865cdf8dbd747b4cb.tar.xz
openshift-c46a19ad719efae03362b75865cdf8dbd747b4cb.zip
check if hostname is in list of etcd hosts
-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)