#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Install and configure NTP
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# SE OMITE , SE REALIZA CON systemd-timesyncd.service
# paso1
# install package ntpdate
#- name: install package ntpdate
#  apt:
#    name: "{{ ntpdate_package }}"
#    state: present
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# paso2
# copy timesync file to crontab.hourly
#- name: copy file timesync to /etc/cron.hourly/timesync
#  copy:
#    src: timesync
#    dest: "{{ timesync_path }}"
#    owner: root
#    group: root
#    mode: '0644'
#    backup: yes  # NO backups
#  notify: restart crontab hourly
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

# retocar fichero /etc/systemd/timesyncd.conf
- name: retocar fichero /etc/systemd/timesyncd.conf
  lineinfile:
    path: /etc/systemd/timesyncd.conf
    regexp: '^#NTP'
    line: "NTP=time1.verdnatura.es time2.verdnatura.es"
    owner: root
    group: root
    mode: '0644'
  notify: restart systemd-timesyncd