5 # Copyright 2010, OpenStreetMap Foundation.
6 # Copyright 2009, Opscode, Inc
8 # Licensed under the Apache License, Version 2.0 (the "License");
9 # you may not use this file except in compliance with the License.
10 # You may obtain a copy of the License at
12 # http://www.apache.org/licenses/LICENSE-2.0
14 # Unless required by applicable law or agreed to in writing, software
15 # distributed under the License is distributed on an "AS IS" BASIS,
16 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 # See the License for the specific language governing permissions and
18 # limitations under the License.
26 execute "dpkg-reconfigure-tzdata" do
28 command "/usr/sbin/dpkg-reconfigure -f noninteractive tzdata"
33 file "/etc/timezone" do
37 content "#{node[:tz]}\n"
38 notifies :run, resources(:execute => "dpkg-reconfigure-tzdata"), :immediately
42 action [ :enable, :start ]
43 supports :status => true, :restart => true
46 template "/etc/ntp.conf" do
51 notifies :restart, resources(:service => "ntp")
56 if node[:lsb][:release].to_f <= 8.04
57 munin_plugins = [ "ntp_states" ]
59 node[:ntp][:servers].each do |name|
60 name = Socket.gethostbyname(name)[0].gsub!(/[.-]/, "_")
62 munin_plugin "ntp_#{name}" do
66 munin_plugins.push("ntp_#{name}")
69 munin_plugin "ntp_states"
71 munin_plugins = [ "ntp_kernel_err", "ntp_kernel_pll_freq", "ntp_kernel_pll_off", "ntp_offset" ]
73 munin_plugin "ntp_kernel_err"
74 munin_plugin "ntp_kernel_pll_freq"
75 munin_plugin "ntp_kernel_pll_off"
76 munin_plugin "ntp_offset"
79 if File.directory?("/etc/munin/plugins")
80 Dir.new("/etc/munin/plugins").each do |plugin|
81 if plugin.match(/^ntp_/) and not munin_plugins.include?(plugin)
82 munin_plugin plugin do