Skip to content

Instantly share code, notes, and snippets.

@nacx
Created December 10, 2014 14:35
Show Gist options
  • Save nacx/bff7211d4bd81cef6bd0 to your computer and use it in GitHub Desktop.
Save nacx/bff7211d4bd81cef6bd0 to your computer and use it in GitHub Desktop.
With Chef 12
------------
$ chef-apply subscribes.rb
Recipe: (chef-apply cookbook)::(chef-apply recipe)
* log[subscribed-log] action nothing (skipped due to action :nothing)
* yum_package[nano] action install
- install version 2.0.9-7.el6 of package nano
(Note that the logger has not been triggered after installing the package
With Chef 11
------------
$ chef-apply subscribes.rb
Recipe: (chef-apply cookbook)::(chef-apply recipe)
* log[subscribed-log] action nothing (skipped due to action :nothing)
* package[nano] action install
- install version 2.0.9-7.el6 of package nano
* log[subscribed-log] action write
(Note that with Chef 11 subscription works as expected)
log "subscribed-log" do
message "This is a subscribed log message"
action :nothing
subscribes :write, "package[nano]", :immediately
end
package "nano" do
action :install
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment