Sha256: 2c32d930195736f3d73810fdbe8fee26cff5713d1f93ceeccd856055a43cbbe7

Contents?: true

Size: 882 Bytes

Versions: 42

Compression:

Stored size: 882 Bytes

Contents

module VagrantPlugins
  module GuestSmartos
    module Cap
      class MountNFS
        def self.mount_nfs_folder(machine, ip, folders)
          sudo = machine.config.smartos.suexec_cmd

          folders.each do |name, opts|
            machine.communicate.tap do |comm|
              nfsDescription = "#{ip}:#{opts[:hostpath]}:#{opts[:guestpath]}"

              comm.execute <<-EOH.sub(/^ */, '')
                if [ -d /usbkey ] && [ "$(zonename)" == "global" ] ; then
                  #{sudo} mkdir -p /usbkey/config.inc
                  printf '#{nfsDescription}\\n' | #{sudo} tee -a /usbkey/config.inc/nfs_mounts
                fi

                #{sudo} mkdir -p #{opts[:guestpath]}
                #{sudo} /usr/sbin/mount -F nfs '#{ip}:#{opts[:hostpath]}' '#{opts[:guestpath]}'
              EOH
            end
          end
        end
      end
    end
  end
end

Version data entries

42 entries across 38 versions & 5 rubygems

Version Path
vagrant-unbundled-2.3.6.0 plugins/guests/smartos/cap/mount_nfs.rb
tamtam-vagrant-reload-1.2.1 vendor/cache/vagrant-2092df529ae7/plugins/guests/smartos/cap/mount_nfs.rb
vagrant-unbundled-2.3.3.0 plugins/guests/smartos/cap/mount_nfs.rb
vagrant-unbundled-2.3.2.0 plugins/guests/smartos/cap/mount_nfs.rb
vagrant-unbundled-2.2.19.0 plugins/guests/smartos/cap/mount_nfs.rb
vagrant-unbundled-2.2.18.0 plugins/guests/smartos/cap/mount_nfs.rb
vagrant-unbundled-2.2.16.0 plugins/guests/smartos/cap/mount_nfs.rb
vagrant-unbundled-2.2.14.0 plugins/guests/smartos/cap/mount_nfs.rb
vagrant-aws-mkubenka-0.7.2.pre.24 vendor/bundle/ruby/2.7.0/bundler/gems/vagrant-22795b161bf6/plugins/guests/smartos/cap/mount_nfs.rb
vagrant-unbundled-2.2.10.0 plugins/guests/smartos/cap/mount_nfs.rb
vagrant-unbundled-2.2.9.0 plugins/guests/smartos/cap/mount_nfs.rb
vagrant-unbundled-2.2.8.0 plugins/guests/smartos/cap/mount_nfs.rb
vagrant-unbundled-2.2.7.0 plugins/guests/smartos/cap/mount_nfs.rb
vagrant-unbundled-2.2.6.2 plugins/guests/smartos/cap/mount_nfs.rb
vagrant-unbundled-2.2.6.1 plugins/guests/smartos/cap/mount_nfs.rb
vagrant-unbundled-2.2.6.0 plugins/guests/smartos/cap/mount_nfs.rb
vagrant-unbundled-2.2.5.0 plugins/guests/smartos/cap/mount_nfs.rb
vagrant-unbundled-2.2.4.0 plugins/guests/smartos/cap/mount_nfs.rb
vagrant-unbundled-2.2.3.0 plugins/guests/smartos/cap/mount_nfs.rb
vagrant-unbundled-2.2.2.0 plugins/guests/smartos/cap/mount_nfs.rb