From 677ab8e383cbe156a0f354582df56324606cfaed Mon Sep 17 00:00:00 2001 From: Jim Speir Date: Tue, 2 Mar 2021 20:58:55 +0000 Subject: [PATCH] Adding another example for tss lookup (#1945) * 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 --- 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