From 631c6b7839d6004a03866037ef752b044fc99bca Mon Sep 17 00:00:00 2001 From: jaydee Date: Thu, 21 May 2026 22:42:50 +0200 Subject: [PATCH] build --- roles/test/tasks/main.yml | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/roles/test/tasks/main.yml b/roles/test/tasks/main.yml index 97a1d63..e4d83d2 100644 --- a/roles/test/tasks/main.yml +++ b/roles/test/tasks/main.yml @@ -1,13 +1,19 @@ - name: Set banner become: "{{ false if inventory_hostname == 'nas.home.lan' else true }}" block: - - 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: 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: Show password ansible.builtin.debug: - var: response \ No newline at end of file + var: gitlab_password.token \ No newline at end of file