diff options
Diffstat (limited to 'roles/openshift_clock')
-rw-r--r-- | roles/openshift_clock/defaults/main.yml | 2 | ||||
-rw-r--r-- | roles/openshift_clock/meta/main.yml | 14 | ||||
-rw-r--r-- | roles/openshift_clock/tasks/main.yaml | 15 |
3 files changed, 31 insertions, 0 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 new file mode 100644 index 000000000..d1e86d826 --- /dev/null +++ b/roles/openshift_clock/meta/main.yml @@ -0,0 +1,14 @@ +--- +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: [] 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 |