Skip to content
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

Closed
eliaslevy opened this issue Dec 4, 2013 · 4 comments
Closed

Cookbook default attributes get lifted to normal priority #168

eliaslevy opened this issue Dec 4, 2013 · 4 comments

Comments

@eliaslevy
Copy link

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 use node.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.

@karmi
Copy link
Contributor

karmi commented Dec 12, 2013

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.

@eliaslevy
Copy link
Author

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 node.normal it unexpected.

@jensihnow
Copy link

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

karmi pushed a commit that referenced this issue May 7, 2014
@martinb3 martinb3 removed the reminder label Jul 6, 2015
@martinb3
Copy link
Contributor

martinb3 commented Jul 7, 2015

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!

@martinb3 martinb3 closed this as completed Jul 7, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants