diff --git a/recipes/debian.rb b/recipes/debian.rb index aaff585..2edf670 100644 --- a/recipes/debian.rb +++ b/recipes/debian.rb @@ -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