-
-
Notifications
You must be signed in to change notification settings - Fork 387
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
['tomcat']['base_version'] is not getting overridden? #129
Comments
Thank you. When you are going to fix this? |
You better ask @someara or @jtimberman . |
There are several issues that stem from this very root cause: sous-chefs#89, sous-chefs#102, sous-chefs#129, sous-chefs#148 and sous-chefs#174. I've moved all derived attributes into a helper method that gets evaluated at recipe run time, so that the overriden values are taken into account, regardless of how they've been overriden (even from another cookbook's attributes). tl;dr # Any cookbook attribute that uses the value of another attribute to calculate its own value (derived) # should be included in the new libraries/helper method, so that the calculation of the value takes place at runtime of the recipe. # The reason is simple: Due to how attribute precedence works in Chef, when an attribute is overriden, it is not always # the case that the derived attributes will use the correct value of the original attribute to calculate their own. # This depends on how the attribute has been overriden (cookbook attributes, role, environment, etc.) # See [this](https://christinemdraper.wordpress.com/2014/10/06/avoiding-the-possible-pitfalls-of-derived-attributes/) for a detailed explanation.
There are several issues that stem from this very root cause: sous-chefs#89, sous-chefs#102, sous-chefs#129, sous-chefs#148 and sous-chefs#174. I've moved all derived attributes into a helper method that gets evaluated at recipe run time, so that the overriden values are taken into account, regardless of how they've been overriden (even from another cookbook's attributes). tl;dr # Any cookbook attribute that uses the value of another attribute to calculate its own value (derived) # should be included in the new libraries/helper method, so that the calculation of the value takes place at runtime of the recipe. # The reason is simple: Due to how attribute precedence works in Chef, when an attribute is overriden, it is not always # the case that the derived attributes will use the correct value of the original attribute to calculate their own. # This depends on how the attribute has been overriden (cookbook attributes, role, environment, etc.) # See [this](https://christinemdraper.wordpress.com/2014/10/06/avoiding-the-possible-pitfalls-of-derived-attributes/) for a detailed explanation.
First off I'm very sorry that it's taken so long to get back to you on this issue. For a significant period of time there was no active Chef Software Inc. maintainer for this repository and things languished. We're now actively maintaining this cookbook again, and as part of that I've rewritten the cookbook with new custom resources for installing Tomcat from Apache Org sources. This will ship in an upcoming 2.0 release and then we'll remove the existing recipes and providers in a future 3.X release. With those new providers I believe the need for this change goes away so I'm going to close this out. I encourage you to give the new providers a try and let me know if we can tackle more Tomcat management without the attributes bloat the current code suffers from. They're on the master branch and once the documentation and testing improves a bit they'll be released as a 2.0 cookbook. |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
chef client versions afftected:
11.16.4 , 12.0.3
cookbook version
tomcat@0.17.3
node ohai info (platform):
How to reproduce:
cat metadat/default.rb
cat recipes/default.rb
chef-client -l info -r test
I just wonder why
tomcat6
package gets installed? I expect according to the following code , i should be `tomcat' package ?cat tomcat/attributes/default.rb :
The text was updated successfully, but these errors were encountered: