Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 13 additions & 7 deletions recipes/debian.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,19 @@
# /etc/timezone and then re-run the tzdata configuration to pick it up.

TIMEZONE_FILE = '/etc/timezone'

template TIMEZONE_FILE do
source "timezone.conf.erb"
owner 'root'
group 'root'
mode 0644
notifies :run, 'execute[dpkg-reconfigure-tzdata]'
if node['platform_version'] == '16.04'
# Use timedatectl in this version to prevent bug https://bugs.launchpad.net/ubuntu/+source/tzdata/+bug/1554806
execute 'timedatectl-set-timezone' do
command "/usr/bin/timedatectl set-timezone #{node[:tz]}"
end
else
template TIMEZONE_FILE do
source "timezone.conf.erb"
owner 'root'
group 'root'
mode 0644
notifies :run, 'execute[dpkg-reconfigure-tzdata]'
end
end

execute 'dpkg-reconfigure-tzdata' do
Expand Down