Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix path lookup for variable inclusion (NO_JIRA) #5

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 deletions tasks/main.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
---
- name: Set OS-specific variables for {{ ansible_os_family }}-{{ ansible_distribution }}-{{ ansible_distribution_major_version }}
ansible.builtin.include_vars:
file: "{{ file }}"
file: "{{ lookup('ansible.builtin.first_found', files, skip=True) }}"
vars:
files:
- "{{ ansible_os_family }}-{{ ansible_distribution }}-{{ ansible_distribution_major_version }}.yaml"
- "{{ ansible_os_family }}-{{ ansible_distribution }}.yaml"
- "vars/{{ ansible_os_family }}-{{ ansible_distribution }}-{{ ansible_distribution_major_version }}.yaml"
- "vars/{{ ansible_os_family }}-{{ ansible_distribution }}.yaml"
# This is to allow to distinguish between Windows-Server/Windows-Client
- "{{ ansible_os_family }}-{{ ansible_facts.os_installation_type | default('Server') }}.yaml"
- "{{ ansible_os_family }}.yaml"
- "{{ ansible_system }}.yaml"
file: "{{ lookup('ansible.builtin.first_found', files, paths=['vars'], skip=True) }}"
- "vars/{{ ansible_os_family }}-{{ ansible_facts.os_installation_type | default('Server') }}.yaml"
- "vars/{{ ansible_os_family }}.yaml"
- "vars/{{ ansible_system }}.yaml"
tags: vars
when: file

- name: Execute tasks for {{ ansible_os_family }} ({{ ansible_distribution }} {{ ansible_distribution_major_version }})
ansible.builtin.include_tasks:
Expand Down