0

I know Ohai pulls data from the node on which Chef client is installed and running. It communicates this data to the Chef client. However, is there a way to pass this data back to the Chef Server? If so - how?

An old co-worker of mine had mentioned it was possible to use Ohai to send node attributes to the Chef server and then query the Chef server (assuming with knife node show <FQDN> -l) for those node attributes in a JSON format. That JSON could then be used via an API to populate fields in a database.

Thanks for any help.

StephenKing
  • 36,187
  • 11
  • 83
  • 112
  • All automatic attributes set by ohai are saved to the Chef Server. Is the attribute that you want to query already available via _ohai_ or do you want to add it on your own? – StephenKing Oct 25 '16 at 21:21
  • So I know i can customized what attributes Ohai queries from the node via a plugin. It sounded like, in the Chef Docs, that all the Ohai stuff is happening locally on the node. But if they're already saved to the Chef Server, just a "knife node show -l" and it will list all those automatic attributes for the node? – user3150146 Oct 25 '16 at 21:27
  • Yes, `ipaddress` is an example for an automatic attribute that ohai reads from the system (the thing which happens _locally_), but is then stored on the Chef Server at the end of the run. – StephenKing Oct 25 '16 at 21:44

0 Answers0