Run chef provisioners with "-E" flag on sudo so PATH is preserved on CentOS [closes GH-133]
This commit is contained in:
parent
bb58c9ef96
commit
1cbc931a6d
|
@ -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]
|
||||
|
|
|
@ -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|
|
||||
|
|
|
@ -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|
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue