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

31 lines
519 B
YAML
Raw Permalink Normal View History

---
- 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