Skip to content

Commit b5c3a36

Browse files
committed
include OS/distribution default variables without using relative path.
1 parent 882f2ac commit b5c3a36

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

tasks/main.yml

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,28 @@
99

1010
## include OS family specific variables
1111

12+
- debug:
13+
msg="{{ item }}"
14+
with_items:
15+
- "vars/{{ ansible_os_family | lower }}-{{ ansible_distribution | lower }}.yml"
16+
- "vars/{{ ansible_os_family | lower }}.yml"
17+
1218
- name: include OS family/distribution specific variables
1319
include_vars: "{{ item }}"
1420
with_first_found:
15-
- "../defaults/{{ ansible_distribution | lower }}-{{ ansible_distribution_version | lower }}.yml"
16-
- "../defaults/{{ ansible_distribution | lower }}.yml"
17-
- "../defaults/{{ ansible_os_family | lower }}.yml"
21+
- "defaults/{{ ansible_os_family | lower }}-{{ ansible_distribution | lower }}.yml"
22+
- "defaults/{{ ansible_os_family | lower }}.yml"
1823
tags: installation
1924

2025
- include: debug.yml
2126
when: debug | default(false)
2227
tags: debug
2328

29+
- name: check if operating system is suported
30+
fail:
31+
msg: "The operating system ({{ ansible_os_family }}) of the target machine ({{ inventory_hostname }}) is not currently supported."
32+
when: oracle_java_os_supported is not defined or not oracle_java_os_supported
33+
2434
## include OS family specific task file
2535

2636
- name: if darwin/macosx, include distribution specific task file
@@ -34,8 +44,3 @@
3444
- name: if redhat, include family specific task file
3545
include: "redhat/main.yml"
3646
when: ansible_os_family | lower == 'redhat'
37-
38-
- name: check if operating system is suported
39-
fail:
40-
msg: "The operating system ({{ ansible_os_family }}) of the target machine ({{ inventory_hostname }}) is not currently supported."
41-
when: oracle_java_os_supported is not defined or not oracle_java_os_supported

0 commit comments

Comments
 (0)