-
-
Notifications
You must be signed in to change notification settings - Fork 599
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
Cookbook default attributes get lifted to normal priority #168
Comments
I see the problems here... Couple of notes: attribute handling in Chef in my experience is non-trivial to code against, and I'm short on available time for the cookbook at the moment. Will try to reproduce with a "wrapper" cookbook. |
We worked around the issue, so no rush, but I imagine it affects others. I agree with you, Chef attribute priority can be confusing, and the behavior of |
Yes, I had the same problem. Right now I'm using override in the wrapper cookbook. The problem is if you really would like to override on one of the upper levels you need to go one level up, e.g. with force or something similar with higher priority. Chef 11.8.2-1 |
Hello! We've re-written the cookbook using libraries that expose resources and providers, so you shouldn't see this problem on the newer version; it should also be much easier to customize and won't mess with attribute precedence. Hope this helps! |
Code in at the top of the default attributes file causes the cookbook default attributes to lifted to the normal priority.
Note that this is not simply caused by line 10, which explicitly lifts default attributes to normal. Even if line 10 where removed, line 11 still results in the priority lift. This is because
node.normal
does not return only normal priority attributes. Rather it returns attributes which are normal or lower. If you just want normal attributes, you must usenode.normal_attrs
.This priority lift breaks any derived cookbooks that attempt to preconfigure ES by overriding the default attribute values and including the ES cookbook. The derived cookbook's default attributes are ignored as the ES cookbook default attributes have been lifted to normal and thus have higher priority.
Tested using Chef 10.x.
The text was updated successfully, but these errors were encountered: