Answers:
这是一个示例,其中我的execute
资源仅在我的directory
资源收敛时才收敛:
directory '/opt/foo' do
action :create
notifies :run, 'execute[custom command]', :immediately
end
execute 'custom command' do
command 'echo foo'
action :nothing
end
有关更多示例,请参见https://docs.chef.io/chef/resources.html#notifications。