Skip to content

Commit 0cc5e59

Browse files
committed
Do not break if OS variables not found
Allows to run the role on other systems, even if a variables file has not been defined for it.
1 parent 5e70f6e commit 0cc5e59

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tasks/variables.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
---
22
# Variable configuration.
33
- name: Include OS-specific variables.
4-
include_vars: "{{ ansible_os_family }}.yml"
4+
include_vars: "{{ item }}"
5+
with_first_found:
6+
- files:
7+
- "vars/{{ ansible_os_family }}.yml"
8+
skip: true
59
when: ansible_os_family != "RedHat"
610

711
- name: Include OS-specific variables (RedHat).

0 commit comments

Comments
 (0)