Skip to content

Commit 60ac705

Browse files
committedOct 14, 2024
fix ntp
1 parent 2f582b8 commit 60ac705

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed
 

‎ansible/playbooks/ntp.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,11 @@
1111
update_cache: no
1212

1313
- name: Configure timesyncd to use the router's NTP server
14-
shell: sed -i '/^NTP=/c\NTP=10.0.0.1' /etc/systemd/timesyncd.conf
15-
14+
lineinfile:
15+
path: /etc/systemd/timesyncd.conf
16+
regexp: '^NTP='
17+
line: 'NTP=10.0.0.1'
18+
insertafter: '^\[Time\]'
1619

1720
- name: Restart systemd-timesyncd to apply changes
1821
systemd:

0 commit comments

Comments
 (0)
Please sign in to comment.