Closed rhass closed 8 years ago
So this is one of the problems with the transparent rewrite stuff. Make that 'application_ruby_execute[notify-me]'
and it will probably work. You can also use a more explicit style:
r = ruby_execute 'notify-me' do
command 'ruby -v'
action :nothing
end
git my_git_resource do
repository 'https://github.com/railstutorial/sample_app'
destination '/srv/sample_app'
revision 'master'
notifies :run, r
notifies :run, "execute[this-works-though]"
action :sync
end
To explain in more detail, inside the application
resource it will transparently rewrite resource to their application_*
variant to allow automatic integration like how application_ruby_execute
knows about app-level config data.
Thanks! Both of these suggestions worked; one thing I noted is the more explicit style needs to have the object defined before the notifying resource, just as you showed the suggested example.
Thanks again! You rock! :metal:
I encountered an issue in which ruby_execute resources could not be called from within an application definition. The error is:
To DRY out reproducing this issue, I created the following cookbook: https://github.com/rhass/poise-ruby-example
It should be noted that taking the ruby_execute block out of the application resource causes it to be unaware of the ruby resource for the parent_ruby and parent_bundler properties.
CC @blt04 (Also affected by this bug.)