Class: Vagrant::Systems::Gentoo

Inherits:
Linux show all
Defined in:
lib/vagrant/systems/gentoo.rb

Instance Attribute Summary

Attributes inherited from Base

#vm

Instance Method Summary collapse

Methods inherited from Linux

#distro_dispatch, #halt, #mount_folder, #mount_nfs, #mount_shared_folder

Methods inherited from Base

#change_host_name, #distro_dispatch, #halt, #initialize, #mount_nfs, #mount_shared_folder

Constructor Details

This class inherits a constructor from Vagrant::Systems::Base

Instance Method Details

#enable_host_only_network(net_options) ⇒ Object



14
15
16
17
18
19
20
21
22
23
24
# File 'lib/vagrant/systems/gentoo.rb', line 14

def enable_host_only_network(net_options)
  entry = TemplateRenderer.render('network_entry_gentoo', :net_options => net_options)
  vm.ssh.upload!(StringIO.new(entry), "/tmp/vagrant-network-entry")

  vm.ssh.execute do |ssh|
    ssh.exec!("sudo ln -fs /etc/init.d/net.lo /etc/init.d/net.eth#{net_options[:adapter]}")
    ssh.exec!("sudo /etc/init.d/net.eth#{net_options[:adapter]} stop 2> /dev/null")
    ssh.exec!("sudo su -c 'cat /tmp/vagrant-network-entry >> /etc/conf.d/net'")
    ssh.exec!("sudo /etc/init.d/net.eth#{net_options[:adapter]} start")
  end
end

#prepare_host_only_network(net_options = nil) ⇒ Object



4
5
6
7
8
9
10
11
12
# File 'lib/vagrant/systems/gentoo.rb', line 4

def prepare_host_only_network(net_options=nil)
  # Remove any previous host only network additions to the
  # interface file.
  vm.ssh.execute do |ssh|
    # Clear out any previous entries
    ssh.exec!("sudo sed -e '/^#VAGRANT-BEGIN/,/^#VAGRANT-END/ d' /etc/conf.d/net > /tmp/vagrant-network-interfaces")
    ssh.exec!("sudo su -c 'cat /tmp/vagrant-network-interfaces > /etc/conf.d/net'")
  end
end