diff --git a/lib/vagrant-sshfs/cap/guest/centos/sshfs_client.rb b/lib/vagrant-sshfs/cap/guest/centos/sshfs_client.rb index 0ae1914..6e708a6 100644 --- a/lib/vagrant-sshfs/cap/guest/centos/sshfs_client.rb +++ b/lib/vagrant-sshfs/cap/guest/centos/sshfs_client.rb @@ -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 diff --git a/lib/vagrant-sshfs/cap/guest/redhat/sshfs_client.rb b/lib/vagrant-sshfs/cap/guest/redhat/sshfs_client.rb index e23aec2..425f1ca 100644 --- a/lib/vagrant-sshfs/cap/guest/redhat/sshfs_client.rb +++ b/lib/vagrant-sshfs/cap/guest/redhat/sshfs_client.rb @@ -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