Install `systemd-timesyncd` and add its config file:
``` --- a/cookbooks/base/default.rb +++ b/cookbooks/base/default.rb @@ -80,6 +80,20 @@ when "20.04", "22.04" service 'multipath-tools' do action :nothing end + + package 'systemd-timesyncd' + + service 'systemd-timesyncd' do + action :enable + end + + remote_file '/etc/systemd/timesyncd.conf' do + owner 'root' + group 'root' + mode '0644' + + notifies :restart, 'service[systemd-timesyncd]' + end end ```
This commit is contained in:
parent
11bdc70327
commit
a773b4a1b5
|
@ -80,6 +80,20 @@ when "20.04", "22.04"
|
||||||
service 'multipath-tools' do
|
service 'multipath-tools' do
|
||||||
action :nothing
|
action :nothing
|
||||||
end
|
end
|
||||||
|
|
||||||
|
package 'systemd-timesyncd'
|
||||||
|
|
||||||
|
service 'systemd-timesyncd' do
|
||||||
|
action :enable
|
||||||
|
end
|
||||||
|
|
||||||
|
remote_file '/etc/systemd/timesyncd.conf' do
|
||||||
|
owner 'root'
|
||||||
|
group 'root'
|
||||||
|
mode '0644'
|
||||||
|
|
||||||
|
notifies :restart, 'service[systemd-timesyncd]'
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# AWS EC2 Swap Setting:
|
# AWS EC2 Swap Setting:
|
||||||
|
|
|
@ -0,0 +1,19 @@
|
||||||
|
# This file is part of systemd.
|
||||||
|
#
|
||||||
|
# systemd is free software; you can redistribute it and/or modify it
|
||||||
|
# under the terms of the GNU Lesser General Public License as published by
|
||||||
|
# the Free Software Foundation; either version 2.1 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# Entries in this file show the compile time defaults.
|
||||||
|
# You can change settings by editing this file.
|
||||||
|
# Defaults can be restored by simply deleting this file.
|
||||||
|
#
|
||||||
|
# See timesyncd.conf(5) for details.
|
||||||
|
|
||||||
|
[Time]
|
||||||
|
NTP=192.168.10.1
|
||||||
|
#FallbackNTP=ntp.ubuntu.com
|
||||||
|
#RootDistanceMaxSec=5
|
||||||
|
#PollIntervalMinSec=32
|
||||||
|
#PollIntervalMaxSec=2048
|
Loading…
Reference in New Issue