Skip to content

Instantly share code, notes, and snippets.

@juliandunn
Created December 3, 2013 21:16
Show Gist options
  • Save juliandunn/7777628 to your computer and use it in GitHub Desktop.
Save juliandunn/7777628 to your computer and use it in GitHub Desktop.

recipes/default.rb

template 'C:\CURTIME.TXT' do
  source "curtime.txt.erb"
  action :create
  notifies :restart, "service[w32time]"
end

service "w32time" do
  action [:enable, :start]
end

templates/default/curtime.txt.erb

This template will signal the service to restart all the time, since it will change on every Chef run.

<%= Time.now %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment