Merge pull request #487 from ypid/ansible/debops_hosts_support
Support to find Ansible hosts file in DebOps style projects
This commit is contained in:
		
						commit
						425c193364
					
				|  | @ -62,6 +62,7 @@ __host_file_location () { | |||
|   [[ "$OSTYPE" == darwin* ]] && FALLBACK="/usr/local/etc/ansible/hosts" | ||||
|   [[ "$OSTYPE" == linux* ]] && FALLBACK="/etc/ansible/hosts" | ||||
|   HOST_FILE=${ANSIBLE_HOSTS:=${FALLBACK}} | ||||
|   [[ -f ${HOST_FILE} ]] || HOST_FILE="$PWD/ansible/inventory/hosts" | ||||
|   [[ -f ${HOST_FILE} ]] || HOST_FILE=/dev/null | ||||
| 
 | ||||
|   echo ${HOST_FILE} | ||||
|  |  | |||
|  | @ -61,6 +61,7 @@ __host_file_location () { | |||
|   [[ "$OSTYPE" == darwin* ]] && FALLBACK="/usr/local/etc/ansible/hosts" | ||||
|   [[ "$OSTYPE" == linux* ]] && FALLBACK="/etc/ansible/hosts" | ||||
|   HOST_FILE=${ANSIBLE_HOSTS:=${FALLBACK}} | ||||
|   [[ -f ${HOST_FILE} ]] || HOST_FILE="$PWD/ansible/inventory/hosts" | ||||
|   [[ -f ${HOST_FILE} ]] || HOST_FILE=/dev/null | ||||
| 
 | ||||
|   echo ${HOST_FILE} | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue