summaryrefslogtreecommitdiffstats
path: root/roles/openshift_health_checker/openshift_checks/package_version.py
diff options
context:
space:
mode:
Diffstat (limited to 'roles/openshift_health_checker/openshift_checks/package_version.py')
-rw-r--r--roles/openshift_health_checker/openshift_checks/package_version.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/roles/openshift_health_checker/openshift_checks/package_version.py b/roles/openshift_health_checker/openshift_checks/package_version.py
new file mode 100644
index 000000000..a473119f3
--- /dev/null
+++ b/roles/openshift_health_checker/openshift_checks/package_version.py
@@ -0,0 +1,25 @@
+# pylint: disable=missing-docstring
+from openshift_checks import OpenShiftCheck, OpenShiftCheckException
+from openshift_checks.mixins import NotContainerized
+
+
+class PackageVersion(NotContainerized, OpenShiftCheck):
+ """Check that available RPM packages match the required versions."""
+
+ name = "package_version"
+
+ @classmethod
+ def is_active(cls, task_vars):
+ return (
+ super(PackageVersion, cls).is_active(task_vars)
+ and task_vars.get("deployment_type") == "openshift-enterprise"
+ )
+
+ def run(self, tmp, task_vars):
+ try:
+ openshift_release = task_vars["openshift_release"]
+ except (KeyError, TypeError):
+ raise OpenShiftCheckException("'openshift_release' is undefined")
+
+ args = {"version": openshift_release}
+ return self.module_executor("aos_version", args, tmp, task_vars)