Use first found - Skipping if file not found

This commit is contained in:
2022-03-13 21:53:44 +13:00
parent ba5f05e71a
commit f55d35ffb4

View File

@@ -1,2 +1,8 @@
---
- include: "{{ ansible_os_family }}.yml"
- name: Include tasks only if one of the files exist, otherwise skip the task
include_tasks:
file: "{{ item }}"
with_first_found:
files:
- "{{ ansible_os_family }}.yml"
skip: True