common/tasks/ntp.yaml

25 lines
570 B
YAML

---
- name: "manage ntp"
block:
# install chrony
- name: "ntp - install - chrony debian"
ansible.builtin.apt:
name: "chrony"
state: "present"
when: 'ansible_os_family == "Debian"'
# configure chrony
- name: "ntp - config - configure chrony"
ansible.builtin.template:
src: "templates/chrony/chrony.conf.j2"
dest: "/etc/chrony/chrony.conf"
owner: "root"
group: "root"
mode: "0644"
when: 'ansible_os_family == "Debian"'
notify: "restart chrony"
tags:
- "ntp"