vn-ansible/roles/debian-base/tasks/timesync.yml

22 lines
542 B
YAML

- name: Configure /etc/systemd/timesyncd.conf
lineinfile:
path: /etc/systemd/timesyncd.conf
regexp: '^#NTP'
line: "NTP={{ time_server }}"
owner: root
group: root
mode: '0644'
- name: Configure /etc/systemd/timesyncd.conf
lineinfile:
path: /etc/systemd/timesyncd.conf
regexp: '^#?FallbackNTP='
line: "FallbackNTP=ntp.roa.es"
owner: root
group: root
mode: '0644'
notify: restart systemd-timesyncd
- name: Service should start on boot
service:
name: systemd-timesyncd
enabled: yes