archlinux host only network support [closes GH-448]
This commit is contained in:
parent
1bf3aa69ed
commit
860a458a9c
|
@ -11,6 +11,24 @@ module Vagrant
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
def prepare_host_only_network(net_options=nil)
|
||||
vm.ssh.execute do |ssh|
|
||||
ssh.exec!("sudo sed -e '/^#VAGRANT-BEGIN/,/^#VAGRANT-END/ d' /etc/rc.conf > /tmp/vagrant-network-interfaces")
|
||||
ssh.exec!("sudo su -c 'cat /tmp/vagrant-network-interfaces > /etc/rc.conf'")
|
||||
end
|
||||
end
|
||||
|
||||
def enable_host_only_network(net_options)
|
||||
entry = TemplateRenderer.render('network_entry_arch', :net_options => net_options)
|
||||
vm.ssh.upload!(StringIO.new(entry), "/tmp/vagrant-network-entry")
|
||||
|
||||
vm.ssh.execute do |ssh|
|
||||
ssh.exec!("sudo su -c 'cat /tmp/vagrant-network-entry >> /etc/rc.conf'")
|
||||
ssh.exec!("sudo /etc/rc.d/network restart")
|
||||
ssh.exec!("sudo su -c 'dhcpcd -k eth0 && dhcpcd eth0 & sleep 3'")
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
|
||||
#VAGRANT-BEGIN
|
||||
# The contents below are automatically generated by Vagrant.
|
||||
# Please do not modify any of these contents.
|
||||
interface=eth<%= net_options[:adapter] %>
|
||||
address=<%= net_options[:ip]%>
|
||||
netmask=<%= net_options[:netmask] %>
|
||||
gateway=
|
||||
#VAGRANT-END
|
Loading…
Reference in New Issue