Chef provisioner fails during vagrant up on AWS

475 views
Skip to first unread message

Jeff Sussna

unread,
Apr 15, 2013, 2:51:09 PM4/15/13
to vagra...@googlegroups.com
Using vagrant-aws to build AWS instances from generic Ubuntu AMI. Using Seth Chisamore's vagrant-omnibus plugin to install Chef during 'vagrant up'. The chef-solo run fails trying to 'chown vagrant /tmp/vagrant-chef-1' because there is no vagrant user. ssh_username is set to 'ubuntu' in the Vagrantfile.

Jeff Sussna

unread,
Apr 15, 2013, 5:40:27 PM4/15/13
to vagra...@googlegroups.com
Added the following to my Vagrantfile and get further:

   config.vm.provision :shell,
       :inline => "sudo useradd vagrant; sudo adduser vagrant sudo"

But now get a new error:

   Failed to upload a file to the guest VM via SCP due to a permissions
   error. This is normally because the user running Vagrant doesn't have
   read permission on the file. Please set proper permissions on the file:

   /tmp/vagrant20130415-4687-8wl5cp

Teemu Matilainen

unread,
Apr 16, 2013, 9:35:54 AM4/16/13
to vagra...@googlegroups.com
Hi Jeff,
With Vagrant 1.1 you have to set also `config.ssh.username` (outside
the provider block) to match the `aws.ssh_username`. In the (near?)
future Vagrant 1.2 you can use something like this:

config.vm.provider :aws do |aws, override|
override.ssh.username = "ubuntu"
end

See https://github.com/mitchellh/vagrant-aws/issues/2 for more information.

--
Teemu

Jeff Sussna

unread,
Apr 16, 2013, 9:54:53 AM4/16/13
to vagra...@googlegroups.com
Worked. Thanks!
Reply all
Reply to author
Forward
0 new messages