From 59541de4378e058566449e97e8bb891824fb5978 Mon Sep 17 00:00:00 2001 From: Maciej Date: Fri, 5 Feb 2021 09:50:52 +0100 Subject: [PATCH] Vagrantfile: always recreate inventory symlink (#7245) Fixes 7244 Signed-off-by: Maciej Wereski --- Vagrantfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Vagrantfile b/Vagrantfile index d5736d913..974e3a415 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -86,9 +86,9 @@ $inventory = File.absolute_path($inventory, File.dirname(__FILE__)) if ! File.exist?(File.join(File.dirname($inventory), "hosts.ini")) $vagrant_ansible = File.join(File.dirname(__FILE__), ".vagrant", "provisioners", "ansible") FileUtils.mkdir_p($vagrant_ansible) if ! File.exist?($vagrant_ansible) - if ! File.exist?(File.join($vagrant_ansible,"inventory")) - FileUtils.ln_s($inventory, File.join($vagrant_ansible,"inventory")) - end + $vagrant_inventory = File.join($vagrant_ansible,"inventory") + FileUtils.rm_f($vagrant_inventory) + FileUtils.ln_s($inventory, $vagrant_inventory) end if Vagrant.has_plugin?("vagrant-proxyconf")