[chef] Re: Re: search returns for nodes sometimes reduced or empty


Chronological Thread 
  • From: Dan Adams < >
  • To: < >
  • Subject: [chef] Re: Re: search returns for nodes sometimes reduced or empty
  • Date: Wed, 06 Jun 2012 16:00:20 +0100
  • Mail-reply-to: < >

Hi Zac

Thanks for the response - no, I set a new, manually-set attribute (nothing from ohai) that contained an array of the nodes returned via searching on a combinatino of environment and role. Ie i search for all app servers in the staging environment, and get back an array of hashes containing the node information for 1-4 hosts. The problem is that if I have, say, 4 app servers that have that role assigned in that environment, sometimes search returns 4 and sometimes 3, sometimes 2.

I am hoping that the fix suggested by Ian works, since he says it worked for him. However, given that I don't really *need* search as such - I don't care what nodes are currently reporting as having the role, just what hosts are *assigned* that role in their definitions file - is there another better way that I can access this information from recipes other than via search?

Cheers

Dan

On 06.06.2012 15:30, Zac Stevens wrote:
Hi Dan,

On Wed, Jun 6, 2012 at 12:34 PM, Dan Adams < > wrote:
1) Scenario 1 - Nodes vanish from search when I update chef via knife.
I make updates to files in the git repo and then import them to chef
couch/solr using:
"knife cookbook upload", "knife environment from file", "knife node from
file, "knife role from file"
It appears as though running at least some of these commands *re-creates*
the nodes as new objects with no roles (rather than updates the existing
objects) so that the nodes have no roles until the chef-client is
successfully run on the client host.

On this point, are you referring to the "roles" and "recipes" attributes?
These are updated during a chef-client run, in the process of taking
the run_list on the node and expanding it into the full set of recipes
and roles that will be applied.

So it's expected that the contents of those attributes will only
reflect a changed run_list after the next successful chef-client run.

I'm not sure whether it is considered correct for those attributes to
be blanked during "knife node from file" (if that is what's
happening).


Zac




Archive powered by MHonArc 2.6.16.

§