Use `node['platform_version']` & support `Ubuntu 22.04` for timezone setting:

This commit is contained in:
Kazuhiro MUSASHI 2022-08-28 11:58:13 +09:00
parent c6bfa2c09b
commit 11bdc70327
2 changed files with 5 additions and 4 deletions

View File

@ -66,8 +66,9 @@ include_recipe './lsyncd.rb'
# Install starship command:
include_recipe './starship.rb'
# recipes for Ubuntu 20.04
if node['platform_version'].to_f == 20.04
# recipes for Ubuntu 20.04 and later
case node['platform_version']
when "20.04", "22.04"
remote_file '/etc/multipath.conf' do
owner 'root'
group 'root'

View File

@ -1,5 +1,5 @@
case run_command('grep VERSION_ID /etc/os-release | awk -F\" \'{print $2}\'').stdout.chomp
when "18.04", "20.04"
case node['platform_version']
when "18.04", "20.04", "22.04"
execute 'timedatectl set-timezone Asia/Tokyo' do
not_if 'timedatectl | grep Tokyo'
end