Setup NTP with Ansible!

---
- hosts: test 
  tasks:
  - name: set timezone
    shell: timedatectl set-timezone America/Denver

  - name: Copy over the NTP configuration
    template: src=./templates/ntp.conf dest=/etc/ntp.conf
    notify:
    - restart ntpd
    tags: ntp

  - name: Make sure NTP is stopped
    service: name=ntpd state=stopped enabled=yes
    tags: ntp

  - name: Sync time initialy
    shell: ntpdate 10.1.0.67
    tags: ntp

  - name: Sync hwclock
    shell: hwclock -w
    tags: ntp

  handlers:
  - name: restart ntpd
    service: name=ntpd state=restarted