2012-05-23 22:57:43 +00:00
|
|
|
require "vagrant"
|
|
|
|
|
|
|
|
require Vagrant.source_root.join("plugins/guests/redhat/guest")
|
|
|
|
|
2012-04-19 04:23:25 +00:00
|
|
|
module VagrantPlugins
|
|
|
|
module GuestSuse
|
|
|
|
class Guest < VagrantPlugins::GuestRedHat::Guest
|
|
|
|
def network_scripts_dir
|
|
|
|
'/etc/sysconfig/network/'
|
|
|
|
end
|
2012-12-31 08:38:36 +00:00
|
|
|
|
|
|
|
def change_host_name(name)
|
2013-03-07 19:34:47 +00:00
|
|
|
vm.communicate.tap do |comm|
|
|
|
|
# Only do this if the hostname is not already set
|
|
|
|
if !comm.test("sudo hostname | grep '#{name}'")
|
|
|
|
comm.sudo("echo '#{name}' > /etc/HOSTNAME")
|
|
|
|
comm.sudo("hostname #{name}")
|
|
|
|
comm.sudo("sed -i 's@^\\(127[.]0[.]0[.]1[[:space:]]\\+\\)@\\1#{name} #{name.split('.')[0]} @' /etc/hosts")
|
|
|
|
end
|
|
|
|
end
|
2012-12-31 08:38:36 +00:00
|
|
|
end
|
2012-04-19 04:23:25 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|