Friday, April 29, 2016

Knife Aliases

Easier use of common Knife Tasks


One of the guys I am working with had some aliases on his local for working with Chef and Knife. I grabbed a copy of them and put them into a repo. Made it a bit easier for everyone working with the server stacks. 

https://github.com/Blue-Dog-Archolite/bash-knife-search

ks
Knife Search for a keyword or IP address in the nodes and return common name and external IP

ksip
Knife search for keyword or IP address in the nodes and return ip address

ksrunlist
knife search for node and display runlist.

Becoming a Prep Chef

What the hell is the run list?


I've been doing some chef work as of late and I was sucked into a machine that wasn't behaving as expected. As hard and as frequently as I changed my search, I was unable to find the command I wanted. 

It turns out the command is very simple but wasn't close to what I was searching for: 


knife node show <node name>  

As simple as you can get, but as it turns out, doesn't show up on searches for "knife show runlist" or "knife show recipes for node".