Skip to content

Instantly share code, notes, and snippets.

@zanshin
Created December 11, 2014 15:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zanshin/69e6967cf9aeb567b0a4 to your computer and use it in GitHub Desktop.
Save zanshin/69e6967cf9aeb567b0a4 to your computer and use it in GitHub Desktop.
iterate over resource_collection
homedirs = []
run_context.resource_collection.each { |resource|
puts resource.cookbook_name
if resource.is_a(Chef::Resource::File) && resource.cookbook_name == 'myCookbook'
homedirs << resource
end
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment