Skip to content

Commit

Permalink
guest: Enterprise Linux 9 has landed
Browse files Browse the repository at this point in the history
This should update CentOS/Rocky/Red Hat Guest types to work with EL9.
  • Loading branch information
dustymabe committed Jun 10, 2022
1 parent c125ce8 commit 00f5737
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lib/vagrant-sshfs/cap/guest/centos/sshfs_client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def self.sshfs_install(machine)
# https://bugzilla.redhat.com/show_bug.cgi?id=1758884
# https://github.com/dustymabe/vagrant-sshfs/issues/123
machine.communicate.sudo("yum -y install --enablerepo=powertools fuse-sshfs")
when :centos_7, :centos # centos7 and centos6
when :centos_9, :centos_7, :centos # centos{9,7,6}
# Install fuse-sshfs from epel
if !epel_installed(machine)
epel_install(machine)
Expand Down
4 changes: 3 additions & 1 deletion lib/vagrant-sshfs/cap/guest/redhat/sshfs_client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def self.sshfs_install(machine)
# 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
when :rhel_9, :rhel_7, :rhel # rhel{9,7,6}
# Install fuse-sshfs from epel
if !epel_installed(machine)
epel_install(machine)
Expand All @@ -35,6 +35,8 @@ def self.epel_installed(machine)

def self.epel_install(machine)
case machine.guest.capability("flavor")
when :rhel_9
machine.communicate.sudo("rpm -ivh https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm")
when :rhel_7
machine.communicate.sudo("rpm -ivh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm")
when :rhel # rhel6
Expand Down
28 changes: 24 additions & 4 deletions lib/vagrant-sshfs/cap/guest/rocky/sshfs_client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,36 @@ module GuestRocky
module Cap
class SSHFSClient
def self.sshfs_install(machine)
# No need to install epel. fuse-sshfs comes from the powertools repo
# https://bugzilla.redhat.com/show_bug.cgi?id=1758884
# https://github.com/dustymabe/vagrant-sshfs/issues/123
machine.communicate.sudo("yum -y install --enablerepo=powertools fuse-sshfs")

case machine.guest.capability("flavor")
when :rocky_8
# No need to install epel. fuse-sshfs comes from the powertools repo
# https://bugzilla.redhat.com/show_bug.cgi?id=1758884
# https://github.com/dustymabe/vagrant-sshfs/issues/123
machine.communicate.sudo("yum -y install --enablerepo=powertools fuse-sshfs")
when :rocky_9, :rocky # rocky9 or unknown
# 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)
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
Expand Down

0 comments on commit 00f5737

Please sign in to comment.