mirror of
https://github.com/geerlingguy/ansible-role-docker.git
synced 2025-10-11 11:14:20 +02:00
Fix lookup when vars not exists error.
This commit is contained in:
parent
0fa54d7c59
commit
8acd249d07
@ -1,4 +1,9 @@
|
|||||||
---
|
---
|
||||||
|
- name: Check if vars directory exists
|
||||||
|
stat:
|
||||||
|
path: 'vars'
|
||||||
|
register: vars_dir
|
||||||
|
|
||||||
- name: Load OS-specific vars.
|
- name: Load OS-specific vars.
|
||||||
include_vars: "{{ lookup('first_found', params) }}"
|
include_vars: "{{ lookup('first_found', params) }}"
|
||||||
vars:
|
vars:
|
||||||
@ -9,6 +14,7 @@
|
|||||||
- main.yml
|
- main.yml
|
||||||
paths:
|
paths:
|
||||||
- 'vars'
|
- 'vars'
|
||||||
|
when: vars_dir.stat.exists and vars_dir.stat.isdir
|
||||||
|
|
||||||
- include_tasks: setup-RedHat.yml
|
- include_tasks: setup-RedHat.yml
|
||||||
when: ansible_os_family == 'RedHat'
|
when: ansible_os_family == 'RedHat'
|
||||||
|
Loading…
Reference in New Issue
Block a user