我已经在入门中将工作站配置为this step(操作系统redhat 6.5).我已经启动了一个节点.我像这样修改了食谱:
myCookbook / metadata.rb
name 'myCookbook'
maintainer 'YOUR_COMPANY_NAME'
maintainer_email 'YOUR_EMAIL'
license 'All rights reserved'
description 'Installs/Configures myCookbook'
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version '0.1.0'
depends 'maven'
例如.在执行刀库创建myCookbook之后仅添加了’maven’字符串.
myCookbook /食谱/ default.rb
maven 'spring-context' do
group_id 'org.springframework'
version '4.0.4.RELEASE'
dest '/root/chef-repo/'
repositories ['http://repo.maven.apache.org/maven2/']
end
然后我运行:
knife cookbook upload myCookbook
现在我正在尝试:
knife bootstrap 192.168.1.37 --ssh-user root --ssh-password '123456' --sudo --use-sudo-password --node-name node-with-maven-run --run-list 'recipe[myCookbook]'
得到:
ERROR: Cookbook myCookbook depends on cookbooks which are not currently
ERROR: being uploaded and cannot be found on the server.
ERROR: The missing cookbook(s) are: 'maven' version '>= 0.0.0'
如何将所有食谱从mtCookbook安装到厨师服务器?
解决方法:
或只输入刀谱下载–help,它就会向您显示以下行(以及其他内容):
–include-dependencies还上传食谱依赖关系
因此,刀食谱上传myCookbook –include-dependencies是您的答案
您还需要在工作站上安装Maven菜谱,通过刀子菜谱网站安装Maven或任何其他方式在本地cookbook_path中包含一个名为maven的目录,其中包含一个菜谱,其中metatada.rb文件作为值为maven的键名