Skip to content

Latest commit

 

History

History
19 lines (16 loc) · 516 Bytes

resource_template_notifies_run_immediately.md

File metadata and controls

19 lines (16 loc) · 516 Bytes

By default, notifications are :delayed, that is they are queued up as they are triggered, and then executed at the end of a Chef Infra Client run. To run an action immediately, use :immediately:

template '/etc/nagios3/configures-nagios.conf' do
  # other parameters
  notifies :run, 'execute[test-nagios-config]', :immediately
end

and then Chef Infra Client would immediately run the following:

execute 'test-nagios-config' do
  command 'nagios3 --verify-config'
  action :nothing
end