Class: Vagrant::Guest::Suse

Inherits:
Redhat show all
Defined in:
lib/vagrant/guest/suse.rb

Instance Attribute Summary

Attributes inherited from Base

#vm

Instance Method Summary collapse

Methods inherited from Redhat

#configure_networks

Methods inherited from Linux

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

Methods inherited from Base

#configure_networks, #distro_dispatch, #halt, #initialize, #mount_nfs, #mount_shared_folder

Constructor Details

This class inherits a constructor from Vagrant::Guest::Linux

Instance Method Details

#change_host_name(name) ⇒ Object



7
8
9
10
11
12
13
14
# File 'lib/vagrant/guest/suse.rb', line 7

def change_host_name(name)
  # Only do this if the hostname is not already set
  if !vm.channel.test("sudo hostname | grep '#{name}'")
    vm.channel.sudo("echo #{name} > /etc/HOSTNAME")
    vm.channel.sudo("hostname #{name}")
    vm.channel.sudo("sed -i 's@^\\(127[.]0[.]0[.]1[[:space:]]\\+\\)@\\1#{name} #{name.split('.')[0]} @' /etc/hosts")
  end
end

#network_scripts_dirObject



4
5
6
# File 'lib/vagrant/guest/suse.rb', line 4

def network_scripts_dir
  '/etc/sysconfig/network/'
end