ansible-collections / community.hashi_vault

Ansible collection for managing and working with HashiCorp Vault.
https://docs.ansible.com/ansible/devel/collections/community/hashi_vault/index.html
GNU General Public License v3.0
80 stars 59 forks source link

Feature Request: Add possibility to get list of secrets from path #295

Closed exilehanharr closed 1 year ago

exilehanharr commented 2 years ago
SUMMARY

We add users to VMs and the option to pick up all secrets from some path would be good.

I've checked hvac python module and found that it can do this:

list_response = client.secrets.kv.v2.list_secrets(
    path='hvac',
)

I think this option can help and other cases. If I can do this with the actual version of hashi_vault, could you please share the information about this?

ISSUE TYPE
COMPONENT NAME

hashi_vault lookup

ADDITIONAL INFORMATION
briantist commented 2 years ago

Hi @exilehanharr , welcome!

We don't yet have list support but it is certainly something I want to see at some point.

My vague plans were to first introduce a generic vault_list (lookup and module), similar to the generic vault_read and vault_write content we have now, which helps to fill in for missing specific versions, and then to add things like vault_kv2_list, vault_kv1_list, etc., wherever it makes sense to have more specific listings.


If you are interested in contributing, please have a look at our Contributor guide and let me know.

tomkivlin commented 1 year ago

I have a similar need for this - I will raise a PR.