From f79084b1dbf3c4bab5360bf37d969477688c7994 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Thu, 9 Jun 2011 23:20:17 -0400 Subject: [PATCH] Touch RedHat network config to force it to exist [GH-381] --- CHANGELOG.md | 2 ++ lib/vagrant/systems/redhat.rb | 1 + 2 files changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 758098a16..1e1cd6d95 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ - Added DEVICE option to the RedHat host only networking entry, which allows host only networking to work even if the VM has multiple NICs. [GH-382] + - Touch the network configuration file for RedHat so that the `sed` works + with host only networking. [GH-381] ## 0.7.5 (May 16, 2011) diff --git a/lib/vagrant/systems/redhat.rb b/lib/vagrant/systems/redhat.rb index 8a854fc00..3805dcbca 100644 --- a/lib/vagrant/systems/redhat.rb +++ b/lib/vagrant/systems/redhat.rb @@ -6,6 +6,7 @@ module Vagrant # interface file. vm.ssh.execute do |ssh| # Clear out any previous entries + ssh.exec!("sudo touch /etc/sysconfig/network-scripts/ifcfg-eth#{net_options[:adapter]}") ssh.exec!("sudo sed -e '/^#VAGRANT-BEGIN/,/^#VAGRANT-END/ d' /etc/sysconfig/network-scripts/ifcfg-eth#{net_options[:adapter]} > /tmp/vagrant-ifcfg-eth#{net_options[:adapter]}") ssh.exec!("sudo su -c 'cat /tmp/vagrant-ifcfg-eth#{net_options[:adapter]} > /etc/sysconfig/network-scripts/ifcfg-eth#{net_options[:adapter]}'") end