Module: VagrantBindfs::Vagrant::Capabilities::RedHat::Bindfs

Defined in:
lib/vagrant-bindfs/vagrant/capabilities/redhat/bindfs.rb

Overview

:nodoc:

Class Method Summary collapse

Class Method Details

.bindfs_bindfs_install(machine) ⇒ Object



14
15
16
17
# File 'lib/vagrant-bindfs/vagrant/capabilities/redhat/bindfs.rb', line 14

def bindfs_bindfs_install(machine)
  machine.guest.capability(:bindfs_package_manager_update)
  machine.communicate.sudo('yum -y install bindfs')
end

.bindfs_bindfs_install_compilation_requirements(machine) ⇒ Object



37
38
39
# File 'lib/vagrant-bindfs/vagrant/capabilities/redhat/bindfs.rb', line 37

def bindfs_bindfs_install_compilation_requirements(machine)
  machine.communicate.sudo('yum -y install make automake gcc gcc-c++ kernel-devel wget tar fuse3-devel')
end

.bindfs_bindfs_install_version(machine, version) ⇒ Object



31
32
33
34
35
# File 'lib/vagrant-bindfs/vagrant/capabilities/redhat/bindfs.rb', line 31

def bindfs_bindfs_install_version(machine, version)
  machine.guest.capability(:bindfs_package_manager_update)
  package_name = machine.guest.capability(:bindfs_bindfs_search_version, version)
  machine.communicate.sudo("yum -y install #{package_name.shellescape}")
end

.bindfs_bindfs_search(machine) ⇒ Object



9
10
11
12
# File 'lib/vagrant-bindfs/vagrant/capabilities/redhat/bindfs.rb', line 9

def bindfs_bindfs_search(machine)
  machine.guest.capability(:bindfs_package_manager_update)
  machine.communicate.test("[[ $(yum search bindfs 2>/dev/null | egrep -i '^bindfs.' | wc -l) != 0 ]]")
end

.bindfs_bindfs_search_version(machine, version) ⇒ Object



19
20
21
22
23
24
25
26
27
28
29
# File 'lib/vagrant-bindfs/vagrant/capabilities/redhat/bindfs.rb', line 19

def bindfs_bindfs_search_version(machine, version)
  machine.guest.capability(:bindfs_package_manager_update)
  machine.communicate.tap do |comm|
    comm.sudo('yum -y install yum-utils')
    comm.execute("repoquery --show-duplicates bindfs-#{version}*  2>/dev/null | head -n1") do |_, output|
      package_name = output.strip
      return package_name unless package_name.empty?
    end
  end
  false
end