【发布时间】:2017-07-21 11:14:21
【问题描述】:
在测试厨房中搜索没有输出
投掷错误检查配方并建议我一些细节
节点 JSON 文件
{
"id": "cldb",
"chef_type": "node",
"json_class": "Chef::Node",
"run_list": [],
"automatic": {
"hostname": "cldb.net",
"fqdn":"127.0.0.1",
"name": "cldb.net",
"ipaddress": "127.0.0.1",
"roles": [],
"cldb" : true
}
}
食谱
cldbNodes = search(:node, "cldb:true")
cldb = "#{cldbNodes["fqdn"]}"
file '/tmp/test.txt' do
content "#{cldb}"
end
【问题讨论】:
-
你的 kitchen.yml 配置是如何设置的,节点 JSON 文件的路径是什么?
-
--- 驱动程序:名称:vagrant 供应商:名称:chef_zero #nodes_path:测试/集成/节点环境_路径:测试/集成/默认/环境 client_rb:环境:测试 always_update_cookbooks:true 验证器:名称:检查平台:-名称:centos-7.2 套件:-名称:nodesearch run_list:-配方[nodesearch-cookbook::nodesearch_mapr]
-
driver: name: vagrant provisioner: name: chef_zero environments_path: test/integration/default/environments client_rb: environment: test verifier: name: inspec platforms: - name: centos-7.2 suites: - name: nodesearch run_list: - recipe[nodesearch-cookbook::nodesearch_mapr] -
nodes_path: 测试/集成/节点
-
好的,JSON 文件的完整路径是什么?
标签: chef-infra chef-recipe test-kitchen