30 lines
677 B
YAML
30 lines
677 B
YAML
---
|
|
- 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"
|
|
|
|
- name: Install systemd-timesyncd (bullseye)
|
|
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"
|
|
- ansible_distribution_release == "bullseye"
|
|
|
|
- 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"
|