Chef Ideas

We believe that the best way to build software is to do it in close collaboration with the people who use it. We invite you to submit your ideas using the form below. Please be sure to include the problem for which you are solving and the benefits of implementing the idea.

We do our best to implement as many Ideas as we can. Our Product team will evaluate all submitted ideas in a timely manner and will disposition each into one of the following categories: will integrate into the product roadmap, further research is needed, unlikely to implement.

Thanks for collaborating with us!

CLI to search all node attributes against A2 server

I want to move to the new Effortless pattern (meaning I’m thinking about what it would be like to live without my beloved chef server).

 But I cannot and will not get rid of my chef server until I’m able to search all my node attributes against A2.

I’ve been a Chef customer for years, and I have come to depend upon the “knife node search ...” capabilities.   

 I cannot lose my “knife search node...” functionality. I don’t care about searching in recipes (fortunately we never did that) but I do want to search on the command line, so I can easily inventory and answer questions about my infrastructure.

When my boss walks into my office to ask, how many Linux servers are running kernel version X, I want to answer that by asking my configuration management tool since it knows everything about all my nodes.  

  • Karl Amrhein
  • Oct 8 2019
  • Currently Declined
  • Attach files
  • Karl Amrhein commented
    17 May, 2020 05:18am

    Looking at the A2 API documentation here
    https://automate.chef.io/docs/api/#operation/GetAttributes

    I'm getting closer to implementing my own CLI utility to dump node objects from A2 instead of the Chef server, but I'm not quite there...this is my curl command:

    curl -k -s -H "api-token: $TOKEN"https://chef-automate2.slac.stanford.edu/api/v0/cfgmgmt/nodes/$node_id/attribute

    But the response is a string instead of a json object that I can use. Is there a working ruby program or other example of the equivalent of 'knife node show [node] -l -F json' ?

  • Karl Amrhein commented
    30 Oct, 2019 04:36pm

    in the mean time, could we get an example (or blog post) about how to use curl/ruby/python to get all node attributes from A2 using REST?  I heard that A2 indexes by GUID instead of node name, but I don't know how to use REST API to search all node attributes.