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


Chronological Thread 
  • From: Anton Koldaev < >
  • To:
  • Subject: [chef] How to `knife search` for empty attribute
  • Date: Mon, 4 May 2015 16:42:48 -0500

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.

§