From 07cd51a33bec1c2500d95eb98b2cc1afabeee9ca Mon Sep 17 00:00:00 2001 From: "patchback[bot]" <45432694+patchback[bot]@users.noreply.github.com> Date: Tue, 2 Mar 2021 22:23:28 +0100 Subject: [PATCH] Adding another example for tss lookup (#1945) (#1948) * Adding another example for tss lookup A more detailed example using self-hosted secrets server as investigated in #1943 * Update plugins/lookup/tss.py Co-authored-by: Felix Fontein * Better line breaking * Update plugins/lookup/tss.py Seconded! Co-authored-by: Felix Fontein * Remove newline to pass tests * Update plugins/lookup/tss.py Co-authored-by: Felix Fontein (cherry picked from commit 677ab8e383cbe156a0f354582df56324606cfaed) Co-authored-by: Jim Speir --- plugins/lookup/tss.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/plugins/lookup/tss.py b/plugins/lookup/tss.py index f24d79373a..2c25532699 100644 --- a/plugins/lookup/tss.py +++ b/plugins/lookup/tss.py @@ -82,6 +82,27 @@ EXAMPLES = r""" | items2dict(key_name='slug', value_name='itemValue'))['password'] }} + +- hosts: localhost + vars: + secret: >- + {{ + lookup( + 'community.general.tss', + 102, + base_url='https://secretserver.domain.com/SecretServer/', + username='user.name', + password='password' + ) + }} + tasks: + - ansible.builtin.debug: + msg: > + the password is {{ + (secret['items'] + | items2dict(key_name='slug', + value_name='itemValue'))['password'] + }} """ from ansible.errors import AnsibleError, AnsibleOptionsError