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