[chef] knife search weirdness. What am I doing wrong here?


Chronological Thread 
  • From: John Alberts < >
  • To:
  • Subject: [chef] knife search weirdness. What am I doing wrong here?
  • Date: Tue, 14 Feb 2012 12:46:16 -0600

I wrote an ohai plugin that puts crontab data in node attributes.  The
idea was that I wanted to be able to use knife to search for servers
with particular cron jobs.  Unfortunately, knife search isn't
cooperating with me. :/

You can see below that using a wildcard for search will return a
result, but specifying something that is obviously in the output below
yields no results.  Am I just getting the syntax wrong?



bash-3.2$ knife search node "hostname:dc02vg0039nr* AND
crontabs_root_all_lines:*" -a crontabs
1 items found

crontabs:
  root:
    all_lines:  # Chef Name: chef-client

PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/local/sbin
                SHELL=/bin/bash
                36 * * * * /usr/local/bin/chef-client > /dev/null 2>&1
    crons:      ["36 * * * * /usr/local/bin/chef-client > /dev/null 2>&1"]
id:        dc02vg0039nr.internal



bash-3.2$ knife search node "hostname:dc02vg0039nr* AND
crontabs_root_all_lines:*chef*" -a crontabs
0 items found


O'RLY? WTF? :)


Thanks
John



Archive powered by MHonArc 2.6.16.

§