john pfeiffer
  • Home
  • Categories
  • Tags
  • Archives

Chef recipe utc time

# Cookbook Name:: utc-time
# Recipe:: default

execute "remove-old-localtime" do
  command "rm /etc/localtime"
  action :run
  only_if { File.exists?("/etc/localtime") }
end

execute "link-utc-as-localtime" do
  command "ln -sf /usr/share/zoneinfo/UTC /etc/localtime"
  action :run
end

execute "service-ntp-stop" do
  command "service ntp stop"
  action :run
  only_if { File.exists?("/etc/ntp.conf") }
end

execute "ntpdate-update" do
  command "ntpdate pool.ntp.org"
  action :run
  only_if { File.exists?("/usr/sbin/ntpdate") }
end

execute "service-ntp-start" do
  command "service ntp start"
  action :run
  only_if { File.exists?("/etc/ntp.conf") }
end

execute "hwclock-sync" do
  command "/sbin/hwclock --systohc"
  action :run
end

  • « Chef recipe if statement
  • Chef recipe authbind dependency nodejs »

Published

Oct 10, 2011

Category

chef

~71 words

Tags

  • chef 15
  • recipe 5
  • time 13
  • utc 3