chmod /tmp/vagrant-cache on guest VM to 777 to work around some permission issues as explained on GH-74

This commit is contained in:
Fabio Rehm 2014-02-11 23:53:07 -02:00
parent e793dff891
commit 6282b09c6c
2 changed files with 9 additions and 2 deletions

View file

@ -4,17 +4,24 @@ module VagrantPlugins
module Cachier module Cachier
class Action class Action
class InstallBuckets class InstallBuckets
def initialize(app, env) def initialize(app, env, opts = {})
@app = app @app = app
@logger = Log4r::Logger.new("vagrant::cachier::action::clean") @logger = Log4r::Logger.new("vagrant::cachier::action::clean")
@opts = opts
end end
def call(env) def call(env)
@app.call(env) @app.call(env)
chmod_bucket_root(env[:machine]) if @opts[:chmod]
configure_cache_buckets(env) configure_cache_buckets(env)
end end
def chmod_bucket_root(machine)
@logger.info "'chmod'ing bucket root dir to 777..."
machine.communicate.sudo 'chmod 777 /tmp/vagrant-cache'
end
def configure_cache_buckets(env) def configure_cache_buckets(env)
return unless env[:machine].config.cache.enabled? return unless env[:machine].config.cache.enabled?

View file

@ -7,7 +7,7 @@ module VagrantPlugins
hook.before Vagrant::Action::Builtin::Provision, Action::ConfigureBucketRoot hook.before Vagrant::Action::Builtin::Provision, Action::ConfigureBucketRoot
# This will do the initial buckets installation # This will do the initial buckets installation
hook.after Vagrant::Action::Builtin::Provision, Action::InstallBuckets hook.after Vagrant::Action::Builtin::Provision, Action::InstallBuckets, chmod: true
end end
# This ensure buckets are reconfigured after provisioners runs # This ensure buckets are reconfigured after provisioners runs