diff --git a/lib/vagrant-sshfs/cap/guest/centos/sshfs_client.rb b/lib/vagrant-sshfs/cap/guest/centos/sshfs_client.rb index 49a8ac8..0ae1914 100644 --- a/lib/vagrant-sshfs/cap/guest/centos/sshfs_client.rb +++ b/lib/vagrant-sshfs/cap/guest/centos/sshfs_client.rb @@ -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) diff --git a/lib/vagrant-sshfs/cap/guest/redhat/sshfs_client.rb b/lib/vagrant-sshfs/cap/guest/redhat/sshfs_client.rb index 4d75f60..e23aec2 100644 --- a/lib/vagrant-sshfs/cap/guest/redhat/sshfs_client.rb +++ b/lib/vagrant-sshfs/cap/guest/redhat/sshfs_client.rb @@ -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) @@ -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 diff --git a/lib/vagrant-sshfs/cap/guest/rocky/sshfs_client.rb b/lib/vagrant-sshfs/cap/guest/rocky/sshfs_client.rb index ca49377..d8973d7 100644 --- a/lib/vagrant-sshfs/cap/guest/rocky/sshfs_client.rb +++ b/lib/vagrant-sshfs/cap/guest/rocky/sshfs_client.rb @@ -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