--- - name: Set timezone to Africa/Johannesburg community.general.timezone: name: Africa/Johannesburg - name: Use fallback NTP servers ansible.builtin.lineinfile: path: /etc/systemd/timesyncd.conf regexp: '^#?FallbackNTP=' line: FallbackNTP=0.debian.pool.ntp.org 1.debian.pool.ntp.org 2.debian.pool.ntp.org 3.debian.pool.ntp.org owner: root group: root mode: '0644' - name: Insert NTP line before FallbackNTP in timesyncd.conf ansible.builtin.lineinfile: path: /etc/systemd/timesyncd.conf line: "NTP=time.ikeja.co.za" insertbefore: '^FallbackNTP' state: present - name: Restart and enable systemd-timesyncd ansible.builtin.service: name: systemd-timesyncd state: restarted enabled: true