[chef] Registration when an existing client.pem is present?


Chronological Thread 
  • From: Morgan Blackthorne < >
  • To: " " < >
  • Subject: [chef] Registration when an existing client.pem is present?
  • Date: Wed, 5 Jun 2013 01:39:47 -0700

Sometimes when building an AMI I find that I've forgotten to delete the client.pem file, which can cause issues when the node tries to do a run-- it tries to auth with the key, and it doesn't match a client with the key, and fails. 

I'm guessing that because the client keys can be shared that the answer to this question is no, but is there a way to set things so that if the client name does not exist that it will perform registration instead of trying to use the old key? On some of my setups I've worked around this with my chef-bootstrap.sh deleting client.pem (if it exists) in advance of running chef-client, but in instances that might get rebooted, I don't want to do that (since the client won't be able to register when it already exists).

Or is there a specific error code that I can trap for when doing this and detect that it failed?

--
~*~ StormeRider ~*~

"Every world needs its heroes [...] They inspire us to be better than we are. And they protect from the darkness that's just around the corner."

(from Smallville Season 6x1: "Zod")

On why I hate the phrase "that's so lame"... http://bit.ly/Ps3uSS



Archive powered by MHonArc 2.6.16.

§