Add one-liner lookup example (#2615)

* Add one-liner lookup example

* Remove trailing whitespace

* Update plugins/lookup/tss.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update plugins/lookup/tss.py

Co-authored-by: Amin Vakil <info@aminvakil.com>

Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Amin Vakil <info@aminvakil.com>
pull/2641/head
Sylvia van Os 2021-05-27 07:57:06 +02:00 committed by GitHub
parent 0b4a2bea01
commit 26757edfb2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 0 deletions

View File

@ -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