Add timezone-ii cookbook to set timezone to UTC

This commit is contained in:
Greg Karékinian
2016-01-21 23:47:28 +00:00
parent 5db8455da3
commit b9e9a59d54
19 changed files with 605 additions and 44 deletions

View File

@@ -0,0 +1,47 @@
#
# Cookbook Name:: timezone-ii
# Recipe:: default
#
# Copyright 2010, James Harton <james@sociable.co.nz>
# Copyright 2013, Lawrence Leonard Gilbert <larry@L2G.to>
#
# Apache 2.0 License.
#
# Make sure the tzdata database is installed. (Arthur David Olson, the computer
# timekeeping field is forever in your debt.)
package value_for_platform_family(
'gentoo' => 'timezone-data',
'default' => 'tzdata'
)
case node.platform_family
when 'debian', 'fedora'
include_recipe "timezone-ii::#{node.platform_family}"
else
if node.os == "linux"
# Load the generic Linux recipe if there's no better known way to change the
# timezone. Log a warning (unless this is known to be the best way on a
# particular platform).
message = "Linux platform '#{node.platform}' is unknown to this recipe; " +
"using generic Linux method"
log message do
level :warn
not_if { %w( centos gentoo rhel ).include? node.platform_family }
end
include_recipe 'timezone-ii::linux-generic'
else
message = "Don't know how to configure timezone for " +
"'#{node.platform_family}'!"
log message do
level :error
end
end # if/else node.os
end # case node.platform_family
# vim:ts=2:sw=2: