{"action":"created","issue":{"url":"https://api.github.com/repos/higanworks/knife-zero/issues/39","labels_url":"https://api.github.com/repos/higanworks/knife-zero/issues/39/labels{/name}","comments_url":"https://api.github.com/repos/higanworks/knife-zero/issues/39/comments","events_url":"https://api.github.com/repos/higanworks/knife-zero/issues/39/events","html_url":"https://github.com/higanworks/knife-zero/issues/39","id":87930657,"number":39,"title":"Allow customization of node's client.rb via bootstrap_context","user":{"login":"patcon","id":305339,"avatar_url":"https://avatars.githubusercontent.com/u/305339?v=3","gravatar_id":"","url":"https://api.github.com/users/patcon","html_url":"https://github.com/patcon","followers_url":"https://api.github.com/users/patcon/followers","following_url":"https://api.github.com/users/patcon/following{/other_user}","gists_url":"https://api.github.com/users/patcon/gists{/gist_id}","starred_url":"https://api.github.com/users/patcon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/patcon/subscriptions","organizations_url":"https://api.github.com/users/patcon/orgs","repos_url":"https://api.github.com/users/patcon/repos","events_url":"https://api.github.com/users/patcon/events{/privacy}","received_events_url":"https://api.github.com/users/patcon/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/higanworks/knife-zero/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2015-06-13T04:55:16Z","updated_at":"2015-06-14T17:25:04Z","closed_at":"2015-06-14T17:15:27Z","body":"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.\r\n\r\nWe can do that here, where the client.rb template is generated during bootstrap, by adding a key for [\"whitelisted attributes\"](/dev/mapper/packer):\r\nhttps://github.com/chef/chef/blob/d8172e646d9fbf43e57bca5e20d0ac352ba9a66a/lib/chef/knife/core/bootstrap_context.rb#L64-L69\r\n\r\nWe can append `automatic_attribute_whitelist []` to the bootstrapped node's `client.rb` to completely silence the noisy automatic attributes, but that's likely too opinionated. Most stay constant anyhow.\r\n\r\nWe 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:\r\n\r\n```rb\r\n# client.rb snippet\r\nautomatic_attribute_whitelist %w(\r\n  !network/interfaces\r\n  !memory/\r\n]\r\n```\r\n\r\nBlacklisting seems to be an undocumented feature...\r\nhttps://github.com/chef/chef/blob/59da09f64b72dbd712c890f999322493a4bc9ec4/lib/chef/node_map.rb#L157\r\n\r\nEDIT: Turns out blacklisting isn't a thing, so this isn't useful for now"},"comment":{"url":"https://api.github.com/repos/higanworks/knife-zero/issues/comments/111852772","html_url":"https://github.com/higanworks/knife-zero/issues/39#issuecomment-111852772","issue_url":"https://api.github.com/repos/higanworks/knife-zero/issues/39","id":111852772,"user":{"login":"rmoriz","id":1527,"avatar_url":"https://avatars.githubusercontent.com/u/1527?v=3","gravatar_id":"","url":"https://api.github.com/users/rmoriz","html_url":"https://github.com/rmoriz","followers_url":"https://api.github.com/users/rmoriz/followers","following_url":"https://api.github.com/users/rmoriz/following{/other_user}","gists_url":"https://api.github.com/users/rmoriz/gists{/gist_id}","starred_url":"https://api.github.com/users/rmoriz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rmoriz/subscriptions","organizations_url":"https://api.github.com/users/rmoriz/orgs","repos_url":"https://api.github.com/users/rmoriz/repos","events_url":"https://api.github.com/users/rmoriz/events{/privacy}","received_events_url":"https://api.github.com/users/rmoriz/received_events","type":"User","site_admin":false},"created_at":"2015-06-14T17:25:03Z","updated_at":"2015-06-14T17:25:03Z","body":"(Let me just add my notes, which may help other people having the same issue: \r\n\r\nI was manging the node.json files manually (coming from a knife-solo setup) and initially had the same issue until I found out, that `knife node edit <name>` removes a lot of the clutter before opening the editor. This fits my use case, as I'm happy to store everything in git.)\r\n"}}