Search the Chef server

Use the knife search command to list nodes that match the provided criteria

Find nodes with a specific cookbook in the run list (runlist)

knife search node 'recipes:MY_COOKBOOK\:\:*'

Find nodes with a specific recipe in the run list (runlist)

knife search node 'recipes:MY_COOKBOOK\:\:MY_RECIPE'

List nodes with a specific OS

All Linux nodes

knife search node "os:linux"

All nodes with Ubuntu OS

knife search node 'platform:ubuntu'

The last time the node successfully executed the run list (checked in)

List the status of all nodes and save it in a file. The columns contain how long ago the node successfully executed the run list, the name of the node, and the operating system.

knife status > nodes.csv

Leave a comment

Leave a Reply