vars: prepend default paths: {{role_path}}/vars

When Ansible is handling multiple roles, it may look in the wrong vars/
directory. This change prevents such bugs.
This commit is contained in:
Matt Oquist 2017-10-24 22:49:26 -04:00
parent 537b9b2bc2
commit a340add520

View file

@ -2,11 +2,11 @@
- name: Set OS dependent variables
include_vars: "{{ item }}"
with_first_found:
- "{{ ansible_distribution }}_{{ ansible_distribution_major_version }}.yml"
- "{{ ansible_distribution }}.yml"
- "{{ ansible_os_family }}_{{ ansible_distribution_major_version }}.yml"
- "{{ ansible_os_family }}.yml"
- default.yml
- "{{ role_path }}/vars/{{ ansible_distribution }}_{{ ansible_distribution_major_version }}.yml"
- "{{ role_path }}/vars/{{ ansible_distribution }}.yml"
- "{{ role_path }}/vars/{{ ansible_os_family }}_{{ ansible_distribution_major_version }}.yml"
- "{{ role_path }}/vars/{{ ansible_os_family }}.yml"
- "{{ role_path }}/vars/default.yml"
- name: OS is supported
assert: