You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using this cookbook with nginx as the web server, I encountered the following error:
==> magento: ================================================================================
==> magento: Error executing action `create` on resource 'template[/etc/nginx/sites-available/default]'
==> magento: ================================================================================
==> magento:
==> magento:
==> magento: Chef::Exceptions::FileNotFound
==> magento: ------------------------------
==> magento: Cookbook 'nginx' (2.7.4) does not contain a file at any of these locations:
==> magento: templates/centos-6.5/nginx-site.erb
==> magento: templates/centos/nginx-site.erb
==> magento: templates/default/nginx-site.erb
This is because the template defined on line 26 of the _web_nginx recipe is duplicating the template already defined within the nginx recipe at "#{node['nginx']['dir']}/sites-available/default" which installs the nginx default site, later to be deleted by this recipe.
When a template is defined twice, the second definition inherits attributes from the first, including it seems the cookbook - meaning that when the magento recipe attempts to write this file from its own template, chef looks in the nginx cookbook for the file.
A simple fix is adding cookbook "magento" to the template definition in _web_nginx. This forces chef to look for the resource in the magento recipe.
I wasn't sure whether it would be something you'd want to include, or look at a different solution such as not installing the nginx default site in the first place... but thought I'd document since I'd figured it out. I can submit a PR with the change if you like.
The text was updated successfully, but these errors were encountered:
Hi @samsworldofno, thanks for opening the issue. I'm having problems re-creating the issue with a kitchen test. I'm running chef-client 11.14.2 with master of this repo with nginx cookbook version 2.7.4 (current release). Are you running different versions of any of these things?
I'm using 2.7.4 of the nagios cookbook, and I'm building chef solo (11.12.8) via vagrant. I haven't tried with a more recent version of the chef gem but I can do. I believed the behaviour is intended so hadn't checked with other versions.
Hi,
When using this cookbook with nginx as the web server, I encountered the following error:
This is because the template defined on line 26 of the
_web_nginx
recipe is duplicating the template already defined within the nginx recipe at"#{node['nginx']['dir']}/sites-available/default"
which installs the nginx default site, later to be deleted by this recipe.When a template is defined twice, the second definition inherits attributes from the first, including it seems the cookbook - meaning that when the magento recipe attempts to write this file from its own template, chef looks in the nginx cookbook for the file.
A simple fix is adding
cookbook "magento"
to thetemplate
definition in_web_nginx
. This forces chef to look for the resource in the magento recipe.I wasn't sure whether it would be something you'd want to include, or look at a different solution such as not installing the nginx default site in the first place... but thought I'd document since I'd figured it out. I can submit a PR with the change if you like.
The text was updated successfully, but these errors were encountered: