I've been following several guides and read thru documentation trying to get knife-solo
to provision a VM for me.
Knife solo will work with Berkshelf (used to manage a library of chef cookbooks), so I'm using that as well.
I can successfully prepare
a VM using knife solo prepare vagrant@192.168.10.10
But when I go to then run knife solo cook vagrant@192.168.10.10 nodes/192.168.10.10.json
, I get an error as soon as chef-solo tries to compile the cookbooks:
bundle exec knife solo cook vagrant@192.168.10.10
Running Chef on 192.168.10.10...
Checking Chef version...
Installing Berkshelf cookbooks to 'cookbooks'...
DEPRECATED: Your Berksfile contains a site location pointing to the Opscode Community Site (site :opscode). Site locations have been replaced by the source location. Change this to: 'source "https://supermarket.chef.io"' to remove this warning. For more information visit https://github.com/berkshelf/berkshelf/wiki/deprecated-locations
Resolving cookbook dependencies...
Using apache2 (1.10.4)
Using apt (2.4.0)
Using build-essential (2.0.2)
Using chef_handler (1.1.6)
Using hostname (0.3.0)
Using hostsfile (2.4.5)
Using iis (4.1.0)
Using iptables (0.13.2)
Using logrotate (1.5.0)
Using mysql (5.2.10)
Using openssl (1.1.0)
Using pacman (1.1.1)
Using php (1.4.6)
Using windows (1.36.6)
Using xml (1.2.4)
Using yum-epel (0.6.0)
Using yum (3.5.3)
Vendoring apache2 (1.10.4) to cookbooks/apache2
Vendoring apt (2.4.0) to cookbooks/apt
Vendoring build-essential (2.0.2) to cookbooks/build-essential
Vendoring chef_handler (1.1.6) to cookbooks/chef_handler
Vendoring hostname (0.3.0) to cookbooks/hostname
Vendoring hostsfile (2.4.5) to cookbooks/hostsfile
Vendoring iis (4.1.0) to cookbooks/iis
Vendoring iptables (0.13.2) to cookbooks/iptables
Vendoring logrotate (1.5.0) to cookbooks/logrotate
Vendoring mysql (5.2.10) to cookbooks/mysql
Vendoring openssl (1.1.0) to cookbooks/openssl
Vendoring pacman (1.1.1) to cookbooks/pacman
Vendoring php (1.4.6) to cookbooks/php
Vendoring windows (1.36.6) to cookbooks/windows
Vendoring xml (1.2.4) to cookbooks/xml
Vendoring yum (3.5.3) to cookbooks/yum
Vendoring yum-epel (0.6.0) to cookbooks/yum-epel
Uploading the kitchen...
Generating solo config...
Running Chef...
Starting Chef Client, version 12.1.1
Compiling Cookbooks...
Running handlers:
[2015-04-04T21:30:47+00:00] ERROR: Running exception handlers
Running handlers complete
[2015-04-04T21:30:47+00:00] ERROR: Exception handlers complete
[2015-04-04T21:30:47+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
Chef Client failed. 0 resources updated in 1.73601623 seconds
[2015-04-04T21:30:47+00:00] ERROR: Cookbook website not found. If you're loading website from another cookbook, make sure you configure the dependency in your metadata
[2015-04-04T21:30:47+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
ERROR: RuntimeError: chef-solo failed. See output above.
I could not find anything by searching for that specific error message "Cookbook website not found".
Logging into the VM, I see that there is indeed a chef-solo
folder, and within it there is a solo.rb
file containing:
node_name "192.168.10.10"
base = File.expand_path('..', __FILE__)
nodes_path File.join(base, 'nodes')
role_path File.join(base, 'roles')
data_bag_path File.join(base, 'data_bags')
encrypted_data_bag_secret File.join(base, 'data_bag_key')
environment_path File.join(base, 'environments')
environment "_default"
ssl_verify_mode :verify_peer
cookbook_path []
cookbook_path << File.join(base, 'cookbooks-1') # /Users/bkosborne/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/knife-solo-0.4.2/lib/knife-solo/resources/patch_cookbooks
cookbook_path << File.join(base, 'cookbooks-2') # /Users/bkosborne/websitevm/cookbooks
cookbook_path << File.join(base, 'cookbooks-3') # /Users/bkosborne/websitevm/site-cookbooks
Those cookbook paths all exist and the cookbooks have indeed been copied there.
What am I doing wrong?