lib/vagrant/provisioners/chef.rb in vagrantup-0.7.4 vs lib/vagrant/provisioners/chef.rb in vagrantup-0.7.5
- old
+ new
@@ -14,10 +14,17 @@
# doesn't exist.
ssh.sudo!("which #{binary}", :error_class => ChefError, :_key => :chef_not_detected, :binary => binary)
end
end
+ # Returns the path to the Chef binary, taking into account the
+ # `binary_path` configuration option.
+ def chef_binary_path(binary)
+ return binary if !config.binary_path
+ return File.join(config.binary_path, binary)
+ end
+
def chown_provisioning_folder
vm.ssh.execute do |ssh|
ssh.sudo!("mkdir -p #{config.provisioning_path}")
ssh.sudo!("chown #{env.config.ssh.username} #{config.provisioning_path}")
end
@@ -79,10 +86,12 @@
attr_accessor :http_proxy_pass
attr_accessor :https_proxy
attr_accessor :https_proxy_user
attr_accessor :https_proxy_pass
attr_accessor :no_proxy
+ attr_accessor :binary_path
+ attr_accessor :binary_env
def initialize
@provisioning_path = "/tmp/vagrant-chef"
@log_level = :info
@json = { :instance_role => "vagrant" }
@@ -91,9 +100,11 @@
@http_proxy_pass = nil
@https_proxy = nil
@https_proxy_user = nil
@https_proxy_pass = nil
@no_proxy = nil
+ @binary_path = nil
+ @binary_env = nil
end
# Returns the run list for the provisioning
def run_list
json[:run_list] ||= []