-
-
Notifications
You must be signed in to change notification settings - Fork 30
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
Allow customization of node's client.rb via bootstrap_context #39
Comments
fwiw, it seems # client.rb
automatic_attribute_whitelist [
"fqdn/",
"ipaddress/",
"roles/",
"recipes/",
"ipaddress/",
"platform/",
"platform_version/",
] |
Oh hey, this can be done here: But hey, I'll leave this open in case you want to have a simple flag in knife.rb that quiets down all the noisy linux automatic attrs. |
I see. Thank you for good report of use case! |
Note: I've catched up similar feedback from twitter. https://twitter.com/masudaK/status/608555090165776384 |
Which do you think is better? @patcon @rmoriz
|
hmm... how about #43 ? |
Hm. I realize I made the request, but I'd actually moved away from the idea of using the whitelist (unless they add negating and make a blacklist possible). So much node information seems to be lost unless the whitelist is VERY extensive, which strikes me as very hard to manage (different platforms have different top-level keys for automatic attrs, etc.) Perhaps this is best implemented as a recommended wrapper cookbook around one of the blacklist attrs cookbooks mentioned in chef/chef#3533? |
I'm going to close this for now, as you've created a feature that addresses the initial request, and my new preferred way approach will be done outside this project :) Thanks @sawanoboly, and sorry for the confusion! |
(Let me just add my notes, which may help other people having the same issue: I was manging the node.json files manually (coming from a knife-solo setup) and initially had the same issue until I found out, that |
@patcon Apart from that, I thought also likely case useful to append whitelist, so I implemented it. |
@rmoriz Yes, It's kind of use case 😃 |
Rockin :) And thanks @rmoriz! That's actually really helpful for our workflow! I hadn't put two and two together on that |
Certain automatic node attributes change between every node save (memory, interface stats, etc.). For those who are committing the json node objects into version control, it would be nice to allow this noise to be disabled.
We can do that here, where the client.rb template is generated during bootstrap, by adding a key for "whitelisted attributes":
https://github.com/chef/chef/blob/d8172e646d9fbf43e57bca5e20d0ac352ba9a66a/lib/chef/knife/core/bootstrap_context.rb#L64-L69
We can append
automatic_attribute_whitelist []
to the bootstrapped node'sclient.rb
to completely silence the noisy automatic attributes, but that's likely too opinionated. Most stay constant anyhow.We could instead allow arbitrarily adding key-value pairs to the generated client.rb. Or alternatively, we could have a more user-friendly config that adds something like this, which should silence most noise:
Blacklisting seems to be an undocumented feature...
https://github.com/chef/chef/blob/59da09f64b72dbd712c890f999322493a4bc9ec4/lib/chef/node_map.rb#L157
EDIT: Turns out blacklisting isn't a thing, so this isn't useful for now
The text was updated successfully, but these errors were encountered: