Skip to content

Latest commit

 

History

History
18 lines (15 loc) · 440 Bytes

resource_service_subscribes_reload_using_template.md

File metadata and controls

18 lines (15 loc) · 440 Bytes

To reload a service that is based on a template, use the template and service resources together in the same recipe, similar to the following:

template '/tmp/somefile' do
  mode '0755'
  source 'somefile.erb'
end

service 'apache' do
  action :enable
  subscribes :reload, 'template[/tmp/somefile]', :immediately
end

where the subscribes notification is used to reload the service whenever the template is modified.