Prevent apt cacher bucket from being installed in case NFS is disabled
This commit is contained in:
parent
f38db9efc4
commit
e0eeb125d0
2 changed files with 15 additions and 8 deletions
|
@ -12,6 +12,7 @@ module VagrantPlugins
|
|||
guest = machine.guest
|
||||
|
||||
if guest.capability?(:apt_cacher_dir)
|
||||
if machine.config.cache.enable_nfs
|
||||
guest_path = guest.capability(:apt_cacher_dir)
|
||||
|
||||
@env[:cache_dirs] << guest_path
|
||||
|
@ -24,6 +25,9 @@ module VagrantPlugins
|
|||
comm.sudo("ln -s /tmp/vagrant-cache/#{@name} #{guest_path}")
|
||||
end
|
||||
end
|
||||
else
|
||||
@env[:ui].info I18n.t('vagrant_cachier.nfs_required', bucket: 'apt-cacher')
|
||||
end
|
||||
else
|
||||
@env[:ui].info I18n.t('vagrant_cachier.skipping_bucket', bucket: 'apt-cacher')
|
||||
end
|
||||
|
|
|
@ -6,6 +6,9 @@ en:
|
|||
Skipping %{bucket} cache bucket as the guest machine does not support it
|
||||
unknown_cache_scope: |-
|
||||
Unknown cache scope '%{cache_scope}' (allowed scopes: %{allowed})
|
||||
nfs_required: |-
|
||||
The '%{bucket}' cache bucket requires NFS to be enabled, please add
|
||||
`config.cache.enable_nfs = true` to your Vagrantfile.
|
||||
will_fix_machine_cache_dir: |-
|
||||
A vagrant-cachier provider specific cache dir was found under
|
||||
'%{current_path}' and it will be moved to
|
||||
|
|
Loading…
Reference in a new issue