From e245e935aab6588883edcaa3e901e2b74e80a054 Mon Sep 17 00:00:00 2001
From: Peter Metz <petermetz@users.noreply.github.com>
Date: Thu, 31 Jan 2019 23:46:52 -0800
Subject: [PATCH] fix(vagrant): sets ansible.inventory_path to file not dir
 (#4153)

This fixes the issue where if there was a hosts.ini file present in the
inventory directory, then Vagrant would set an incorrect path as
ansible.inventory_path
---
 Vagrantfile | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/Vagrantfile b/Vagrantfile
index ad5550ede..3afc6d0c4 100644
--- a/Vagrantfile
+++ b/Vagrantfile
@@ -177,8 +177,9 @@ Vagrant.configure("2") do |config|
       if i == $num_instances
         node.vm.provision "ansible" do |ansible|
           ansible.playbook = $playbook
-          if File.exist?(File.join( $inventory, "hosts.ini"))
-            ansible.inventory_path = $inventory
+          $ansible_inventory_path = File.join( $inventory, "hosts.ini")
+          if File.exist?($ansible_inventory_path)
+            ansible.inventory_path = $ansible_inventory_path
           end
           ansible.become = true
           ansible.limit = "all"
-- 
GitLab