I would like to specifically use the automatic_name:server in the command line "knife search node".
Any advise on how to accomplish this, would be greatly appreciated.
When coding against the server, node.automatic['name'] is available. Also, when exporting to json, the jq query shows that automatic is part of the server data held within chef. So, not sure why knife search node does not recognize/honor automatic.
The following shows that the knife search does not return when automatic is declared.
# knife search node -i "automatic_name:server"
0 items found
# knife search node -i "name:server"
1 items found
# knife node show server -Fj -l > server.json
# jq '.automatic.name' server.json
"server"
Thanks in advance. wcm
The
knife searchsubcommand searches the data "indexed" by the Chef server. Also the multi-level (deep) JSON structure is flattened to top-level:Consider a node's following "automatic" attributes in JSON:
If I wanted to search on
build_numberorcode_set, I would search it as (if) it is available at top-level:In your case also, "automatic" is being honored. The
serverinformation is flattened to the top-level, and is searchable without having to prefix it withautomatic.