-
-
Notifications
You must be signed in to change notification settings - Fork 600
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conflict with nginx cookbook #46
Comments
Hi, I nevery really wrapped my head around proper attribute setting in Chef, even after reading all available documentation and source code :) Node attributes should be over-rideable just by Could you try to change the attribute setting in the |
Using default[:nginx] allows me to set a normal attribute using knife node edit. However, before this cookbook was pulled in as a dependency, I didn't need to set it at all. So it seems that the default[:nginx] in this cookbook overrides the default[:nginx] in the nginx cookbook. From the chef documentation, it appears to load cookbooks in alphabetical order. This cookbook is loaded first and it thus appears that the first 'default' attribute wins. It seems the simplest solution is to just copy from the nginx cookbook attributes/default.rb the platform specific block for setting the user. Then the two cookbooks would have the same defaults. |
Yes, that is how attributes in cookbooks work, unfortunately.
Yes, sounds like a good idea, will update it. |
Should be fixed, verified to be running as "www-data" on Ubuntu, as "nginx" on CentOS. |
thanks! works for me. |
I'm using the opscode nginx cookbook and I'm not loading the elasticsearch nginx recipe. But just including the elasticsearch cookbook causes problems with the nginx cookbook. The problem is that in attributes/nginx.rb, it sets nginx user to 'nginx' which overrides the 'default' user of www-data set by the nginx cookbook. As the 'nginx' user doesn't exist and as I'm not loading the elasticsearch nginx recipe, that user does not get created.
Should the attributes be using 'set' instead of 'default'? I could not even set a normal attribute on the node, and had to create override attributes for nginx user/group to set it back to www-data. I don't know the best way to avoid conflict with multiple default attributes set across cookbooks. Would default_unless for the attributes make it not override the nginx cookbook defaults?
The text was updated successfully, but these errors were encountered: