Skip to content

Commit

Permalink
guest: redhat: add best-effort support for RHEL8
Browse files Browse the repository at this point in the history
There's really no good way to deal with where to get SSHFS from for
RHEL8 so just use EPEL7 in a oneshot command for now since the
fuse-sshfs from EPEL7 seems to work.
  • Loading branch information
dustymabe committed Jun 29, 2020
1 parent f4408e3 commit 04235d9
Showing 1 changed file with 17 additions and 6 deletions.
23 changes: 17 additions & 6 deletions lib/vagrant-sshfs/cap/guest/redhat/sshfs_client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,24 @@ module GuestRedHat
module Cap
class SSHFSClient
def self.sshfs_install(machine)
# Install epel rpm if not installed
if !epel_installed(machine)
epel_install(machine)
end

# Install sshfs (comes from epel repos)
machine.communicate.sudo("yum -y install fuse-sshfs")
case machine.guest.capability("flavor")
when :rhel_8
# fuse-sshfs isn't in EPEL8 and how to get it from RHEL repos
# without having to have the system subscribed is unclear:
# https://github.com/dustymabe/vagrant-sshfs/issues/108#issuecomment-601061947
# Using fuse-sshfs from EPEL7 works for now so let's just go with it.
# Do the install in such a way that the epel7 repo doesn't hang around
# on the system, which may have unintended consequences on RHEL8.
machine.communicate.sudo("rpm --import https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-7")
machine.communicate.sudo("yum -y install fuse-sshfs --repofrompath=epel7,'http://download.fedoraproject.org/pub/epel/7/$basearch'")
when :rhel_7, :rhel # rhel7 and rhel6
# Install fuse-sshfs from epel
if !epel_installed(machine)
epel_install(machine)
end
machine.communicate.sudo("yum -y install fuse-sshfs")
end
end

def self.sshfs_installed(machine)
Expand Down

0 comments on commit 04235d9

Please sign in to comment.