Chef web app developer training - Part 7 continued even more... checks/real life (draft)
The purpose of this series of tutorials is to take web app developers through the basic knowledge necessary to create and maintain the cookbooks used to deploy web applications.
Here I demonstrate that searches on data bags are applicable to other indexes and lists of objects in the chef server architecture.
Part 7 checks/real life
All of the objects in chef are similar to data bag lists, and can be searched using similar semantics
nodes, users, roles, groups and environments are all searchable indexes;
1) search for all nodes in a particular environment; and show only the "id" (-i)
$ knife search node "chef_environment:production" -i
2) show all the nodes having a particular role
$ knife search node "role:webapp"
3) show all the users in a particular group;
$ knife search users "groups:sysadmins"