- name: time sync maintenance routines gather_facts: no hosts: "{{target}}" become: "{{become_var}}" tasks: - name: install systemd-timesyncd ansible.builtin.package: name: systemd-timesyncd diff: true - name: tune systemd-timesyncd runtime ansible.builtin.template: src: timesyncd.conf dest: /etc/systemd/timesyncd.conf notify: restart systemd-timesyncd diff: true when: skip_time is not defined - name: start and enable timesync ansible.builtin.service: name: systemd-timesyncd state: started enabled: true diff: true handlers: - name: restart systemd-timesyncd ansible.builtin.shell: executable: /bin/bash cmd: "systemctl restart systemd-timesyncd.service"