In test kitchen i am trying to search nodes but it is not giving any output
cookbook/test/integration/nodes
Json file { "id": "hive server", "chef_type": "node", "environment": "dev", "json_class": "Chef::Node", "run_list": [], "automatic": { "hostname": "test.net", "fqdn": "127.0.0.1", "name": "test.net", "ipaddress": "127.0.0.1", "node_zone": "green", "roles": []
},
"attributes": {
"hiveserver": "true"
}
}
Recipe
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