Created
February 11, 2011 02:26
-
-
Save jtimberman/821820 to your computer and use it in GitHub Desktop.
ruby_block to store a data bag item
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
item can be any ruby hash, it must contain an id.