Check your Ansible version, there's a known bug in 2.5 so that it doesn't work with App_role. It was fixed in 2.6:
https://github.com/ansible/ansible/issues/38536Not sure if this is the problem you're hitting but wanted to throw it out there. Your 2nd statement I might be misreading, but I'll do my best.
Unfortunately I no longer have a vault server at my current company (cry) but from a quick read of the module you're using, the response simply gets returned in the `_raw` key. So ... you should be able to get your token like this (ad-hoc code incoming, but hopefully gets you gong):
- name: authenticate with a Vault app role
set_fact:
vault_auth: "{{ lookup('hashi_vault', 'secret=secret/hello:value auth_method=approle role_id=myroleid secret_id=mysecretid url=http://myvault:8200')}}"
- name: take raw return json and convert to object
set_fact:
vault_auth: "{{ vault_auth['_raw'] | from_json }}"
- debug:
var: "{{ vault_auth.auth.client_token }}"
I _believe_ you should get a structure out (according to this site:
https://www.vaultproject.io/docs/auth/approle.html) that should be easy to pull a client token that way.
Obviously testing is needed ... but that _should_ work. Remember to to "delegate_to" as needed to make sure the right system is logging into vault.