diff --git a/cookbooks/base/default.rb b/cookbooks/base/default.rb index 162ddbd..107c88e 100644 --- a/cookbooks/base/default.rb +++ b/cookbooks/base/default.rb @@ -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,29 +89,40 @@ when "20.04", "22.04" service 'systemd-timesyncd' do action :enable end -end -case node['platform_version'] -when "20.04" - remote_file '/etc/systemd/timesyncd.conf' do - owner 'root' - group 'root' - mode '0644' + case node['platform_version'] + when "20.04" + remote_file '/etc/systemd/timesyncd.conf' do + owner 'root' + group 'root' + mode '0644' - notifies :restart, 'service[systemd-timesyncd]' - end -when "22.04" - remote_file '/etc/systemd/timesyncd.conf' do - owner 'root' - group 'root' - mode '0644' + notifies :restart, 'service[systemd-timesyncd]' + end + when "22.04" + remote_file '/etc/systemd/timesyncd.conf' do + owner 'root' + group 'root' + mode '0644' - source 'files/etc/systemd/timesyncd.2204.conf' + source 'files/etc/systemd/timesyncd.2204.conf' - notifies :restart, 'service[systemd-timesyncd]' + 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'] include_recipe './aws_ec2.rb' diff --git a/cookbooks/base/files/etc/systemd/timesyncd.2404.conf b/cookbooks/base/files/etc/systemd/timesyncd.2404.conf new file mode 100644 index 0000000..64e759c --- /dev/null +++ b/cookbooks/base/files/etc/systemd/timesyncd.2404.conf @@ -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