I have a little resource and provider for nginx sites which writes out a config file for a site.
action :start do
template "/etc/nginx/sites-enabled/my_site" do
source "nginx_site.conf.erb"
notifies :reload, "service[nginx]"
end
end
When I use it from another cookbook the template nginx_site.conf.erb is not found as chef is looking for a template where this resource is called from.
Is there a way to tell chef to look for a template inside the nginx resource & provider cookbook?
You can set cookbook value for template.
action :start do
template "/etc/nginx/sites-enabled/my_site" do
source "nginx_site.conf.erb"
notifies :reload, "service[nginx]"
cookbook 'nginx'
end
end
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With