On May 15, 2012, at 1:00 PM, Chris Chalfant wrote:
You can also write a knife plugin that compares the list of nodes known to the chef server and compare that list to the output of ec2-describe-instances. Anything that’s in chef but not in ec2-desc can be queued for node/client deletion. You can run this as a cron job on your chef server or some other management node if you are using hosted chef.
For my previous employer, I wrote a shell script that basically did the same sort of thing. However, I kept running into edge cases where the code needed to be modified so that it didn’t accidentally blow away clients of one sort or another – like the $COMPANY-validator client, the -dev clients that we spun up with Chef and then did a “knife node delete” so that we couldn’t accidentally re-run chef-client and wipe out development work that had been done, etc….
Be careful when developing tools that automatically delete stuff from your infrastructure.
Trust me, you REALLY don’t want to delete the wrong clients. #BTDT
Brad Knowles firstname.lastname@example.org
LinkedIn Profile: http://tinyurl.com/y8kpxu