summaryrefslogtreecommitdiffstats
path: root/roles
diff options
context:
space:
mode:
Diffstat (limited to 'roles')
-rw-r--r--roles/openshift_clock/meta/main.yml15
-rw-r--r--roles/openshift_clock/tasks/main.yaml14
-rw-r--r--roles/openshift_etcd/meta/main.yml1
-rwxr-xr-xroles/openshift_facts/library/openshift_facts.py11
-rw-r--r--roles/openshift_master/meta/main.yml1
-rw-r--r--roles/openshift_node/meta/main.yml1
6 files changed, 43 insertions, 0 deletions
diff --git a/roles/openshift_clock/meta/main.yml b/roles/openshift_clock/meta/main.yml
new file mode 100644
index 000000000..3e175beb0
--- /dev/null
+++ b/roles/openshift_clock/meta/main.yml
@@ -0,0 +1,15 @@
+---
+galaxy_info:
+ author: Jeremiah Stuever
+ description: OpenShift Clock
+ company: Red Hat, Inc.
+ license: Apache License, Version 2.0
+ min_ansible_version: 1.9
+ platforms:
+ - name: EL
+ versions:
+ - 7
+ categories:
+ - cloud
+dependencies:
+- { role: openshift_facts }
diff --git a/roles/openshift_clock/tasks/main.yaml b/roles/openshift_clock/tasks/main.yaml
new file mode 100644
index 000000000..5a8403f68
--- /dev/null
+++ b/roles/openshift_clock/tasks/main.yaml
@@ -0,0 +1,14 @@
+---
+- name: Set clock facts
+ openshift_facts:
+ role: clock
+ local_facts:
+ enabled: "{{ openshift_clock_enabled | default(None) }}"
+
+- name: Install ntp package
+ action: "{{ ansible_pkg_mgr }} name=ntp state=present"
+ when: openshift.clock.enabled | bool and not openshift.clock.chrony_installed | bool
+
+- name: Start and enable ntpd/chronyd
+ shell: timedatectl set-ntp true
+ when: openshift.clock.enabled | bool
diff --git a/roles/openshift_etcd/meta/main.yml b/roles/openshift_etcd/meta/main.yml
index 7cc548f69..de36b201b 100644
--- a/roles/openshift_etcd/meta/main.yml
+++ b/roles/openshift_etcd/meta/main.yml
@@ -13,6 +13,7 @@ galaxy_info:
- cloud
dependencies:
- role: openshift_etcd_facts
+- role: openshift_clock
- role: openshift_docker
when: openshift.common.is_containerized | bool
- role: etcd
diff --git a/roles/openshift_facts/library/openshift_facts.py b/roles/openshift_facts/library/openshift_facts.py
index b13343776..6daaf6822 100755
--- a/roles/openshift_facts/library/openshift_facts.py
+++ b/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)
diff --git a/roles/openshift_master/meta/main.yml b/roles/openshift_master/meta/main.yml
index 774f190c8..f6b926d74 100644
--- a/roles/openshift_master/meta/main.yml
+++ b/roles/openshift_master/meta/main.yml
@@ -12,6 +12,7 @@ galaxy_info:
categories:
- cloud
dependencies:
+- role: openshift_clock
- role: openshift_docker
- role: openshift_cli
- role: openshift_master_certificates
diff --git a/roles/openshift_node/meta/main.yml b/roles/openshift_node/meta/main.yml
index 4d35ec420..ea52bbb99 100644
--- a/roles/openshift_node/meta/main.yml
+++ b/roles/openshift_node/meta/main.yml
@@ -12,6 +12,7 @@ galaxy_info:
categories:
- cloud
dependencies:
+- role: openshift_clock
- role: openshift_docker
- role: openshift_node_certificates
- role: openshift_cloud_provider