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


Chronological Thread 
  • From: andi abes < >
  • To:
  • Subject: [chef] Re: knife search weirdness. What am I doing wrong here?
  • Date: Tue, 14 Feb 2012 15:28:05 -0500

I think you can only use one * in a search term.

knife search node "crontabs_root_all_lines:*chef or crontabs_root_all_lines:chef*" -a crontabs


On Tue, Feb 14, 2012 at 1:46 PM, John Alberts < "> > wrote:
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.

§