summaryrefslogtreecommitdiffstats
path: root/roles/openshift_clock/tasks
diff options
context:
space:
mode:
Diffstat (limited to 'roles/openshift_clock/tasks')
-rw-r--r--roles/openshift_clock/tasks/main.yaml15
1 files changed, 15 insertions, 0 deletions
diff --git a/roles/openshift_clock/tasks/main.yaml b/roles/openshift_clock/tasks/main.yaml
new file mode 100644
index 000000000..f8b02524a
--- /dev/null
+++ b/roles/openshift_clock/tasks/main.yaml
@@ -0,0 +1,15 @@
+---
+- 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
+ - chrony_installed.rc != 0
+
+- name: Start and enable ntpd/chronyd
+ command: timedatectl set-ntp true
+ when: openshift_clock_enabled | bool