Skip to content

Instantly share code, notes, and snippets.

@fujin
Forked from chef/divine_panda.rb
Created April 15, 2009 21:39
Show Gist options
  • Save fujin/96037 to your computer and use it in GitHub Desktop.
Save fujin/96037 to your computer and use it in GitHub Desktop.
# Divine Panda
service "foo" do
action :nothing
end
template "/etc/foo/config.conf" do
source "config.conf.erb"
action :create
notifies :restart, resources(:service => "foo")
end
# If you wanted to make sure it was always running
service "foo" do
action :start
end
# You will be a happy panda
template "/etc/foo/config.conf" do
source "config.conf.erb"
action :create
end
service "foo" do
action :start
end
# Most Insane Panda
{
"/etc/foo/config.conf" => "config.conf.erb",
"/etc/foo/blah.what" => "blah.what",
}.each { |k,v| template(k) { source v; action :create } }
%w{/etc/foo/config.conf /etc/foo/blah.what}.each do |t|
service("foo") { action :none; subscribes :restart, resources(:template => t), :delayed
end
# You will be a sad panda if the service is broken
service "foo" do
action :start
end
template "/etc/foo/config.conf" do
source "config.conf.erb"
action :create
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment