Emit 'vagrant-mounted' on Ubuntu in mount_virtualbox_shared_folder capability
Also includes the same, but commented out, for mount_nfs capability
This commit is contained in:
parent
ccfd321ef9
commit
b111cb6392
|
@ -0,0 +1,18 @@
|
|||
require_relative '../../linux/cap/mount_nfs'
|
||||
|
||||
module VagrantPlugins
|
||||
module GuestUbuntu
|
||||
module Cap
|
||||
class MountNFS < GuestLinux::Cap::MountNFS
|
||||
def self.mount_nfs_folder(machine, ip, folders)
|
||||
super
|
||||
# Emit an upstart events if upstart is available
|
||||
folders.each do |name, opts|
|
||||
real_guestpath = machine.guest.capability(:shell_expand_guest_path, opts[:guestpath])
|
||||
machine.communicate.sudo("[ -x /sbin/initctl ] && /sbin/initctl emit vagrant-mounted MOUNTPOINT=#{real_guestpath}")
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -0,0 +1,14 @@
|
|||
require_relative '../../linux/cap/mount_virtualbox_shared_folder'
|
||||
|
||||
module VagrantPlugins
|
||||
module GuestUbuntu
|
||||
module Cap
|
||||
class MountVirtualBoxSharedFolder < GuestLinux::Cap::MountVirtualBoxSharedFolder
|
||||
def self.mount_virtualbox_shared_folder(machine, name, guestpath, options)
|
||||
super
|
||||
machine.communicate.sudo("[ -x /sbin/initctl ] && /sbin/initctl emit vagrant-mounted MOUNTPOINT=#{guestpath}")
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -15,6 +15,17 @@ module VagrantPlugins
|
|||
require_relative "cap/change_host_name"
|
||||
Cap::ChangeHostName
|
||||
end
|
||||
|
||||
guest_capability("ubuntu", "mount_virtualbox_shared_folder") do
|
||||
require_relative "cap/mount_virtualbox_shared_folder"
|
||||
Cap::MountVirtualBoxSharedFolder
|
||||
end
|
||||
|
||||
#I don't know if this works or not
|
||||
#guest_capability("linux", "mount_nfs_folder") do
|
||||
# require_relative "cap/mount_nfs"
|
||||
# Cap::MountNFS
|
||||
#end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue