mitchellh/vagrant — Issue #748: chef re-provision
Author: jjhuff
Created: 2012-02-17 23:43:07+00:00
State: open

I'm debugging some issues with a chef provider, which means that I end up running provision multiple times on a vm.

The second time I provision, it fails with:
[default] Running provisioner: Vagrant::Provisioners::ChefClient...
[default] Creating folder to hold client key...
[default] Uploading chef client validation key...
[default] Generating chef JSON and uploading...
/usr/lib/ruby/gems/1.8/gems/net-scp-1.0.4/lib/net/scp.rb:385:in `await_response_state': scp: /etc/chef/client.rb: Permission denied (RuntimeError)
from /usr/lib/ruby/gems/1.8/gems/net-scp-1.0.4/lib/net/scp.rb:356:in `send'
from /usr/lib/ruby/gems/1.8/gems/net-scp-1.0.4/lib/net/scp.rb:356:in `start_command'
from /usr/lib/ruby/gems/1.8/gems/net-ssh-2.2.2/lib/net/ssh/connection/channel.rb:311:in `call'

It seems that `/etc/chef/client.rb` is owned by root.
sshing in and running `sudo rm /etc/chef/client.rb` allows me to reprovision.