From 26757edfb27b8d871963aae45e41eddf05a06775 Mon Sep 17 00:00:00 2001 From: Sylvia van Os Date: Thu, 27 May 2021 07:57:06 +0200 Subject: [PATCH] Add one-liner lookup example (#2615) * Add one-liner lookup example * Remove trailing whitespace * Update plugins/lookup/tss.py Co-authored-by: Felix Fontein * Update plugins/lookup/tss.py Co-authored-by: Amin Vakil Co-authored-by: Felix Fontein Co-authored-by: Amin Vakil --- plugins/lookup/tss.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/plugins/lookup/tss.py b/plugins/lookup/tss.py index 2c25532699..b7b7cd85e0 100644 --- a/plugins/lookup/tss.py +++ b/plugins/lookup/tss.py @@ -103,6 +103,14 @@ EXAMPLES = r""" | items2dict(key_name='slug', value_name='itemValue'))['password'] }} + +- hosts: localhost + vars: + secret_password: >- + {{ ((lookup('community.general.tss', 1) | from_json).get('items') | items2dict(key_name='slug', value_name='itemValue'))['password'] }}" + tasks: + - ansible.builtin.debug: + msg: the password is {{ secret_password }} """ from ansible.errors import AnsibleError, AnsibleOptionsError