Selaa lähdekoodia

Allow clock role in openshift_facts

Jeremiah Stuever 9 vuotta sitten
vanhempi
commit
a7bd843d56
1 muutettua tiedostoa jossa 11 lisäystä ja 0 poistoa
  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:
     """
     known_roles = ['builddefaults',
+                   'clock',
                    'cloudprovider',
                    'common',
                    'docker',
@@ -1719,6 +1720,16 @@ class OpenShiftFacts(object):
                 docker['version'] = version_info['version']
             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:
             defaults['cloudprovider'] = dict(kind=None)