Skip to content

Commit dee6a59

Browse files
authored
Constrain OS-specific variables lookup to role var directory for prereq_jdk role (#306)
Signed-off-by: Jim Enright <[email protected]>
1 parent 5b543fb commit dee6a59

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

roles/prereq_jdk/tasks/main.yml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,16 @@
3636
- name: Include OS-specific variables
3737
ansible.builtin.include_vars: "{{ item }}"
3838
with_first_found:
39-
- "{{ ansible_facts['distribution'] }}-{{ ansible_facts['distribution_version'] }}.yml"
40-
- "{{ ansible_facts['distribution'] }}-{{ ansible_facts['distribution_major_version'] }}.yml"
41-
- "{{ ansible_facts['distribution'] }}.yml"
42-
- "{{ ansible_facts['os_family'] }}-{{ ansible_facts['distribution_version'] }}.yml"
43-
- "{{ ansible_facts['os_family'] }}-{{ ansible_facts['distribution_major_version'] }}.yml"
44-
- "{{ ansible_facts['os_family'] }}.yml"
45-
- "default.yml"
39+
- files:
40+
- "{{ ansible_facts['distribution'] }}-{{ ansible_facts['distribution_version'] }}.yml"
41+
- "{{ ansible_facts['distribution'] }}-{{ ansible_facts['distribution_major_version'] }}.yml"
42+
- "{{ ansible_facts['distribution'] }}.yml"
43+
- "{{ ansible_facts['os_family'] }}-{{ ansible_facts['distribution_version'] }}.yml"
44+
- "{{ ansible_facts['os_family'] }}-{{ ansible_facts['distribution_major_version'] }}.yml"
45+
- "{{ ansible_facts['os_family'] }}.yml"
46+
- "default.yml"
47+
paths:
48+
- "{{ role_path }}/vars"
4649

4750
- name: Install JDK
4851
when: jdk_install_packages

0 commit comments

Comments
 (0)