mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-27 07:01:22 -07:00
first_found: fix examples to match the code (#40821)
This commit is contained in:
parent
77e2bd5f8e
commit
23a337918c
1 changed files with 17 additions and 13 deletions
|
@ -44,15 +44,16 @@ 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:
|
||||||
- foo
|
files:
|
||||||
- "{{inventory_hostname}}"
|
- foo
|
||||||
- bar
|
- "{{inventory_hostname}}"
|
||||||
mypaths:
|
- bar
|
||||||
- /tmp/production
|
paths:
|
||||||
- /tmp/staging
|
- /tmp/production
|
||||||
|
- /tmp/staging
|
||||||
|
|
||||||
- name: INTERFACES | Create Ansible header for /etc/network/interfaces
|
- name: INTERFACES | Create Ansible header for /etc/network/interfaces
|
||||||
template:
|
template:
|
||||||
|
@ -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:
|
||||||
- '{{ansible_os_distribution}}.yml'
|
files:
|
||||||
- '{{ansible_os_family}}.yml'
|
- '{{ansible_os_distribution}}.yml'
|
||||||
- default.yml
|
- '{{ansible_os_family}}.yml'
|
||||||
|
- default.yml
|
||||||
|
paths:
|
||||||
|
- 'vars'
|
||||||
"""
|
"""
|
||||||
|
|
||||||
RETURN = """
|
RETURN = """
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue