summaryrefslogtreecommitdiffstats
path: root/roles/openshift_clock/tasks/main.yaml
blob: 82c73b58309b48b5e4fcff38a19d226c8245d863 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
---
- 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
  register: result
  until: result | success

- name: Start and enable ntpd/chronyd
  command: timedatectl set-ntp true
  when: openshift_clock_enabled | bool