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
This commit is contained in:
Peter Metz 2019-01-31 23:46:52 -08:00 committed by Kubernetes Prow Robot
parent 143e2272ff
commit e245e935aa

5
Vagrantfile vendored
View file

@ -177,8 +177,9 @@ Vagrant.configure("2") do |config|
if i == $num_instances if i == $num_instances
node.vm.provision "ansible" do |ansible| node.vm.provision "ansible" do |ansible|
ansible.playbook = $playbook ansible.playbook = $playbook
if File.exist?(File.join( $inventory, "hosts.ini")) $ansible_inventory_path = File.join( $inventory, "hosts.ini")
ansible.inventory_path = $inventory if File.exist?($ansible_inventory_path)
ansible.inventory_path = $ansible_inventory_path
end end
ansible.become = true ansible.become = true
ansible.limit = "all" ansible.limit = "all"