Open jantari opened 2 years ago
My workaround:
pre_tasks:
# https://github.com/shalomb/ansible-systemd-timesyncd/issues/5
- name: Repair ansible-systemd-timesyncd
ignore_errors: yes
become: yes
ansible.builtin.shell: |
timedatectl set-ntp false
timedatectl set-ntp true
roles:
- role: ansible-systemd-timesyncd
become: yes
config:
ntp_servers:
- ...
timezone: '...'
I have noticed that the task "timesyncd : Assert systemd-timesyncd status" from https://github.com/shalomb/ansible-systemd-timesyncd/blob/f5db2260a069c3d5d82b6723d226bf52f8cbe705/tasks/tests.yml#L32 fails on one of my hosts with the following error:
The output of
sudo systemctl status systemd-timesyncd
on the machine is:everything is operating fine and yet the task asserts a failure. Perhaps it is not the most robust technique to try and regex-scrape the output of a
shell
command to try and look for logs of a service? I personally think this test can be removed.