Open argetlam-coder opened 21 hours ago
Hi @argetlam-coder , I didn't have a lot of time to dig too deeply into this yet so I'm not sure of the reason. We do have tests for that functionality that seem to be passing, see:
I'm curious if any earlier versions of the collection work for you? I don't think we've changed that code in years though.
Hi @briantist , I will try an older version. In the meantime, I have tried the vault_kv2_get module. The module works with the following playbook:
---
- name: vault test playbook
hosts:
- 127.0.0.1
vars:
ansible_hashi_vault_engine_mount_point: kv
ansible_hashi_vault_validate_certs: false
tasks:
- name: Read the latest version of a kv2 secret from Vault via the remote host with userpass auth
community.hashi_vault.vault_kv2_get:
url: https://192.168.1.253:8200
token: xxxxxxxx
engine_mount_point: kv
path: test
validate_certs: false
register: response
- name: Display the results
ansible.builtin.debug:
msg: "{{ response.secret }}"
It seems that only the pluginvault_kv2_get lookup plugin is affected by this problem.
I have now tried different versions (2.5.0, 3.4.0, 4.2.1, 5.0.1), but the problem persists in all versions. It works in all versions when I use the module, but not when I use the lookup plugin.
SUMMARY
I am trying to retrieve a secret from my vault using the vault_kv2_get lookup. Since my vault uses a self-signed certificate, I need to disable certificate validation. I have set the corresponding parameter as described in the documentation but still the certificate validation is not deactivated.
ISSUE TYPE
COMPONENT NAME
vault_kv2_get lookup
ANSIBLE VERSION
COLLECTION VERSION
CONFIGURATION
STEPS TO REPRODUCE
I have tried all three variants described in the documentation (https://docs.ansible.com/ansible/latest/collections/community/hashi_vault/vault_kv2_get_lookup.html#ansible-collections-community-hashi-vault-vault-kv2-get-lookup). Neither variables nor parameters nor environment variables worked.
Here is my playbook with variables
and here is my playbook with parameters:
EXPECTED RESULTS
The secret from the vault should be displayed.
ACTUAL RESULTS
I get the following error: