2012-05-23 22:57:43 +00:00
|
|
|
require "vagrant"
|
|
|
|
|
|
|
|
require Vagrant.source_root.join("plugins/guests/debian/guest")
|
|
|
|
|
2012-04-19 04:23:25 +00:00
|
|
|
module VagrantPlugins
|
|
|
|
module GuestUbuntu
|
|
|
|
class Guest < VagrantPlugins::GuestDebian::Guest
|
2012-01-13 06:57:32 +00:00
|
|
|
def mount_shared_folder(name, guestpath, options)
|
|
|
|
# Mount it like normal
|
|
|
|
super
|
|
|
|
|
|
|
|
# Emit an upstart event if upstart is available
|
2012-02-11 18:36:27 +00:00
|
|
|
vm.channel.sudo("[ -x /sbin/initctl ] && /sbin/initctl emit vagrant-mounted MOUNTPOINT=#{guestpath}")
|
2012-01-13 06:57:32 +00:00
|
|
|
end
|
|
|
|
|
2011-03-01 07:38:30 +00:00
|
|
|
def change_host_name(name)
|
2012-01-07 04:03:56 +00:00
|
|
|
if !vm.channel.test("sudo hostname | grep '#{name}'")
|
|
|
|
vm.channel.sudo("sed -i 's/.*$/#{name}/' /etc/hostname")
|
|
|
|
vm.channel.sudo("sed -i 's@^\\(127[.]0[.]1[.]1[[:space:]]\\+\\)@\\1#{name} #{name.split('.')[0]} @' /etc/hosts")
|
|
|
|
vm.channel.sudo("service hostname start")
|
2012-07-13 13:07:56 +00:00
|
|
|
vm.channel.sudo("hostname --fqdn > /etc/mailname")
|
2011-03-01 07:38:30 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|