From 70f501d5c88884496ff65b6301c5f4bfd18e1192 Mon Sep 17 00:00:00 2001 From: js-max <53036263+js-max@users.noreply.github.com> Date: Thu, 5 Sep 2019 16:42:39 +0100 Subject: [PATCH] Update hashi_vault.py documentation with kv V2 example (#61221) --- lib/ansible/plugins/lookup/hashi_vault.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/ansible/plugins/lookup/hashi_vault.py b/lib/ansible/plugins/lookup/hashi_vault.py index 6d98051e550..016f44528d4 100644 --- a/lib/ansible/plugins/lookup/hashi_vault.py +++ b/lib/ansible/plugins/lookup/hashi_vault.py @@ -98,6 +98,13 @@ EXAMPLES = """ - name: Return all secrets from a path in a namespace debug: msg: "{{ lookup('hashi_vault', 'secret=secret/hello token=c975b780-d1be-8016-866b-01d0f9b688a5 url=http://myvault:8200 namespace=teama/admins')}}" + +# to work with kv v2 (vault api - for kv v2 - GET method requires that PATH should be "secret/data/:path") +- name: Return all kv v2 secrets from a path + debug: + msg: "{{ lookup('hashi_vault', 'secret=secret/data/hello token=my_vault_token url=http://myvault_url:8200') }}" + + """ RETURN = """