From e2c9f591b8e67bbd3fa774c4cb42ae839c331917 Mon Sep 17 00:00:00 2001 From: Maksim Bolshakov Date: Tue, 23 Aug 2022 10:07:44 +0300 Subject: [PATCH] Add new file --- examples/hashivault_plugin_read_secret.yaml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 examples/hashivault_plugin_read_secret.yaml diff --git a/examples/hashivault_plugin_read_secret.yaml b/examples/hashivault_plugin_read_secret.yaml new file mode 100644 index 0000000..05832ab --- /dev/null +++ b/examples/hashivault_plugin_read_secret.yaml @@ -0,0 +1,18 @@ +- hosts: localhost + tasks: + - name: Read a kv2 secret with the default mount point + vars: + ansible_hashi_vault_auth_method: ldap + ansible_hashi_vault_username: username + ansible_hashi_vault_password: pwd + ansible_hashi_vault_engine_mount_point: kv + ansible.builtin.set_fact: + response: "{{ lookup('community.hashi_vault.vault_kv2_get', 'secret', url='https://vault.domain.local') }}" + + - name: Display the results + ansible.builtin.debug: + msg: + - "Secret: {{ response.secret }}" + - "Data: {{ response.data }} (contains secret data & metadata in kv2)" + - "Metadata: {{ response.metadata }}" + - "Full response: {{ response.raw }}" \ No newline at end of file