Closed saidmasoud closed 6 years ago
A vault is just a data bag, so you can use the method in https://docs.chef.io/dsl_recipe.html#data-bag to iterate, and then chef_vault_item
rather than data_bag_item
Calling data_bag()
on a vault returns the ids of both the items and their associated keys, which forces users to check whether the current item being iterated over is the key or the item itself. I think a helper method that only returned the items in a vault would be a much cleaner implementation.
If you'd like to submit a PR to do this we'd definitely take it.
Is there a way to perform the rough equivalent of
knife vault show VAULT
within a recipe? I would like to build a list of all items, then iterate over that list to do what I need to do with the data in each item. If not, I would like to submit this as a feature request.