mirror of
				https://github.com/geerlingguy/ansible-role-docker.git
				synced 2025-11-01 01:19:32 +01: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.
 | 
			
		||||
  include_vars: "{{ lookup('first_found', params) }}"
 | 
			
		||||
  vars:
 | 
			
		||||
@ -9,6 +14,7 @@
 | 
			
		||||
        - main.yml
 | 
			
		||||
      paths:
 | 
			
		||||
        - 'vars'
 | 
			
		||||
  when: vars_dir.stat.exists and vars_dir.stat.isdir
 | 
			
		||||
 | 
			
		||||
- include_tasks: setup-RedHat.yml
 | 
			
		||||
  when: ansible_os_family == 'RedHat'
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user