Skip to content

This cookbook does not work with Amazon Linux. This PR fixes all known Amazon Linux specific issues. #30

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
22 changes: 2 additions & 20 deletions recipes/rhel.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,30 +8,12 @@
# Apache 2.0 License.
#

# This recipe sets the timezone on EL 6 and older (RedHat Enterprise Linux,
# CentOS, etc.)
#
# If it is being run on EL 7 or newer, the recipe will be skipped and
# the "rhel7" recipe will be included instead.

el_version = node[:platform_version].split('.')[0].to_i

if el_version >= 7
if node.platform != 'amazon' && el_version >= 7
include_recipe 'timezone-ii::rhel7'

else
template '/etc/sysconfig/clock' do
source 'clock.erb'
owner 'root'
group 'root'
mode 0644
notifies :run, 'execute[tzdata-update]'
end

execute 'tzdata-update' do
command '/usr/sbin/tzdata-update'
action :nothing
# Amazon Linux doesn't have this command!
only_if { ::File.executable?('/usr/sbin/tzdata-update') }
end
include_recipe 'timezone-ii::rhel_pre7'
end
28 changes: 28 additions & 0 deletions recipes/rhel_pre7.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#
# Cookbook Name:: timezone-ii
# Recipe:: rhel
#
# Copyright 2013, fraD00r4 <[email protected]>
# Copyright 2015, Lawrence Leonard Gilbert <[email protected]>
#
# Apache 2.0 License.
#

# This recipe sets the timezone on EL 6 and older (RedHat Enterprise Linux,
# CentOS, etc.)
#

template '/etc/sysconfig/clock' do
source 'clock.erb'
owner 'root'
group 'root'
mode 0644
notifies :run, 'execute[tzdata-update]'
end

execute 'tzdata-update' do
command '/usr/sbin/tzdata-update'
action :nothing
# Amazon Linux doesn't have this command!
only_if { ::File.executable?('/usr/sbin/tzdata-update') }
end