Files
dsk-iac/ansible/00_old/vault_test.yaml
2023-12-19 13:36:16 +09:00

11 lines
418 B
YAML

---
- hosts: all
tasks:
- name: Get password from Vault
ansible.builtin.debug:
msg: "{{ lookup('hashi_vault', 'secret=secret/hostname2 token=hvs.CAESIOy5Troiesm65BQYj_QhF996yilil8whnWP5FWHp3eE8Gh4KHGh2cy40OTBCT09SdTl1c3FRNmFXenFBUmxVSkE url=http://vault.vault:8200') }}"
register: vault_result
- name: Use password from Vault
ansible.builtin.command: echo "{{ vault_result.msg }}"