Skip to content

Instantly share code, notes, and snippets.

@michaelbiven
Forked from fujin/foo.rb
Created September 11, 2013 16:01
Show Gist options
  • Save michaelbiven/6525735 to your computer and use it in GitHub Desktop.
Save michaelbiven/6525735 to your computer and use it in GitHub Desktop.
template "/tmp/foo.rb"
source "foo.rb.erb"
cookbook "banana"
end
include_recipe "whatever_cookbook::foo"
begin
t = resources(:template => "/tmp/foo.rb")
t.source "bonkers.rb.erb"
t.cookbook "definitely_not_banana"
rescue Chef::Exceptions::ResourceNotFound
Chef::Log.warn "could not find template /tmp/foo.rb to modify"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment