Files
ansible/roles/ntp/tasks/main.yml
2025-10-10 11:07:34 +00:00

25 lines
589 B
YAML

---
- name: Install NTP
apt: pkg=ntp state=present
- name: Configure NTP
template: src=ntp.conf.j2 dest=/etc/ntp.conf
notify: Restart NTP
- name: Configure NTP keys
template: src=ntp.keys.j2 dest=/etc/ntp.keys owner=ntp group=ntp mode=0400
notify: Restart NTP
- name: Ensure NTP is running
service: name=ntp state=started enabled=yes
- name: Configure firewall rules for NTP
template:
dest: /etc/firewall/rules-v4.d/21_ntp.sh
src: etc_firewall_rules-v4.d_21_ntp.sh.j2
owner: root
group: root
mode: 0600
when: ntp_firewall
notify: Restart firewall