fix: configure explicit NTP servers in timesyncd instead of relying on DHCP
Gateway at 192.168.20.1 was being provided via DHCP as the NTP server but does not serve NTP, causing NodeClockNotSynchronising across all nodes.
This commit is contained in:
@@ -4,3 +4,9 @@
|
||||
name: sshd
|
||||
state: restarted
|
||||
become: true
|
||||
|
||||
- name: Restart timesyncd
|
||||
ansible.builtin.systemd:
|
||||
name: systemd-timesyncd
|
||||
state: restarted
|
||||
become: true
|
||||
|
||||
@@ -10,6 +10,14 @@
|
||||
name: "{{ timezone }}"
|
||||
when: ansible_user_id == "root"
|
||||
|
||||
- name: Configure NTP servers for systemd-timesyncd
|
||||
ansible.builtin.lineinfile:
|
||||
path: /etc/systemd/timesyncd.conf
|
||||
regexp: "^#?NTP="
|
||||
line: "NTP=0.debian.pool.ntp.org 1.debian.pool.ntp.org 2.debian.pool.ntp.org 3.debian.pool.ntp.org"
|
||||
become: true
|
||||
notify: Restart timesyncd
|
||||
|
||||
- name: Enable and start systemd-timesyncd
|
||||
ansible.builtin.systemd:
|
||||
name: systemd-timesyncd
|
||||
|
||||
Reference in New Issue
Block a user