From 72a1f5bbd281a806c95f7dafee579e849c1b80f0 Mon Sep 17 00:00:00 2001 From: "patchback[bot]" <45432694+patchback[bot]@users.noreply.github.com> Date: Wed, 3 Mar 2021 08:30:36 +0100 Subject: [PATCH] Adding another example for tss lookup (#1945) (#1947) * 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 32c0460c8c..067ca0b167 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