Select Git revision
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
ntpd.yml 796 B
---
- name: ensure ntpd is installed
apt:
name: ntp
state: present
tags:
- ntpd
- name: ensure there is no timesyncd running
service:
name: systemd-timesyncd
state: stopped
enabled: false
when: ansible_distribution_major_version|int(default=99) < 11
tags:
- ntpd
- name: ensure there is no timesyncd running
apt:
name: systemd-timesyncd
state: absent
when: ansible_distribution_major_version|int(default=99) > 10
tags:
- ntpd
- name: ensure ntpd configured
template:
src: ntp.conf.j2
dest: /etc/ntp.conf
owner: root
group: root
mode: "0644"
notify:
- restart ntpd
tags:
- ntpd
- name: ensure ntpd is running and enabled
service:
name: ntp
state: started
enabled: true
tags:
- ntpd