2024-10-10 09:49:42 +00:00
|
|
|
- name: Ensure directory for timesyncd custom configuration exists
|
|
|
|
file:
|
|
|
|
path: /etc/systemd/timesyncd.conf.d/
|
|
|
|
state: directory
|
2024-09-23 12:30:38 +00:00
|
|
|
owner: root
|
|
|
|
group: root
|
2024-10-10 14:12:29 +00:00
|
|
|
mode: u=rwx,g=rx,o=rx
|
2024-10-10 09:49:42 +00:00
|
|
|
- name: Configure NTP settings in /etc/systemd/timesyncd.conf.d/vn-ntp.conf
|
|
|
|
copy:
|
|
|
|
dest: /etc/systemd/timesyncd.conf.d/vn-ntp.conf
|
|
|
|
content: |
|
|
|
|
[Time]
|
|
|
|
NTP={{ time_server }}
|
|
|
|
FallbackNTP={{ time_server_spain }}
|
2024-09-23 12:30:38 +00:00
|
|
|
owner: root
|
|
|
|
group: root
|
2024-10-10 14:12:29 +00:00
|
|
|
mode: u=rw,g=r,o=r
|
2024-09-27 11:26:47 +00:00
|
|
|
notify: restart systemd-timesyncd
|
2024-10-10 09:49:42 +00:00
|
|
|
- name: Ensure systemd-timesyncd service is enabled and started
|
2024-09-23 12:30:38 +00:00
|
|
|
service:
|
2024-09-23 14:32:28 +00:00
|
|
|
name: systemd-timesyncd
|
2024-09-23 12:30:38 +00:00
|
|
|
enabled: yes
|
2024-10-10 09:49:42 +00:00
|
|
|
state: started
|