summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Gugino <mgugino@redhat.com>2017-08-29 17:40:38 -0400
committerMichael Gugino <mgugino@redhat.com>2017-08-29 17:40:38 -0400
commit6dde91d9347a650df355bb7fe1edb746ebae2817 (patch)
tree9581f2c9807f23d37e3bfbb57b692700d5a97534
parent69d5020bc2bdb019cc9a3574310f8ceb14b999ae (diff)
downloadopenshift-6dde91d9347a650df355bb7fe1edb746ebae2817.tar.gz
openshift-6dde91d9347a650df355bb7fe1edb746ebae2817.tar.bz2
openshift-6dde91d9347a650df355bb7fe1edb746ebae2817.tar.xz
openshift-6dde91d9347a650df355bb7fe1edb746ebae2817.zip
Remove meta depends from clock
This role removes openshift_fact meta depends from clock role.
-rw-r--r--roles/openshift_clock/defaults/main.yml2
-rw-r--r--roles/openshift_clock/meta/main.yml3
-rw-r--r--roles/openshift_clock/tasks/main.yaml17
-rwxr-xr-xroles/openshift_facts/library/openshift_facts.py8
4 files changed, 12 insertions, 18 deletions
diff --git a/roles/openshift_clock/defaults/main.yml b/roles/openshift_clock/defaults/main.yml
new file mode 100644
index 000000000..a94f67199
--- /dev/null
+++ b/roles/openshift_clock/defaults/main.yml
@@ -0,0 +1,2 @@
+---
+openshift_clock_enabled: True
diff --git a/roles/openshift_clock/meta/main.yml b/roles/openshift_clock/meta/main.yml
index 3e175beb0..d1e86d826 100644
--- a/roles/openshift_clock/meta/main.yml
+++ b/roles/openshift_clock/meta/main.yml
@@ -11,5 +11,4 @@ galaxy_info:
- 7
categories:
- cloud
-dependencies:
-- { role: openshift_facts }
+dependencies: []
diff --git a/roles/openshift_clock/tasks/main.yaml b/roles/openshift_clock/tasks/main.yaml
index 3911201ea..f8b02524a 100644
--- a/roles/openshift_clock/tasks/main.yaml
+++ b/roles/openshift_clock/tasks/main.yaml
@@ -1,14 +1,15 @@
---
-- name: Set clock facts
- openshift_facts:
- role: clock
- local_facts:
- enabled: "{{ openshift_clock_enabled | default(None) }}"
+- name: Determine if chrony is installed
+ command: rpm -q chrony
+ failed_when: false
+ register: chrony_installed
- name: Install ntp package
package: name=ntp state=present
- when: openshift.clock.enabled | bool and not openshift.clock.chrony_installed | bool
+ when:
+ - openshift_clock_enabled | bool
+ - chrony_installed.rc != 0
- name: Start and enable ntpd/chronyd
- shell: timedatectl set-ntp true
- when: openshift.clock.enabled | bool
+ command: timedatectl set-ntp true
+ when: openshift_clock_enabled | bool
diff --git a/roles/openshift_facts/library/openshift_facts.py b/roles/openshift_facts/library/openshift_facts.py
index 251d1dfb4..cf78b4a75 100755
--- a/roles/openshift_facts/library/openshift_facts.py
+++ b/roles/openshift_facts/library/openshift_facts.py
@@ -1909,7 +1909,6 @@ class OpenShiftFacts(object):
"""
known_roles = ['builddefaults',
'buildoverrides',
- 'clock',
'cloudprovider',
'common',
'docker',
@@ -2099,13 +2098,6 @@ class OpenShiftFacts(object):
docker['service_name'] = 'docker'
defaults['docker'] = docker
- if 'clock' in roles:
- exit_code, _, _ = module.run_command(['rpm', '-q', 'chrony']) # noqa: F405
- chrony_installed = bool(exit_code == 0)
- defaults['clock'] = dict(
- enabled=True,
- chrony_installed=chrony_installed)
-
if 'cloudprovider' in roles:
defaults['cloudprovider'] = dict(kind=None)