Fix Include_vars example (#69966)

* Remove incorrect var in first_found docs
* Fix include_vars example using lookup
pull/70032/head
Falcon Taylor-Carter 6 years ago committed by GitHub
parent 8c3eb7ae4a
commit f5df702b55
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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'
- '{{ansible_os_family}}.yaml'
- default.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…
Cancel
Save