Add steps for `timesyncd` configs.

This commit is contained in:
Kazuhiro MUSASHI 2024-04-28 11:51:05 +09:00
parent 61e5dec1c4
commit 8ae10311a6
2 changed files with 54 additions and 17 deletions

View File

@ -71,7 +71,7 @@ include_recipe './cloudflared.rb'
# recipes for Ubuntu 20.04 and later
case node['platform_version']
when "20.04", "22.04"
when "20.04", "22.04", "24.04"
remote_file '/etc/multipath.conf' do
owner 'root'
group 'root'
@ -89,7 +89,6 @@ when "20.04", "22.04"
service 'systemd-timesyncd' do
action :enable
end
end
case node['platform_version']
when "20.04"
@ -110,7 +109,19 @@ when "22.04"
notifies :restart, 'service[systemd-timesyncd]'
end
when "24.04"
remote_file '/etc/systemd/timesyncd.conf' do
owner 'root'
group 'root'
mode '0644'
source 'files/etc/systemd/timesyncd.2404.conf'
notifies :restart, 'service[systemd-timesyncd]'
end
end
end
# AWS EC2 Swap Setting:
if node['is_ec2']

View File

@ -0,0 +1,26 @@
# 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. Local configuration
# should be created by either modifying this file (or a copy of it placed in
# /etc/ if the original file is shipped in /usr/), or by creating "drop-ins" in
# the /etc/systemd/timesyncd.conf.d/ directory. The latter is generally
# recommended. Defaults can be restored by simply deleting the main
# configuration file and all drop-ins located in /etc/.
#
# Use 'systemd-analyze cat-config systemd/timesyncd.conf' to display the full config.
#
# See timesyncd.conf(5) for details.
[Time]
NTP=192.168.10.1
#FallbackNTP=ntp.ubuntu.com
#RootDistanceMaxSec=5
#PollIntervalMinSec=32
#PollIntervalMaxSec=2048
#ConnectionRetrySec=30
#SaveIntervalSec=60