32 lines
542 B
YAML
32 lines
542 B
YAML
---
|
|
- 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
|
|
|
|
|