[chef] Re: search and order of results


Chronological Thread 
  • From: Mark Imbriaco < >
  • To: " " < >
  • Subject: [chef] Re: search and order of results
  • Date: Wed, 26 May 2010 23:14:07 -0400



On May 26, 2010, at 10:08 PM, Joshua Miller < "> > wrote:

Search order is inconsistent, is there a way to deal with it?  I really would not care except every time chef runs it restarts perbal which is a issue.

[snip]

search(:node, "role:WEBSERVER_ROLE") do |n|
   WEBSERVER_ROLE_host << n['ipaddress']
 end

[snip]

My Template:

CREATE POOL app_pool
<% @WEBSERVER_ROLE_host.each do |n| -%>
 POOL app_pool ADD <%= n %>:80
<% end -%>

You could do something like WEBSERVER_ROLE_host.sort.each in the template to ensure that the array is sorted before you iterate over it.

-Mark



Archive powered by MHonArc 2.6.16.

§