templier-ansible/roles/ntp-client/tasks/main.yml
Emmy D'Anello 7f4f846408
Lot of stuff
Signed-off-by: Emmy D'Anello <ynerant@crans.org>
2023-01-12 12:36:32 +01:00

29 lines
617 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
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"