templier-ansible/roles/ntp/tasks/main.yml

24 lines
423 B
YAML

---
- name: Queries package manager for ntp installation
package:
name: ntp
register: pkg_result
retries: 3
until: pkg_result is succeeded
become: yes
notify: restart ntpd.service
- name: Deploy ntp configuration
template:
src: 'ntp.conf.j2'
dest: '/etc/ntp.conf'
become: yes
notify: restart ntpd.service
- name: Enable ntp service
service:
name: ntpd
enabled: yes
become: true