[chef] Re: How to `knife search` for empty attribute


Chronological Thread 
  • From: Christine Draper < >
  • To:
  • Subject: [chef] Re: How to `knife search` for empty attribute
  • Date: Mon, 4 May 2015 17:40:27 -0500

Have you tried:

knife role search "pkgs:somepkg*" ? 

I didn't do a whole load of testing, but seemed to work for me with hosted chef on a node attribute search.

Regards,
Christine

On Mon, May 4, 2015 at 4:42 PM, Anton Koldaev < " target="_blank"> > wrote:
I have the following roles:

roles/base1.json
...
  "pkgs": {
     "somepkg": {}
    }

roles/base2.json
...
  "pkgs": {
     "somepkg": {"version": "1"}
    }

How can I use knife search to find base1 and base2 knowing there's "somepkg" attribute that can be empty and can be not?

I've already tried:
* knife role search 'somepkg:*' # returns only base2
* knife role search -q '-somepkg:*' # returns all roles
* knife role search 'NOT somepkg:*' # returns all nodes
* knife role search '-somepkg:["" TO *]' # no results
* knife role search '-somepkg:[* TO *]' # no results

I'm using the latest version of chef server and client.

--
Best regards,
Koldaev Anton




Archive powered by MHonArc 2.6.16.

§