Skip to content

Commit

Permalink
guest: handle Alma/Rocky until fixes land upstream
Browse files Browse the repository at this point in the history
We should be able to drop these blocks when [1] merges upstream and
is in a release.

[1] hashicorp/vagrant#12785
  • Loading branch information
dustymabe committed Jun 20, 2022
1 parent e90bbdb commit e76db4d
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
13 changes: 13 additions & 0 deletions lib/vagrant-sshfs/cap/guest/centos/sshfs_client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,19 @@ module Cap
class SSHFSClient
def self.sshfs_install(machine)

# Until a newer version of Vagrant ships with https://github.com/hashicorp/vagrant/pull/12785
# we need to handle the case where Alma or Rocky end up here
if machine.communicate.test("grep 'VERSION_ID=\"8' /etc/os-release")
machine.communicate.sudo("yum -y install --enablerepo=powertools fuse-sshfs")
return
elsif machine.communicate.test("grep 'VERSION_ID=\"9' /etc/os-release")
if !epel_installed(machine)
epel_install(machine)
end
machine.communicate.sudo("yum -y install fuse-sshfs")
return
end

case machine.guest.capability("flavor")
when :centos_8
# No need to install epel. fuse-sshfs comes from the powertools repo
Expand Down
8 changes: 7 additions & 1 deletion lib/vagrant-sshfs/cap/guest/redhat/sshfs_client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,13 @@ def self.epel_install(machine)
when :rhel_7
machine.communicate.sudo("rpm -ivh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm")
when :rhel # rhel6
machine.communicate.sudo("rpm -ivh https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm")
# Until a newer version of Vagrant ships with https://github.com/hashicorp/vagrant/pull/12785
# we need to handle the case where Alma 9 and RHEL 9 end up here.
if machine.communicate.test("grep 'VERSION_ID=\"9' /etc/os-release")
machine.communicate.sudo("rpm -ivh https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm")
else
machine.communicate.sudo("rpm -ivh https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm")
end
end
end
end
Expand Down

0 comments on commit e76db4d

Please sign in to comment.