From 7e6ba5e1416b96f077db85f36bf1181f0877f402 Mon Sep 17 00:00:00 2001 From: Tim Schumacher Date: Fri, 12 Jul 2019 19:21:49 +0200 Subject: [PATCH] guest: Add alpine support --- .../cap/guest/alpine/sshfs_client.rb | 20 +++++++++++++++++++ lib/vagrant-sshfs/plugin.rb | 10 ++++++++++ 2 files changed, 30 insertions(+) create mode 100644 lib/vagrant-sshfs/cap/guest/alpine/sshfs_client.rb diff --git a/lib/vagrant-sshfs/cap/guest/alpine/sshfs_client.rb b/lib/vagrant-sshfs/cap/guest/alpine/sshfs_client.rb new file mode 100644 index 0000000..227ab9f --- /dev/null +++ b/lib/vagrant-sshfs/cap/guest/alpine/sshfs_client.rb @@ -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 diff --git a/lib/vagrant-sshfs/plugin.rb b/lib/vagrant-sshfs/plugin.rb index e8590ce..69abc04 100644 --- a/lib/vagrant-sshfs/plugin.rb +++ b/lib/vagrant-sshfs/plugin.rb @@ -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