mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
moving from with_ff to just ff (#44847)
This commit is contained in:
parent
f7ef06e849
commit
1ed57f1f64
3 changed files with 8 additions and 7 deletions
|
@ -85,11 +85,12 @@ EXAMPLES = """
|
||||||
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: "{{ item }}"
|
include_vars: "{{ lookup('first_found', possible_files) }}"
|
||||||
with_first_found:
|
vars:
|
||||||
- "{{ ansible_distribution }}.yaml"
|
possible_files:
|
||||||
- "{{ ansible_os_family }}.yaml"
|
- "{{ ansible_distribution }}.yaml"
|
||||||
- default.yaml
|
- "{{ ansible_os_family }}.yaml"
|
||||||
|
- default.yaml
|
||||||
|
|
||||||
- name: Bare include (free-form)
|
- name: Bare include (free-form)
|
||||||
include_vars: myvars.yaml
|
include_vars: myvars.yaml
|
||||||
|
|
|
@ -12,7 +12,7 @@ short_description: recursively match all files in a directory tree
|
||||||
description:
|
description:
|
||||||
- This lookup enables you to template a complete tree of files on a target system while retaining permissions and ownership.
|
- This lookup enables you to template a complete tree of files on a target system while retaining permissions and ownership.
|
||||||
- Supports directories, files and symlinks, including SELinux and other file properties
|
- Supports directories, files and symlinks, including SELinux and other file properties
|
||||||
- If you provide more than one path, it will implement a with_first_found logic, and will not process entries it already processed in previous paths.
|
- If you provide more than one path, it will implement a first_found logic, and will not process entries it already processed in previous paths.
|
||||||
This enables merging different trees in order of importance, or add role_vars to specific paths to influence different instances of the same role.
|
This enables merging different trees in order of importance, or add role_vars to specific paths to influence different instances of the same role.
|
||||||
options:
|
options:
|
||||||
_terms:
|
_terms:
|
||||||
|
|
|
@ -150,5 +150,5 @@ class LookupModule(LookupBase):
|
||||||
return [path]
|
return [path]
|
||||||
if skip:
|
if skip:
|
||||||
return []
|
return []
|
||||||
raise AnsibleLookupError("No file was found when using with_first_found. Use the 'skip: true' option to allow this task to be skipped if no "
|
raise AnsibleLookupError("No file was found when using first_found. Use the 'skip: true' option to allow this task to be skipped if no "
|
||||||
"files are found")
|
"files are found")
|
||||||
|
|
Loading…
Reference in a new issue