4

I've got a Chef node, bootstrapped with

knife bootstrap my.example.com --ssh-user USER --ssh-password 'PASSWORD' --sudo --use-sudo-password --node-name my.example.com

If I then format the node, how can I get Chef running on it again? I don't want to do knife client delete my.example.com as that will delete all the data from knife node edit my.example.com

8
  • All your node data is gone, as this is stored on the Chef server. The only thing that is on the client is the client key and (if not deleted) a validation key (to register as a client). Or what do you mean with "format the server"? Delete everything? What's your ultimate goal? Nov 16, 2015 at 14:44
  • My goal is that if I have a server that gets destroyed, I can use Chef to re-install all the software & configs that was on it
    – Greg
    Nov 16, 2015 at 16:23
  • At the moment, I can't get chef to run on the new server without having to delete the client and recreate the run-list
    – Greg
    Nov 16, 2015 at 16:23
  • Ah okay, I get your point (for you server = node). Thought you mean server = chef server. Nov 16, 2015 at 16:24
  • Ahh good point - I'll fix that
    – Greg
    Nov 16, 2015 at 16:26

2 Answers 2

1

If you bring client.pem across to the new installation and use the same node_name in your /etc/chef/client.rb file then the new installation should inherit the client registration on chef server, so you don't need to deregister and re-register the node from the server.

-1

You will need to copy down the important data from the chef server (knife download nodes/my.example.com if you want to be lazy), delete the node and client from the server, and then rebootstrap. You could do with with only clearing the client, but you'll have to repair the ACLs manually and its generally a less convenient approach.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .