Skip to content

Instantly share code, notes, and snippets.

@justindossey
Created February 17, 2015 18:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save justindossey/0d6be8e9e6a19083e6d1 to your computer and use it in GitHub Desktop.
Save justindossey/0d6be8e9e6a19083e6d1 to your computer and use it in GitHub Desktop.
update resource to not start until after additional stuff added
include_recipe 'nginx'
resources(service: 'nginx').tap do |r|
r.action :enable
end
template '/etc/nginx/conf.d/my_file.conf' do
...
notifies :start, 'service[nginx]', :delayed
end
@justindossey
Copy link
Author

A variation:

include_recipe 'nginx'
resources(service: 'nginx').tap do |r|
  r.action :enable
end

template '/etc/nginx/conf.d/my_file.conf' do
  ...
end

ruby_block 'start-nginx' do
  block {}
  notifies :start, 'service[nginx]', :delayed
end 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment