3018199f0b
If not running containerised chrony, we need to check that host has its own means of system clock synchronization. Change-Id: I31b3e9ed625d63a4bf82c674593522268c20ec4c Partial-Bug: #1885689
25 lines
707 B
YAML
25 lines
707 B
YAML
---
|
|
- name: Checking timedatectl status
|
|
become: true
|
|
command: timedatectl status
|
|
register: timedatectl_status
|
|
changed_when: false
|
|
|
|
- name: Fail if no (S)NTP service is running
|
|
fail:
|
|
msg: >-
|
|
timedatectl does not see any (S)NTP service running.
|
|
Please ensure you have (S)NTP client working.
|
|
when:
|
|
- "'service: active' not in timedatectl_status.stdout"
|
|
# Ubuntu Bionic (18.04)
|
|
- "'service active: yes' not in timedatectl_status.stdout"
|
|
|
|
- name: Fail if the clock is not synchronized
|
|
fail:
|
|
msg: >-
|
|
timedatectl sees the system clock as unsynchronized.
|
|
Please wait for synchronization.
|
|
when:
|
|
- "'synchronized: yes' not in timedatectl_status.stdout"
|