---

- name: Check that ntp is installed
  urpmi: name=ntp state=installed no-recommends=yes
  tags: ntp

- name: Check that ntp is configured
  template: src={{item.src }} dest={{ item.dest }} owner=root group=root mode=0640 backup=yes
  with_items:
    - { src: 'templates/ntp.conf.j2', dest: '/etc/ntp.conf' }
    - { src: 'templates/step-tickers.j2', dest: '/etc/ntp/step-tickers' }
  notify:
    - restart ntpd
  tags: ntp

- name: Check that ntpd is running and enabled
  service: name=ntpd state=running enabled=yes
  tags: ntp
