diff --git a/roles/test/tasks/main.yml b/roles/test/tasks/main.yml index 38743a6..97a1d63 100644 --- a/roles/test/tasks/main.yml +++ b/roles/test/tasks/main.yml @@ -1,19 +1,13 @@ - name: Set banner become: "{{ false if inventory_hostname == 'nas.home.lan' else true }}" block: - - name: Read GitLab password from Vault - ansible.builtin.set_fact: - gitlab_password: >- - {{ - lookup( - 'community.hashi_vault.hashi_vault', - 'secret=secret/data/gitlab ' - ~ 'field=token ' - ~ 'url=http://vault.home.lan:8205 ' - ~ 'token=' ~ lookup('env', 'VAULT_TOKEN') - ) - }} + - 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: http://vault.home.lan:8205 + path: gitlab + auth_method: token + register: response - name: Show password ansible.builtin.debug: - var: gitlab_password \ No newline at end of file + var: response \ No newline at end of file