Преглед на файлове

Allow clock role in openshift_facts

Jeremiah Stuever преди 9 години
родител
ревизия
a7bd843d56
променени са 1 файла, в които са добавени 11 реда и са изтрити 0 реда
  1. 11 0
      roles/openshift_facts/library/openshift_facts.py

+ 11 - 0
roles/openshift_facts/library/openshift_facts.py

@@ -1549,6 +1549,7 @@ class OpenShiftFacts(object):
             OpenShiftFactsUnsupportedRoleError:
             OpenShiftFactsUnsupportedRoleError:
     """
     """
     known_roles = ['builddefaults',
     known_roles = ['builddefaults',
+                   'clock',
                    'cloudprovider',
                    'cloudprovider',
                    'common',
                    'common',
                    'docker',
                    'docker',
@@ -1719,6 +1720,16 @@ class OpenShiftFacts(object):
                 docker['version'] = version_info['version']
                 docker['version'] = version_info['version']
             defaults['docker'] = docker
             defaults['docker'] = docker
 
 
+        if 'clock' in roles:
+            exit_code, _, _ = module.run_command(['rpm', '-q', 'chrony'])
+            if exit_code == 0:
+                chrony_installed = True
+            else:
+                chrony_installed = False
+            defaults['clock'] = dict(
+                enabled=True,
+                chrony_installed=chrony_installed)
+
         if 'cloudprovider' in roles:
         if 'cloudprovider' in roles:
             defaults['cloudprovider'] = dict(kind=None)
             defaults['cloudprovider'] = dict(kind=None)