diff options
author | Tim Smith <tsmith84@gmail.com> | 2020-03-05 19:23:09 -0800 |
---|---|---|
committer | Tim Smith <tsmith84@gmail.com> | 2020-03-05 19:23:09 -0800 |
commit | 8daae9f0631d53b36d0ea30b5562263e74409410 (patch) | |
tree | 66be150a24a74330af83ca78fc4d5fe0d6cf1d4e | |
parent | e06e4ae6833fb2ef7cadd154130914aaf300420d (diff) | |
download | chef-8daae9f0631d53b36d0ea30b5562263e74409410.tar.gz |
timezone: Remove support for ubuntu < 16.04 / Debian < 8
We don't support Debian / Ubuntu systems that need this logic anymore.
Signed-off-by: Tim Smith <tsmith@chef.io>
-rw-r--r-- | lib/chef/resource/timezone.rb | 21 |
1 files changed, 4 insertions, 17 deletions
diff --git a/lib/chef/resource/timezone.rb b/lib/chef/resource/timezone.rb index 63eed848ab..afbef3818f 100644 --- a/lib/chef/resource/timezone.rb +++ b/lib/chef/resource/timezone.rb @@ -37,14 +37,14 @@ class Chef description "Set the timezone." # some linux systems may be missing the timezone data - if node["os"] == "linux" + if linux? package "tzdata" do - package_name platform_family?("suse") ? "timezone" : "tzdata" + package_name suse? ? "timezone" : "tzdata" end end - # Modern Amazon, Fedora, RHEL, Ubuntu & Debian - if node["init_package"] == "systemd" + # Modern SUSE, Amazon, Fedora, RHEL, Ubuntu & Debian + if systemd? cmd_set_tz = "/usr/bin/timedatectl --no-ask-password set-timezone #{new_resource.timezone}" cmd_check_if_set = "/usr/bin/timedatectl status" @@ -78,19 +78,6 @@ class Chef to "/usr/share/zoneinfo/#{new_resource.timezone}" not_if { ::File.executable?("/usr/sbin/tzdata-update") } end - # debian < 8 and Ubuntu < 16.04 - when "debian" - file "/etc/timezone" do - action :create - content "#{new_resource.timezone}\n" - end - - bash "dpkg-reconfigure tzdata" do - user "root" - code "/usr/sbin/dpkg-reconfigure -f noninteractive tzdata" - action :nothing - subscribes :run, "file[/etc/timezone]", :immediately - end when "mac_os_x" unless current_darwin_tz == new_resource.timezone converge_by("set timezone to #{new_resource.timezone}") do |