From 330f8a0a51b6f67028a581c78f4353111f6f2435 Mon Sep 17 00:00:00 2001 From: Luca Date: Sun, 20 Jul 2025 18:56:09 +0200 Subject: [PATCH] Add chrony.yml --- chrony.yml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 chrony.yml diff --git a/chrony.yml b/chrony.yml new file mode 100644 index 0000000..92c6c8d --- /dev/null +++ b/chrony.yml @@ -0,0 +1,27 @@ +--- +- name: Configure NTP with Chrony + hosts: all + become: yes + vars: + chrony_servers: + - 0.pool.ntp.org + - 1.pool.ntp.org + tasks: + - name: Install chrony + apt: + name: chrony + state: present + update_cache: yes + + - name: Configure NTP servers + lineinfile: + path: /etc/chrony/chrony.conf + regexp: '^server' + line: "server {{ item }} iburst" + loop: "{{ chrony_servers }}" + + - name: Restart chrony + service: + name: chrony + state: restarted + enabled: yes \ No newline at end of file