Search returns a node object you have to iterate over, something like this in your recipe should get the data to play with more easily before sending them to the template:
nas_search = search(:node, 'run_list:role\[nas\]')
nas_hosts = {}
nas_search.each do |nodeobject|
nas_hosts[honstnames] << nodeobject.node.hostname
nas_hosts[ips] << nodeobject.node.ipaddress
end
Of course there are many ways to skin the above, the important thing being you must iterate over the node object returned which has node objects as well as other thingsā¦