Merge "Replace with_first_found with lookup first_found"
This commit is contained in:
commit
3959522d61
@ -5,12 +5,13 @@
|
||||
loop: '{{ base_packages }}'
|
||||
|
||||
- name: Include OS-specific variables
|
||||
include_vars: "{{ item }}"
|
||||
with_first_found:
|
||||
- "{{ ansible_facts.distribution }}.{{ ansible_facts.architecture }}.yaml"
|
||||
- "{{ ansible_facts.distribution }}.yaml"
|
||||
- "{{ ansible_facts.os_family }}.yaml"
|
||||
- "default.yaml"
|
||||
include_vars: "{{ lookup('first_found', file_list) }}"
|
||||
vars:
|
||||
file_list:
|
||||
- "{{ ansible_facts.distribution }}.{{ ansible_facts.architecture }}.yaml"
|
||||
- "{{ ansible_facts.distribution }}.yaml"
|
||||
- "{{ ansible_facts.os_family }}.yaml"
|
||||
- "default.yaml"
|
||||
|
||||
- name: Install distro specific packages
|
||||
package:
|
||||
@ -54,7 +55,6 @@
|
||||
|
||||
- name: Include OS-specific tasks
|
||||
include_tasks: "{{ lookup('first_found', file_list) }}"
|
||||
static: no
|
||||
vars:
|
||||
file_list:
|
||||
- "{{ ansible_facts.distribution }}.{{ ansible_facts.lsb.codename }}.{{ ansible_facts.architecture }}.yaml"
|
||||
|
@ -1,16 +1,17 @@
|
||||
- name: Include OS-specific variables
|
||||
include_vars: "{{ item }}"
|
||||
with_first_found:
|
||||
- "{{ ansible_facts.distribution }}.{{ ansible_facts.architecture }}.yaml"
|
||||
- "{{ ansible_facts.distribution }}.yaml"
|
||||
- "{{ ansible_facts.os_family }}.yaml"
|
||||
- "default.yaml"
|
||||
include_vars: "{{ lookup('first_found', file_list) }}"
|
||||
vars:
|
||||
file_list:
|
||||
- "{{ ansible_facts.distribution }}.{{ ansible_facts.architecture }}.yaml"
|
||||
- "{{ ansible_facts.distribution }}.yaml"
|
||||
- "{{ ansible_facts.os_family }}.yaml"
|
||||
- "default.yaml"
|
||||
|
||||
- name: Include OS-specific tasks
|
||||
include_tasks: "{{ item }}"
|
||||
static: no
|
||||
with_first_found:
|
||||
- files:
|
||||
include_tasks: "{{ lookup('first_found', params) }}"
|
||||
vars:
|
||||
params:
|
||||
files:
|
||||
- "{{ ansible_facts.distribution }}.{{ ansible_facts.lsb.codename }}.{{ ansible_facts.architecture }}.yaml"
|
||||
- "{{ ansible_facts.distribution }}.{{ ansible_facts.architecture }}.yaml"
|
||||
- "{{ ansible_facts.distribution }}.yaml"
|
||||
|
Loading…
x
Reference in New Issue
Block a user