Tuesday, October 25, 2011

Chef is fun.

I'm currently using chef to manage 91 nodes, and find it to be a fantastic tool. I esspecially like to combine knife commands with shell stuff for something like this:
for node in `knife search node "chef_environment:prod"|grep "Node Name"|awk '{print $3}'`; do         echo -ne "${node}\t" ; knife node show $node -a ec2.instance_type; done |awk '{print $1 "\t" $3}'
Which gives me a list of nodes in production along with their ec2 instance type.  It's handy for generating simple reports, and getting an idea for how may instances of each type we have running in any given environment.

No comments:

Post a Comment