Unix administration stuff that was hard to find out using Google and caused a lot of try and error. Hereby given back to the net...
|
|
Tweet |
|
Link Collections Linux Security Tools Projects Recent Posts
Comments
|
Chef: Which nodes have role X / recipe Y
Submitted by Lars Windolf on 22. October 2012 - 11:45.
Why is it so hard to find out which nodes have a given role or recipe in chef? The only way seems to loop yourself:
for node in $(knife node list); do
if knife node show -r $node | grep 'role\[base\]' >/dev/null; then
echo $node;
fi;
done
Did I miss some other obvious way? I'd like to have some "knife run_list filter ..." command! |
According to
According to http://wiki.opscode.com/display/chef/Search, this should work:
knife search node 'roles:base'
You have to use "recipes" instead of "roles" to search for... well, recipes :)
This is what I needed!
Thanks a lot! Exactly what I was looking for.
Post new comment