Response' object has no attribute '__getitem__ while running the lookup plugin 'hashi_vault'

I’m using hashi_vault to retrieve secrets from HashiCorp’s vault in ansible playbook.

`

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)]

Have you installed pip hashi vault module . I think you have to install the pip module for this connection. Check in hashi vault module page in official ansible document . In first few line you can see the requirements. Fix that it will work .

I’m refering to https://docs.ansible.com/ansible/latest/plugins/lookup/hashi_vault.html document. It requires hvac (python library). and i have already installed it. Im trying connect by github token.