Add support for the chrony implementation

Chronyd is installed and configured by default since the Stein
Cycle. This patch adds the support of the latter.

This patch also renames the 'ntpstat' playbook and role by 'ntp' which
is more generic.

Change-Id: Ica0d4af5faa1693baa8f336db71143e0457401f0
Signed-off-by: Gael Chamoulaud <gchamoul@redhat.com>
This commit is contained in:
Gael Chamoulaud 2019-06-25 10:59:02 +02:00
parent 90bb581601
commit d4db54cbfd
5 changed files with 31 additions and 10 deletions

View File

@ -6,9 +6,9 @@
description: >
Each overcloud node should have their clocks synchronised.
The deployment should configure and run ntpd. This validation verifies
that it is indeed running and connected to an NPT server on all nodes.
The deployment should configure and run chronyd. This validation verifies
that it is indeed running and connected to an NTP server on all nodes.
groups:
- post-deployment
roles:
- ntpstat
- ntp

26
roles/ntp/tasks/main.yml Normal file
View File

@ -0,0 +1,26 @@
---
- name: Get if chrony is enabled
become: True
hiera:
name: "chrony_enabled"
- when: chrony_enabled|bool
block:
- name: Populate service facts
service_facts: # needed to make yaml happy
- name: Fail if chronyd service is not running
fail:
msg: "Chronyd service is not running"
when: "ansible_facts.services['chronyd.service'].state != 'running'"
- name: Run chronyc
become: True
command: chronyc -a 'burst 4/4'
changed_when: False
- name: Run ntpstat
# ntpstat returns 0 if synchronised and non-zero otherwise:
command: ntpstat
changed_when: False
when: not chrony_enabled|bool

View File

@ -4,7 +4,7 @@ metadata:
description: >
Each overcloud node should have their clocks synchronised.
The deployment should configure and run ntpd. This validation verifies
that it is indeed running and connected to an NPT server on all nodes.
The deployment should configure and run chronyd. This validation verifies
that it is indeed running and connected to an NTP server on all nodes.
groups:
- post-deployment

View File

@ -1,5 +0,0 @@
---
- name: Run ntpstat
# ntpstat returns 0 if synchronised and non-zero otherwise:
command: ntpstat
changed_when: False