---
- name: ntpd | Adjust ntpd service configuration
  copy: # noqa: jinja[spacing]
    content: >
      NTPD_OPTS="-N
      {%- for pool in ntp_opts.pools %} -p {{ pool }}{% endfor %}
      {%- for server in ntp_opts.servers %} -p {{ server }}{% endfor %}"
    dest: /etc/conf.d/ntpd
    owner: root
    group: root
    mode: '644'

- name: ntpd | Start ntpd service at runlevel 'default'
  service:
    name: ntpd
    runlevel: default
    enabled: true
    state: started
