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