Merge "Add timesync prechecks"
This commit is contained in:
commit
4e62c86236
@ -2,6 +2,10 @@
|
||||
- include_tasks: host_os_checks.yml
|
||||
when: prechecks_enable_host_os_checks | bool
|
||||
|
||||
- include_tasks: timesync_checks.yml
|
||||
when:
|
||||
- not enable_chrony | bool
|
||||
|
||||
- include_tasks: datetime_checks.yml
|
||||
|
||||
- include_tasks: port_checks.yml
|
||||
|
24
ansible/roles/prechecks/tasks/timesync_checks.yml
Normal file
24
ansible/roles/prechecks/tasks/timesync_checks.yml
Normal file
@ -0,0 +1,24 @@
|
||||
---
|
||||
- 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"
|
@ -0,0 +1,5 @@
|
||||
---
|
||||
features:
|
||||
- |
|
||||
Adds timesync prechecks which run when containerised chrony is not enabled
|
||||
to ensure the host has its system clock synchronized.
|
Loading…
Reference in New Issue
Block a user