summaryrefslogtreecommitdiffstats
path: root/roles
diff options
context:
space:
mode:
authorJeremiah Stuever <jstuever@redhat.com>2016-03-18 18:45:19 -0400
committerJeremiah Stuever <jstuever@redhat.com>2016-05-20 00:12:03 -0400
commit8341cd6bed765d0a8a180290a67ed5e62e7e003b (patch)
treea8b563aee021e3131e7fa6ba1ff5749f68f6de56 /roles
parenta7bd843d566f1777a2705fc6e7ad7e4d397619e8 (diff)
downloadopenshift-8341cd6bed765d0a8a180290a67ed5e62e7e003b.tar.gz
openshift-8341cd6bed765d0a8a180290a67ed5e62e7e003b.tar.bz2
openshift-8341cd6bed765d0a8a180290a67ed5e62e7e003b.tar.xz
openshift-8341cd6bed765d0a8a180290a67ed5e62e7e003b.zip
Add openshift_clock role to manage system clocks
Diffstat (limited to 'roles')
-rw-r--r--roles/openshift_clock/meta/main.yml15
-rw-r--r--roles/openshift_clock/tasks/main.yaml14
2 files changed, 29 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