first_found: fix examples to match the code (#40821)

This commit is contained in:
Martin Krizek 2018-06-06 12:45:30 +02:00 committed by GitHub
parent 77e2bd5f8e
commit 23a337918c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -44,13 +44,14 @@ EXAMPLES = """
- bar - bar
- name: same copy but specific paths - name: same copy but specific paths
copy: src={{lookup('first_found', findme, mypaths)}} dest=/some/file copy: src={{lookup('first_found', params)}} dest=/some/file
vars: vars:
findme: params:
files:
- foo - foo
- "{{inventory_hostname}}" - "{{inventory_hostname}}"
- bar - bar
mypaths: paths:
- /tmp/production - /tmp/production
- /tmp/staging - /tmp/staging
@ -64,12 +65,15 @@ EXAMPLES = """
- "default_foo.conf" - "default_foo.conf"
- name: read vars from first file found, use 'vars/' relative subdir - name: read vars from first file found, use 'vars/' relative subdir
include_vars: "{{lookup('first_found', findme, paths=['vars'])}}" include_vars: "{{lookup('first_found', params)}}"
vars: vars:
findme: params:
files:
- '{{ansible_os_distribution}}.yml' - '{{ansible_os_distribution}}.yml'
- '{{ansible_os_family}}.yml' - '{{ansible_os_family}}.yml'
- default.yml - default.yml
paths:
- 'vars'
""" """
RETURN = """ RETURN = """