Closed mre closed 10 years ago
When you vagrant ssh
to the built box, is Chef in /opt
? If it is, then you just need to set the PATH
inside the box (at runtime) before you try to invoke Chef.
There is no /opt
on the newly created machine (just tested with 9.2)
Where are you getting the box freebsd-64
from? You're sure it's the box you just built?
@juliandunn The box was newly built with the following command:
packer build -only=virtualbox-iso freebsd-9.2-amd64.json
Apart from the changes I mentioned above, I used the packer template which comes with bento. So the iso is http://ftp.freebsd.org/pub/FreeBSD/releases/amd64/amd64/ISO-IMAGES/9.2/FreeBSD-9.2-RELEASE-amd64-disc1.iso as specified in the template file.
Just checked it out again:
After building a fresh box box and using it with vagrant up
, I get the error mentioned before:
==> php: Running provisioner: chef_solo...
The chef binary (either `chef-solo` or `chef-client`) was not found on
the VM and is required for chef provisioning. Please verify that chef
is installed and that the binary is available on the PATH.
When I log into the machine with vagrant ssh
I can see the following folders in my root directory:
$ ls /
bin
boot
COPYRIGHT
dev
entropy
etc
home
lib
libexec
media
mnt
proc
rescue
root
sbin
sys
tmp
usr
vagrant
var
So, no /opt in here. :squirrel:
I really can't reproduce this. I just rebuilt the box using chef_version=latest
as a packer var, and it works fine. Can you follow the same steps as in my gist, and see if you still have the issue?
https://gist.github.com/juliandunn/794cf5f4a2f4e59fff26
I see this same issue using the box provided at VagrantCloud, although I'm using FreeBSD 10. https://vagrantcloud.com/chef/freebsd-10.0
@jramnani The box published on VagrantCloud does not have Chef installed by design. None of the boxes that we publish do.
Closing as I can't repro.
Here are the relevant settings in the packer template files (
freebsd-9.2-amd64.json
):When I run
I get the following output:
So until here everything looks fine. When I try to use the box with Vagrant, though, I get the following:
The same error also occurs when I try and run it with
freebsd-10.0-amd64.json
.If I specify the provisioner like this, everything works fine:
After building the box, I can use chef as normal with that setup. The thing is that I want to provision the machine with Chef when I start the machine
vagrant up
and not with Packer. This way I stay more flexible and can use the same base box for many different Vagrant setups.Did I overlook something?