ansible-ffibk/roles/service-ntpd/tasks/main.yml

30 lines
519 B
YAML

---
- name: ensure systemd-timesyncd is disabled
systemd:
name: systemd-timesyncd
enabled: no
state: stopped
- name: install ntp packages
package:
name: "{{ item }}"
state: present
loop:
- ntp
- ntp-doc
- ntpdate
- ntpstat
- name: update if-up ntpdate script
template:
src: ntpdate.j2
dest: /etc/network/if-up.d/ntpdate
mode: 0755
owner: root
group: root
- name: enable and start ntp daemon
systemd:
name: ntp
enabled: yes
state: started