Issue with LDAP and vault_login & vault_kv2_get modules. #367
Replies: 3 comments 5 replies
-
Hi @nskylink ! Thanks for bringing this up. At the moment, we don't support the "Login MFA" method in Vault. We also rely on the So, I've opened this issue for adding support in And this one to track that for I recommend subscribing to those issues if you want to get notified when there are any changes. I doubt we'll see any movement on those issues in the short term, because there's a good chance I will implement them and my time is stretched super thin. If someone else from the community steps up to implement it, that would be great, but support for Login MFA can't be added in a vacuum because it needs to touch a lot of other areas of both codebases. Since I'm the only maintainer on this collection and the most active maintainer on In the meantime, it may be possible to workaround the issue in pure ansible, by using the returned values and making the MFA validation call yourself with If you come up with something it would b great to post it as a new answer here. |
Beta Was this translation helpful? Give feedback.
-
I came with updates. I tried to do the same, only through the It remains for me to use one of the methods, this is an approle or a token. |
Beta Was this translation helpful? Give feedback.
-
Until native support is added, if using Duo MFA with Vault which support Single Phase login. You can use the code below to generate a token then use it with the community.hashi_vault modules (using token auth). You can get the Duo MFA UUID from the UI under Access->Multi-factor Authentication - name: Generate a new Vault token
ansible.builtin.uri:
url: "https://<vault-url>/v1/auth/ldap/login/{{ vault_user }}"
method: POST
headers:
X-Vault-MFA: "<your-duo-mfa-uuid>"
body_format: json
body:
password: "{{ vault_user_password }}"
register: login_data
check_mode: false
- name: Store the Vault token
ansible.builtin.set_fact:
vault_token: "{{ login_data.json.auth.client_token }}"
no_log: true
check_mode: false |
Beta Was this translation helpful? Give feedback.
-
When I try to get the secrets from the vault using the community.hashi_vault.vault_kv2_get and community.hashi_vault.vault_login ansible modules, there is a problem with LDAP.
The push does not come to the DUO, although the request seems to have been sent at the stage of using the vault_login module, because as a result I get(first part of output was removed to save space)
### Here is the playbook:
Maybe I made the playbook wrong?
I read almost all the documentation of the modules
community.hashi_vault... and looked into the Python scripts. The solution of an issue dosen't came to my mind.
Help my please with this issue.
Beta Was this translation helpful? Give feedback.
All reactions