This commit is contained in:
2026-05-21 22:42:50 +02:00
parent 2191d0b406
commit 631c6b7839
+13 -7
View File
@@ -1,13 +1,19 @@
- name: Set banner - name: Set banner
become: "{{ false if inventory_hostname == 'nas.home.lan' else true }}" become: "{{ false if inventory_hostname == 'nas.home.lan' else true }}"
block: block:
- name: Read the latest version of a kv2 secret from Vault via the remote host with userpass auth - name: Read GitLab password from Vault
community.hashi_vault.vault_kv2_get: ansible.builtin.set_fact:
url: http://vault.home.lan:8205 gitlab_password: >-
path: gitlab {{
auth_method: token lookup(
register: response '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 - name: Show password
ansible.builtin.debug: ansible.builtin.debug:
var: response var: gitlab_password.token