如何在厨师中运行具有依赖性的食谱? [英] How run cookbook with dependencies in chef?
问题描述
我已将工作站配置为此步骤在入门(OS redhat 6.5)。我已经启动了一个节点。我修改了这样的食谱:
I have configured workstation up this step in get started (OS redhat 6.5). I have launched a node. I modified a cookbook like that:
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'
例如只有取决于'maven'
字符串是在刀具食谱创建myCookbook
被执行后添加的。
E.g. only depends 'maven'
string was added after knife cookbook create myCookbook
was executed.
myCookbook / recipes / 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安装所有cookbook到厨师服务器取决于?
How install all cookbook to chef server from that mtCookbook depends?
推荐答案
或者只需输入刀cookbook upload --help
它会显示以下行(和其他行):
Or just type knife cookbook upload --help
and it will show you the following line (along others):
- 包括 - 依赖项还上传cookbook依赖项
所以刀库菜单上传myCookbook --include-dependencies
是您的回答
您还需要在工作站上安装 maven
食谱, knife cookbook site安装maven
或在本地 cookbook_path中以任何其他方式获得名为
包含一个食谱,其中 maven
的目录 metatada.rb
文件作为键名称
与v alue maven
You'll need to have the maven
cookbook on your workstation too, by knife cookbook site install maven
or any other way to have a directory called maven
in your local cookbook_path
containing a cookbook where the metatada.rb
file as a key name
with value maven
这篇关于如何在厨师中运行具有依赖性的食谱?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!