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
|
||||
|
||||
- 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:
|
||||
possible_files:
|
||||
- "{{ ansible_distribution }}.yaml"
|
||||
- "{{ ansible_os_family }}.yaml"
|
||||
params:
|
||||
files:
|
||||
- '{{ansible_distribution}}.yaml'
|
||||
- '{{ansible_os_family}}.yaml'
|
||||
- default.yaml
|
||||
paths:
|
||||
- 'vars'
|
||||
|
||||
- name: Bare include (free-form)
|
||||
include_vars: myvars.yaml
|
||||
|
|
|
@ -88,7 +88,7 @@ EXAMPLES = """
|
|||
vars:
|
||||
params:
|
||||
files:
|
||||
- '{{ansible_os_distribution}}.yml'
|
||||
- '{{ansible_distribution}}.yml'
|
||||
- '{{ansible_os_family}}.yml'
|
||||
- default.yml
|
||||
paths:
|
||||
|
|
Loading…
Reference in a new issue