I’m using hashi_vault to retrieve secrets from HashiCorp’s vault in ansible playbook.
- name: Return all secrets from a path
set_fact:
vault_result: “{{ lookup(‘hashi_vault’, ‘secret=secret/key:value token=token url=https://vaultaddress/ui/vault/secrets/secret/list/folder/subfolder/environment/’)}}”
tags:
- vault
command i’m using to run pl is ansible-playbook -v plybook.yml --tags vault
I’m getting following error:
fatal: [server_addr]: FAILED! => {
“msg”: “An unhandled exception occurred while running the lookup plugin ‘hashi_vault’. Error was a <type ‘exceptions.TypeError’>, original message: ‘Response’ object has no attribute ‘getitem’”
}
My python version is Python 2.7.5
My pip versin is pip 20.1
My Ansible version is
ansible 2.9.3
config file = /etc/ansible/ansible.cfg
configured module search path = [u'/home/asmithas/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
ansible python module location = /usr/lib/python2.7/site-packages/ansible
executable location = /usr/bin/ansible
python version = 2.7.5 (default, Aug 7 2019, 00:51:29) [GCC 4.8.5 20150623 (Red Hat 4.8.5-39)]