Skip to content

Instantly share code, notes, and snippets.

@juliandunn
Created May 31, 2014 19:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save juliandunn/4e6ea302321b8b5aa7c4 to your computer and use it in GitHub Desktop.
Save juliandunn/4e6ea302321b8b5aa7c4 to your computer and use it in GitHub Desktop.
node.default['demo'] = true
node.default['demoagain'] = false
ruby_block 'whee' do
block do
puts 'Ohai, world'
end
not_if { node['demo'] }
end
ruby_block 'whee2' do
block do
puts 'Meow'
end
not_if { node['demoagain'] }
end
$ chef-apply apply.rb
Recipe: (chef-apply cookbook)::(chef-apply recipe)
* ruby_block[whee] action run (skipped due to not_if)
* ruby_block[whee2] action runMeow
- execute the ruby block whee2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment