Fix Include_vars example (#69966)

* Remove incorrect var in first_found docs
* Fix include_vars example using lookup
This commit is contained in:
Falcon Taylor-Carter 2020-06-11 16:24:52 -04:00 committed by GitHub
parent 8c3eb7ae4a
commit f5df702b55
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 6 deletions

View file

@ -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"
- default.yaml
params:
files:
- '{{ansible_distribution}}.yaml'
- '{{ansible_os_family}}.yaml'
- default.yaml
paths:
- 'vars'
- name: Bare include (free-form)
include_vars: myvars.yaml

View file

@ -88,7 +88,7 @@ EXAMPLES = """
vars:
params:
files:
- '{{ansible_os_distribution}}.yml'
- '{{ansible_distribution}}.yml'
- '{{ansible_os_family}}.yml'
- default.yml
paths: