subelements: Clarify parameter docs (#71177)

skip_missing parameter in subelements lookup plugin is accepted from
inside the dictionary.

Fixes: #38182

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
pull/71339/head
Abhijeet Kasurde 4 years ago committed by GitHub
parent 88bfc7977d
commit 6d17736ef4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,2 @@
minor_changes:
- subelements - clarify the lookup plugin documentation for parameter handling (https://github.com/ansible/ansible/issues/38182).

@ -18,8 +18,9 @@ DOCUMENTATION = """
skip_missing: skip_missing:
default: False default: False
description: description:
- If set to True, the lookup plugin will skip the lists items that do not contain the given subkey. - Lookup accepts this flag from a dictionary as optional. See Example section for more information.
If False, the plugin will yield an error and complain about the missing subkey. - If set to C(True), the lookup plugin will skip the lists items that do not contain the given subkey.
- If set to C(False), the plugin will yield an error and complain about the missing subkey.
""" """
EXAMPLES = """ EXAMPLES = """
@ -74,7 +75,7 @@ EXAMPLES = """
- name: list groups for users that have them, don't error if groups key is missing - name: list groups for users that have them, don't error if groups key is missing
debug: var=item debug: var=item
loop: "{{lookup('subelements', users, 'groups', {'skip_missing': True})}}" loop: "{{ q('subelements', users, 'groups', {'skip_missing': True}) }}"
""" """
RETURN = """ RETURN = """

Loading…
Cancel
Save