Skip to content

Instantly share code, notes, and snippets.

@jtimberman
Created February 11, 2011 02:26
Show Gist options
  • Save jtimberman/821820 to your computer and use it in GitHub Desktop.
Save jtimberman/821820 to your computer and use it in GitHub Desktop.
ruby_block to store a data bag item
ruby_block "data bag item thing" do
block do
item = {
"id" => "thing",
"key" => "value"
}
Chef::Log.info "Storing volume_id #{item.inspect}"
databag_item = Chef::DataBagItem.new
databag_item.data_bag("bagname")
databag_item.raw_data = item
databag_item.save
end
end
end
@jtimberman
Copy link
Author

item can be any ruby hash, it must contain an id.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment