[chef] Re: Chef Search Again


Chronological Thread 
  • From: Douglas Garstang < >
  • To:
  • Subject: [chef] Re: Chef Search Again
  • Date: Tue, 16 Jun 2015 12:31:08 -0700

Ok, I thought, I'll write a new cookbook called nodesave and put JUST node.save in it. Then, I'll simply call chef twice, the first time passing just the nodesave cookbook. This should cause the node data to be populated at the end of the first run, available in the second run, Well trying to do a node.save on vagrant results in:

"I cannot read /etc/chef/client.pem, which you told me to use to sign requests!"

Sigh. I guess all I need is an empty cookbook that does nothing as node.save seems to have no effect anyway. All I need is a dummy chef client run.

Doug.

On Tue, Jun 16, 2015 at 12:14 PM, Douglas Garstang < " target="_blank"> > wrote:
Well, I've tried putting both a 60s and a 90s sleep before the call to chef search. No improvement. I rerun the chef-client again and the nodes appear. It appears that node.save() at the start of the run list updates the node on the server, but it _still_ don't work for searches. :(

On Tue, Jun 16, 2015 at 11:50 AM, Douglas Garstang < " target="_blank"> > wrote:
The battle continues with chef search. I'm trying to use chef search to discover zookeeper nodes. The very first thing in my run list is node.save, which seems to cause the Chef server to immediately have access to the data I need, the role and the environment.

I just did a test, where one window had the result of "knife search node "chef_environment:dev AND roles:role-zookeeper". I could see that the data was populated immediately after the call to node.save. A few minutes later, when the recipe did it's search, no nodes were found, as evidenced from an empty log() statement in the recipe.

I've run the test a few times, and basically, the result are unreliable. On my latest test, two of the nodes discovered all three nodes, and one of the nodes discovered only one node (not itself btw).

How can I make this reliable?

Doug




--



--



Archive powered by MHonArc 2.6.16.

§