roles_timesync/roles/timesync-enabled/tasks/timesync_busybox-ntp.yml

32 lines
542 B
YAML
Raw Normal View History

---
2020-12-03 13:44:15 +00:00
- assert:
that:
- ansible_os_family|lower == "alpine"
fail_msg: "Busybox NTP supported only on Alpine. Patches welcome ;)"
- name: Template ntp.conf
template:
src: etc/busybox-ntp.conf.j2
dest: /etc/ntp.conf
owner: root
group: root
mode: 0644
backup: yes
notify: Restart NTP
- name: Remove server from command line
replace:
path: /etc/conf.d/ntpd
regexp: '\s?-p\s*[^ "]+'
replace: ''
- name: Enable NTP daemon
service:
name: '{{ ntp_service_name }}'
enabled: True