ansible-collections / community.hashi_vault

Ansible collection for managing and working with HashiCorp Vault.
https://docs.ansible.com/ansible/devel/collections/community/hashi_vault/index.html
GNU General Public License v3.0
80 stars 59 forks source link

Where is url in with_community.hashi_vault.vault_read? #436

Closed mihalt closed 5 months ago

mihalt commented 5 months ago

hi! Very looks like that there is error in docs https://docs.ansible.com/ansible/latest/collections/community/hashi_vault/vault_read_lookup.html#examples

In this place

- name: Perform multiple reads with a single Vault login in a loop (via with_)
  vars:
    ansible_hashi_vault_auth_method: userpass
    ansible_hashi_vault_username: '{{ user }}'
    ansible_hashi_vault_password: '{{ pwd }}'
  ansible.builtin.debug:
    msg: '{{ item }}'
  with_community.hashi_vault.vault_read:
    - secret/data/hello
    - auth/approle/role/role-one/role-id
    - auth/approle/role/role-two/role-id

So, I have error like this when I try to execute this command {"msg": "Unexpected failure during module execution: Required option url was not set."}

mihalt commented 5 months ago

I've understood how it is working. I should define variables like ansible_hashi_vault_token and ansible_hashi_vault_url. For example in group_vars/all.yml