25 lines
688 B
YAML
25 lines
688 B
YAML
- name: Checking if configuration is needed
|
|
meta: end_host
|
|
when: ntp_enabled is not defined or not ntp_enabled
|
|
- name: Configure /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'
|
|
- 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: "{{ timesyncd_daemon }}"
|
|
enabled: yes
|