itamae/cookbooks/lxc/timezone.rb

24 lines
477 B
Ruby
Raw Permalink Normal View History

2024-11-03 03:10:06 +00:00
case node['platform_version']
when "18.04", "20.04", "22.04", "24.04"
execute 'timedatectl set-timezone Asia/Tokyo' do
not_if 'timedatectl | grep Tokyo'
end
else
remote_file '/etc/timezone' do
user 'root'
owner 'root'
group 'root'
mode '644'
end
[
'cp -f /usr/share/zoneinfo/Asia/Tokyo /etc/localtime'
].each do |cmd|
execute cmd do
user 'root'
not_if 'diff /usr/share/zoneinfo/Asia/Tokyo /etc/localtime'
end
end
end