jhaals / ansible-vault

ansible lookup plugin for secrets stored in Vault(by HashiCorp)
BSD 3-Clause "New" or "Revised" License
347 stars 65 forks source link

Cache not used #61

Open vincer opened 7 years ago

vincer commented 7 years ago

ansible-vault version: 2.7.0 ansible version: 2.2.1 and 2.4.0

The cache doesn't seem to ever be used for us. I tried setting --forks=1 and even then I get no cache hits.

Injecting some prints into the code I noticed that _vault_cache is getting populated when there's a cache miss, but the next time the plugin is used _vault_cache is reset to {}. It seems like Ansible is re-importing the plugin every time it's called?

I don't know enough about Ansible plugin development to say whether this is an Ansible core issue or a plugin issue.

Here's a simple example: https://github.com/vincer/vault-plugin-cache-broken