I've been trying to test out some of my cookbooks using Vagrant. I've been able to set up my Vagrant box without a problem, but it's failing every time I try to provision (or do vagrant up with a cookbooks directory specified in the Vagrantfile).
For some reason it seems that it's trying to compile every cookbook in the directory (regardless of whether it's being used in the run list or not) and it's unhappy with my custom resources. Each of them are failing with the same error:
SyntaxError
-----------
compile error
/tmp/vagrant-chef-1/chef-solo-1/cookbooks/expect/resources/script.rb:5: syntax error, unexpected ':', expecting $end
attribute :script, kind_of: String, required: true
^
The custom resource it's complaining about in this example is:
actions :create
default_action :create
attribute :script, kind_of: String, required: true
The relevant part of my Vagrantfile is:
config.vm.provision :chef_solo do |chef|
chef.cookbooks_path = "/Users/0x783czar/Development/Work/Chef-Repos/chef2/cookbooks"
chef.roles_path = "/Users/0x783czar/Development/Work/Chef-Repos/chef2/roles"
chef.data_bags_path = "/Users/0x783czar/Development/Work/Chef-Repos/chef2/data_bags"
chef.add_recipe "build-essential"
chef.add_recipe "mongodb"
# You may also specify custom JSON attributes:
# chef.json = { :mysql_password => "foo" }
end
I've used this same cookbook & resource with Chef-Solo and not encountered any problems, so I'm rather confused. Both by why it's trying to compile a cookbook I'm not even using, as well as to why it's unable to compile the custom resources.
I'm using "Vagrant 1.0.5", on "Mac OS X 10.8", with "VirtualBox 4.2.4", and this Vagrant build is using "Chef-Solo 10.14.2"