class VagrantPlugins::Cachier::Bucket::AptCacher

Public Class Methods

capability() click to toggle source
# File lib/vagrant-cachier/bucket/apt_cacher.rb, line 7
def self.capability
  :apt_cacher_dir
end

Public Instance Methods

install() click to toggle source
# File lib/vagrant-cachier/bucket/apt_cacher.rb, line 11
def install
  if guest.capability?(:apt_cacher_dir)
    if guest_path = guest.capability(:apt_cacher_dir)
      synced_folder_type = (machine.config.cache.synced_folder_opts || {})[:type]
      if synced_folder_type && synced_folder_type.to_sym == :nfs
        symlink(guest_path)
      else
        @env[:ui].warn I18n.t('vagrant_cachier.nfs_required', bucket: 'apt-cacher')
      end
    end
  else
    @env[:ui].info I18n.t('vagrant_cachier.skipping_bucket', bucket: 'apt-cacher')
  end
end