summaryrefslogtreecommitdiffstats
path: root/roles/openshift_clock
diff options
context:
space:
mode:
authorJason DeTiberus <detiber@gmail.com>2016-05-26 15:10:32 -0400
committerJason DeTiberus <detiber@gmail.com>2016-05-26 15:10:32 -0400
commitdc0d59545efd2e3cc4c7eedbc1e008fa6b382e6d (patch)
treeb178da6d218a31ace7a8591b8e8f03f4431edf88 /roles/openshift_clock
parent643b9b30066f0130f35e9ce7b1a8a7c24a244cc7 (diff)
parent2eadb105d5d55c0c283bec33cd2c33bca1b5361a (diff)
downloadopenshift-dc0d59545efd2e3cc4c7eedbc1e008fa6b382e6d.tar.gz
openshift-dc0d59545efd2e3cc4c7eedbc1e008fa6b382e6d.tar.bz2
openshift-dc0d59545efd2e3cc4c7eedbc1e008fa6b382e6d.tar.xz
openshift-dc0d59545efd2e3cc4c7eedbc1e008fa6b382e6d.zip
Merge pull request #1672 from jstuever/os_clocks
Add openshift_clock role
Diffstat (limited to 'roles/openshift_clock')
-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