Skip to content

Commit

Permalink
Add CentOS guest support for compatibility with Vagrant v2.2.8+
Browse files Browse the repository at this point in the history
  • Loading branch information
ajxb committed May 14, 2020
1 parent 9fcb721 commit eb6446f
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
35 changes: 35 additions & 0 deletions lib/vagrant-sshfs/cap/guest/centos/sshfs_client.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
module VagrantPlugins
module GuestCentos
module Cap
class SSHFSClient
def self.sshfs_install(machine)

case machine.guest.capability("flavor")
when :centos_8
machine.communicate.sudo("yum -y install --enablerepo=PowerTools fuse-sshfs")
when :centos_7, :centos
if !epel_installed(machine)
epel_install(machine)
end
machine.communicate.sudo("yum -y install fuse-sshfs")
end
end

def self.sshfs_installed(machine)
machine.communicate.test("rpm -q fuse-sshfs")
end

protected

def self.epel_installed(machine)
machine.communicate.test("rpm -q epel-release")
end

def self.epel_install(machine)
machine.communicate.sudo("yum -y install epel-release")
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 @@ -97,6 +97,16 @@ class Plugin < Vagrant.plugin("2")
VagrantPlugins::GuestRedHat::Cap::SSHFSClient
end

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

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

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

0 comments on commit eb6446f

Please sign in to comment.