Skip to content

Instantly share code, notes, and snippets.

@nvwls
Created November 27, 2013 07:45
Show Gist options
  • Save nvwls/7672039 to your computer and use it in GitHub Desktop.
Save nvwls/7672039 to your computer and use it in GitHub Desktop.
Executing a resource last
[root@vagrant ~]# cat chef/recipes/test.rb
execute 'last' do
action :nothing
command 'true'
end
ruby_block 'notify' do
block do
true
end
notifies :run, 'execute[last]', :delayed
end
execute 'a' do
command 'true'
end
[root@vagrant ~]# chef-solo
Starting Chef Client, version 11.4.4
Compiling Cookbooks...
Converging 3 resources
Recipe: chef::test
* execute[last] action nothing (up to date)
* ruby_block[notify] action run
- execute the ruby block notify
* execute[a] action run
- execute true
* execute[last] action run
- execute true
Chef Client finished, 3 resources updated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment