script
service "Apache2.2" do
action :nothing
end
file "./blah" do
action :create
notifies :restart, "service[Apache2.2]", :immediate
end
ruby_block "debug_resource" do
block do
puts "Updated #{resources("file[./blah]")}: #{resources("file[./blah]").updated}"
end
end
output
Recipe: (chef-apply cookbook)::(chef-apply recipe)
* service[Apache2.2] action nothing (up to date)
* file[./blah] action create
- create new file ./blah
(no diff)
* service[Apache2.2] action restart
- restart service service[Apache2.2]
* ruby_block[debug_resource] action runUpdated file[./blah]: true
- execute the ruby block debug_resource
script
service "Apache2.2" do
action :nothing
end
file "C:\\blah" do
action :create
notifies :restart, "service[Apache2.2]", :immediate
end
ruby_block "debug_resource" do
block do
puts "Updated #{resources("file[C:\\blah]")}: #{resources("file[C:\\blah]").updated}"
end
end
output:
PS C:\chef\cache> chef-apply.bat .\doesnotwork.rb
Recipe: (chef-apply cookbook)::(chef-apply recipe)
* service[Apache2.2] action nothing (up to date)
* file[C:\blah] action create
- create new file C:/blah
(no diff)
* ruby_block[debug_resource] action runUpdated file[C:/blah]: true
- execute the ruby block debug_resource