vagrant/plugins/guests/suse/guest.rb

25 lines
712 B
Ruby
Raw Normal View History

require "vagrant"
require Vagrant.source_root.join("plugins/guests/redhat/guest")
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
end
end
end