Skip to content

Commit

Permalink
Merge pull request #105 from timschumi/patch/alpine-support
Browse files Browse the repository at this point in the history
Add sshfs installation support for alpine guests
  • Loading branch information
dustymabe authored Dec 11, 2019
2 parents b93ffd0 + 7e6ba5e commit bd9c857
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
20 changes: 20 additions & 0 deletions lib/vagrant-sshfs/cap/guest/alpine/sshfs_client.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
module VagrantPlugins
module GuestAlpine
module Cap
class SSHFSClient
def self.sshfs_install(machine)
# Install sshfs
machine.communicate.sudo("apk add sshfs")

# Load the fuse module and autoload it in the feature
machine.communicate.sudo("modprobe fuse")
machine.communicate.sudo("echo fuse >> /etc/modules")
end

def self.sshfs_installed(machine)
machine.communicate.test("apk -e info sshfs")
end
end
end
end
end
10 changes: 10 additions & 0 deletions lib/vagrant-sshfs/plugin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,16 @@ class Plugin < Vagrant.plugin("2")
VagrantPlugins::GuestArch::Cap::SSHFSClient
end

guest_capability("alpine", "sshfs_installed") do
require_relative "cap/guest/alpine/sshfs_client"
VagrantPlugins::GuestAlpine::Cap::SSHFSClient
end

guest_capability("alpine", "sshfs_install") do
require_relative "cap/guest/alpine/sshfs_client"
VagrantPlugins::GuestAlpine::Cap::SSHFSClient
end

guest_capability("suse", "sshfs_installed") do
require_relative "cap/guest/suse/sshfs_client"
VagrantPlugins::GuestSUSE::Cap::SSHFSClient
Expand Down

0 comments on commit bd9c857

Please sign in to comment.