guests/arch: Add NFS capabilities
This commit is contained in:
parent
cf9a8e3c0a
commit
e69211ab22
|
@ -0,0 +1,35 @@
|
|||
module VagrantPlugins
|
||||
module GuestArch
|
||||
module Cap
|
||||
class NFS
|
||||
def self.nfs_client_installed(machine)
|
||||
machine.communicate.test("pacman -Q nfs-utils")
|
||||
end
|
||||
|
||||
def self.nfs_pre(machine)
|
||||
comm = machine.communicate
|
||||
|
||||
# There is a bug in NFS where the rpcbind functionality is not started
|
||||
# and it's not a dependency of nfs-utils. Read more here:
|
||||
#
|
||||
# https://bbs.archlinux.org/viewtopic.php?id=193410
|
||||
#
|
||||
comm.sudo <<-EOH.gsub(/^ {12}/, "")
|
||||
set -e
|
||||
systemctl enable rpcbind
|
||||
systemctl start rpcbind
|
||||
EOH
|
||||
end
|
||||
|
||||
def self.nfs_client_install(machine)
|
||||
comm = machine.communicate
|
||||
comm.sudo <<-EOH.gsub(/^ {12}/, "")
|
||||
set -e
|
||||
pacman --noconfirm -Syy
|
||||
pacman --noconfirm -S nfs-utils ntp
|
||||
EOH
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -20,6 +20,21 @@ module VagrantPlugins
|
|||
require_relative "cap/configure_networks"
|
||||
Cap::ConfigureNetworks
|
||||
end
|
||||
|
||||
guest_capability(:arch, :nfs_client_install) do
|
||||
require_relative "cap/nfs"
|
||||
Cap::NFS
|
||||
end
|
||||
|
||||
guest_capability(:arch, :nfs_client_installed) do
|
||||
require_relative "cap/nfs"
|
||||
Cap::NFS
|
||||
end
|
||||
|
||||
guest_capability(:arch, :nfs_pre) do
|
||||
require_relative "cap/nfs"
|
||||
Cap::NFS
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -101,8 +101,16 @@ module VagrantPlugins
|
|||
end
|
||||
|
||||
# Mount them!
|
||||
machine.guest.capability(
|
||||
:mount_nfs_folder, nfsopts[:nfs_host_ip], mount_folders)
|
||||
if machine.guest.capability?(:nfs_pre)
|
||||
machine.guest.capability(:nfs_pre)
|
||||
end
|
||||
|
||||
machine.guest.capability(:mount_nfs_folder,
|
||||
nfsopts[:nfs_host_ip], mount_folders)
|
||||
|
||||
if machine.guest.capability?(:nfs_post)
|
||||
machine.guest.capability(:nfs_post)
|
||||
end
|
||||
end
|
||||
|
||||
def cleanup(machine, opts)
|
||||
|
|
Loading…
Reference in New Issue