From 11bdc7032725170fdcf3ca0541c15f829fc27ef6 Mon Sep 17 00:00:00 2001 From: Kazuhiro MUSASHI Date: Sun, 28 Aug 2022 11:58:13 +0900 Subject: [PATCH] Use `node['platform_version']` & support `Ubuntu 22.04` for timezone setting: --- cookbooks/base/default.rb | 5 +++-- cookbooks/base/timezone.rb | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/cookbooks/base/default.rb b/cookbooks/base/default.rb index 8e776ee..0158d23 100644 --- a/cookbooks/base/default.rb +++ b/cookbooks/base/default.rb @@ -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' diff --git a/cookbooks/base/timezone.rb b/cookbooks/base/timezone.rb index 2d7f899..548851b 100644 --- a/cookbooks/base/timezone.rb +++ b/cookbooks/base/timezone.rb @@ -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