- hosts: '{{ variable_host | default("lab15_standard") }}' gather_facts: no become: yes tasks: - name: Install NTP apt: package=ntp,ntpdate state=present update_cache=yes tags: ntp - name: Make sure NTP is stopped service: name=ntp state=stopped enabled=yes tags: ntp - name: Sync time initialy shell: ntpdate tempus1.gum.gov.pl tags: ntp - name: Make sure NTP is started up service: name=ntp state=started enabled=yes tags: ntp - name: Sync hwclock shell: hwclock -w tags: ntp handlers: - name: restart ntpd service: name=ntpd state=restarted