Anupam K
Anupam K

Reputation: 309

Delete attributes collected by ohai plugin

I have been using the ohai-softlayer cookbook for fetching the softlayer metadata. As part of collecting the softlayer metadata it collects the user_metadata attribute for the softlayer VM. Somehow I dont want user_metadata to be pushed to the chef-server, so I used another cookbook blacklist_node_attrs . I have another cook book which includes these 2 in its default recipe.

include_recipe 'blacklist_node_attrs'
include_recipe 'ohai-softlayer::default'

In the attributes folder I have this piece of code which adds the blacklist attribute name.

node.default[:blacklist] = {
 "softlayer" => {
  'user_metadata' => true
  }
}

I have included these cookbooks at the last in the run_list. When I run the command

knife node show <nodename> -a softlayer

It displayes the user_metadata attribute. Do you know how can I restrict it from getting displayed ? How can I delete the attribute ?

Upvotes: 0

Views: 391

Answers (2)

Anupam K
Anupam K

Reputation: 309

It seems that the version of the cookbook was not updated. I changed the version of wrapper cookbook (Refer in question -> I have another cook book which includes these 2 in its default recipe. ) and then the changes were reflected on chef node.

Upvotes: 0

coderanger
coderanger

Reputation: 54251

Make sure you also have the depends line in your cookbook's metadata for each of those. Also make sure you've run chef-client at least once successfully.

Upvotes: 0

Related Questions