Fix Include_vars example (#69966)
* Remove incorrect var in first_found docs * Fix include_vars example using lookup
This commit is contained in:
parent
8c3eb7ae4a
commit
f5df702b55
2 changed files with 9 additions and 6 deletions
|
@ -95,12 +95,15 @@ EXAMPLES = r'''
|
||||||
when: x == 0
|
when: x == 0
|
||||||
|
|
||||||
- name: Load a variable file based on the OS type, or a default if not found. Using free-form to specify the file.
|
- name: Load a variable file based on the OS type, or a default if not found. Using free-form to specify the file.
|
||||||
include_vars: "{{ lookup('first_found', possible_files) }}"
|
include_vars: "{{ lookup('first_found', params) }}"
|
||||||
vars:
|
vars:
|
||||||
possible_files:
|
params:
|
||||||
- "{{ ansible_distribution }}.yaml"
|
files:
|
||||||
- "{{ ansible_os_family }}.yaml"
|
- '{{ansible_distribution}}.yaml'
|
||||||
- default.yaml
|
- '{{ansible_os_family}}.yaml'
|
||||||
|
- default.yaml
|
||||||
|
paths:
|
||||||
|
- 'vars'
|
||||||
|
|
||||||
- name: Bare include (free-form)
|
- name: Bare include (free-form)
|
||||||
include_vars: myvars.yaml
|
include_vars: myvars.yaml
|
||||||
|
|
|
@ -88,7 +88,7 @@ EXAMPLES = """
|
||||||
vars:
|
vars:
|
||||||
params:
|
params:
|
||||||
files:
|
files:
|
||||||
- '{{ansible_os_distribution}}.yml'
|
- '{{ansible_distribution}}.yml'
|
||||||
- '{{ansible_os_family}}.yml'
|
- '{{ansible_os_family}}.yml'
|
||||||
- default.yml
|
- default.yml
|
||||||
paths:
|
paths:
|
||||||
|
|
Loading…
Add table
Reference in a new issue