Information Technology Reference
In-Depth Information
Chapter 12. Search
Chef search provides the ability to query data indexed on Chef Server. The search query runs
on Chef Server and search results are returned to clients. Queries can be invoked by using
knife on the command line or from within a recipe. Typical queries are usually inventory re-
lated, such as a count and system names of all the computers that have particular operating
system configurations or software installed. For example, searches for versions of the
openssl library vulnerable to the Heartbleed Virus were quite popular as we were writing this
book.
Search from the Command Line
Let's start by performing a search query with knife on the command line. Use the chef-play-
ground directory you created in Chapter 11 . Use the same dual command prompt setup you
used there. Start the chef-zero server on an open port in one window. We will be using port
9501 in the examples in this chapter:
$ chef-zero --port 9501
Then, in the other window, make the chef-playground directory the current working directory
and run the knife upload nodes command to populate Chef Server with some test data
about nodes:
$ cd chef-playground
$ knife upload nodes
Created nodes/susu.json
Created nodes/atwood.json
Created nodes/snowman.json
Search WWH ::




Custom Search