From 1c4e7ee0689a8e0b15a7b119807e3ddca4aad61c Mon Sep 17 00:00:00 2001 From: AJ Date: Tue, 23 Aug 2016 20:58:15 +0100 Subject: [PATCH 1/2] assuming a scenario - vagrant up -> power off -> vagrant up vagrant will stuck on the network configuration DEBUG ssh: stdout: mv: overwrite '/etc/sysconfig/network-scripts/ifcfg-eth0'? DEBUG ssh: Sending SSH keep-alive... --- plugins/guests/redhat/cap/configure_networks.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/guests/redhat/cap/configure_networks.rb b/plugins/guests/redhat/cap/configure_networks.rb index 6cbc9ec17..05b2195fd 100644 --- a/plugins/guests/redhat/cap/configure_networks.rb +++ b/plugins/guests/redhat/cap/configure_networks.rb @@ -43,7 +43,7 @@ module VagrantPlugins /sbin/ifdown '#{network[:device]}' || true # Move new config into place - mv '#{remote_path}' '#{final_path}' + mv -f '#{remote_path}' '#{final_path}' # Bring the interface up ARPCHECK=no /sbin/ifup '#{network[:device]}' From 2e723ea308e199e6ce13996e5b9d65a2f647a925 Mon Sep 17 00:00:00 2001 From: AJ Date: Tue, 23 Aug 2016 21:02:11 +0100 Subject: [PATCH 2/2] added general restart for network - to prevent IP address dropping on interfaces --- plugins/guests/redhat/cap/configure_networks.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/plugins/guests/redhat/cap/configure_networks.rb b/plugins/guests/redhat/cap/configure_networks.rb index 05b2195fd..d96e27e20 100644 --- a/plugins/guests/redhat/cap/configure_networks.rb +++ b/plugins/guests/redhat/cap/configure_networks.rb @@ -50,6 +50,11 @@ module VagrantPlugins EOH end + commands << <<-EOH.gsub(/^ {14}/, '') + # Restart network + service network restart + EOH + comm.sudo(commands.join("\n")) end end