在测试厨房中,我正在尝试搜索节点,但它没有提供任何输出
食谱/测试/集成/节点
Json文件 { " id":" hive服务器", " chef_type":" node", "环境":" dev", " json_class":" Chef :: Node", " run_list":[], "自动":{ "主机名":" test.net", " fqdn":" 127.0.0.1", " name":" test.net", " ipaddress":" 127.0.0.1", " node_zone":" green", "角色":[]
},
"attributes": {
"hiveserver": "true"
}
}
配方
hiveNodes = search(:node, "hiveserver:true AND environment:node.environment AND node_color:node["node_color"])
#hiveserverList = ""
#hiveNodes.each |hnode| do
# hiveserverList += hnode
#end
#file '/tmp/test.txt' do
# content '#{hiveserverList}'
#end