mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 13:22:48 +00:00
moving from with_ff to just ff (#44847)
This commit is contained in:
@@ -85,11 +85,12 @@ EXAMPLES = """
|
||||
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: "{{ item }}"
|
||||
with_first_found:
|
||||
- "{{ ansible_distribution }}.yaml"
|
||||
- "{{ ansible_os_family }}.yaml"
|
||||
- default.yaml
|
||||
include_vars: "{{ lookup('first_found', possible_files) }}"
|
||||
vars:
|
||||
possible_files:
|
||||
- "{{ ansible_distribution }}.yaml"
|
||||
- "{{ ansible_os_family }}.yaml"
|
||||
- default.yaml
|
||||
|
||||
- name: Bare include (free-form)
|
||||
include_vars: myvars.yaml
|
||||
|
||||
@@ -12,7 +12,7 @@ short_description: recursively match all files in a directory tree
|
||||
description:
|
||||
- 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
|
||||
- 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.
|
||||
options:
|
||||
_terms:
|
||||
|
||||
@@ -150,5 +150,5 @@ class LookupModule(LookupBase):
|
||||
return [path]
|
||||
if skip:
|
||||
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")
|
||||
|
||||
Reference in New Issue
Block a user