2021-04-29 13:12:28 +00:00
|
|
|
---
|
|
|
|
- name: Clean up ntp
|
|
|
|
apt:
|
|
|
|
state: absent
|
|
|
|
name: ntp
|
|
|
|
purge: true
|
|
|
|
register: apt_result
|
|
|
|
retries: 3
|
|
|
|
until: apt_result is succeeded
|
|
|
|
when: "'ntp_server' not in group_names"
|
|
|
|
|
2023-01-12 11:36:32 +00:00
|
|
|
- name: Install systemd-timesyncd
|
2021-04-29 13:12:28 +00:00
|
|
|
apt:
|
|
|
|
name: systemd-timesyncd
|
|
|
|
update_cache: true
|
|
|
|
install_recommends: false
|
|
|
|
register: apt_result
|
|
|
|
retries: 3
|
|
|
|
until: apt_result is succeeded
|
|
|
|
when:
|
|
|
|
- "'ntp_server' not in group_names"
|
|
|
|
|
|
|
|
- name: Configure NTP
|
|
|
|
template:
|
|
|
|
src: systemd/timesyncd.conf.j2
|
|
|
|
dest: /etc/systemd/timesyncd.conf
|
|
|
|
notify: Restart systemd-timesyncd
|
|
|
|
when: "'ntp_server' not in group_names"
|