Нет выхода из поиска на тестовой кухне
Выдает ошибку, проверьте рецепт и предложите мне некоторые детали
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
cldbNodes.first['fqdn']
? Поиск обычно возвращает массив, а не один объект. - person coderanger   schedule 02.03.2017cldbNodes
— это массив, поэтому вам нужноcldb = cldbNodes[0]['fqdn']
илиcldb = cldbNodes.first['fqdn']
- person coderanger   schedule 02.03.2017#cldbList = Array.new() #cldbNodes.each do |cldb| # cldbList += cldb # i +=1 #end
- person Udhay   schedule 02.03.2017