Chef - a template inside a vendor that does not find a source

I have a small resource and provider for nginx sites that writes a configuration file for the 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 nginx_site.conf.erb template was not found, because the cook is looking for a template from which this resource is called.

Is there any way to tell the chef to look for the template inside the nginx resource and vendor cookbook?

+6
source share
1 answer

You can set the 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 
+10
source

Source: https://habr.com/ru/post/945464/


All Articles