Browse Tag: chef

Renaming a node in chef

Too bad there’s no `knife node rename ‘, eh?

Here’s what you gotta do instead:

knife client delete oldname
knife node delete oldname

On the node itself:

rm /etc/chef/client.pem
sed -i 's/oldname/newname/g' /etc/chef/client.rb
ls /etc/chef/validation.pem # ensure it's there!
chef-client -N newname

This will register the new node name with chef. The runlist will be empty, so you’ll have to rebuild it. Voila!