我一直在遵循几个指南并阅读文档试图knife-solo
为我配置一台虚拟机。
Knife solo 可以与 Berkshelf(用于管理厨师食谱库)配合使用,因此我也在使用它。
我可以成功地prepare
使用虚拟机knife solo prepare [email protected]
但是当我运行的时候,chef-solo 尝试编译菜谱时就出现了错误:knife solo cook [email protected] nodes/192.168.10.10.json
bundle exec knife solo cook [email protected]
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.
我搜索特定的错误信息“未找到食谱网站”却没有找到任何内容。
登录虚拟机后,我看到确实有一个chef-solo
文件夹,其中有一个solo.rb
文件包含以下内容:
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
这些食谱路径都存在,并且食谱确实已被复制到那里。
我究竟做错了什么?