Run chef provisioners with "-E" flag on sudo so PATH is preserved on CentOS [closes GH-133]

This commit is contained in:
Mitchell Hashimoto 2010-08-03 09:14:35 -07:00
parent bb58c9ef96
commit 1cbc931a6d
5 changed files with 6 additions and 4 deletions

View File

@ -1,5 +1,7 @@
## 0.5.2 (unreleased)
- Sudo uses "-E" flag to preserve environment for chef provisioners.
This fixes issues with CentOS. [GH-133]
- Added "IdentitiesOnly yes" to options when `vagrant ssh` is run to
avoid "Too Many Authentication Failures" error. [GH-131]
- Fix regression with `package` not working. [GH-132]

View File

@ -48,7 +48,7 @@ module Vagrant
end
def run_chef_client
command = "cd #{env.config.chef.provisioning_path} && sudo chef-client -c client.rb -j dna.json"
command = "cd #{env.config.chef.provisioning_path} && sudo -E chef-client -c client.rb -j dna.json"
logger.info "Running chef-client..."
vm.ssh.execute do |ssh|

View File

@ -38,7 +38,7 @@ module Vagrant
end
def run_chef_solo
command = "cd #{env.config.chef.provisioning_path} && sudo chef-solo -c solo.rb -j dna.json"
command = "cd #{env.config.chef.provisioning_path} && sudo -E chef-solo -c solo.rb -j dna.json"
logger.info "Running chef-solo..."
vm.ssh.execute do |ssh|

View File

@ -169,7 +169,7 @@ class ChefServerProvisionerTest < Test::Unit::TestCase
end
should "cd into the provisioning directory and run chef client" do
@ssh.expects(:exec!).with("cd #{@env.config.chef.provisioning_path} && sudo chef-client -c client.rb -j dna.json").once
@ssh.expects(:exec!).with("cd #{@env.config.chef.provisioning_path} && sudo -E chef-client -c client.rb -j dna.json").once
@action.run_chef_client
end

View File

@ -184,7 +184,7 @@ class ChefSoloProvisionerTest < Test::Unit::TestCase
end
should "cd into the provisioning directory and run chef solo" do
@ssh.expects(:exec!).with("cd #{@env.config.chef.provisioning_path} && sudo chef-solo -c solo.rb -j dna.json").once
@ssh.expects(:exec!).with("cd #{@env.config.chef.provisioning_path} && sudo -E chef-solo -c solo.rb -j dna.json").once
@action.run_chef_solo
end