1
votes

I am looking at some of the differences between Chef Server and Chef Solo. If I have chef-solo nodes configured, would it be possible to store their attributes gathered by Ohai in my own remote database? I am trying to mimic the Chef Server functionality a bit, but with my own technologies etc.

I don't think this functionality is built in chef solo by default, what would be a good way to add this? I am currently thinking about an additional handler that sends the attributes to a database?

1
Did you find a solution to this problem? It's okay to answer your own question. Please don't forget to mark an answer as correct! :) - sethvargo

1 Answers

0
votes

Handlers are a reasonable way to implement that kind of feature. If you only want to update the server at the end of a successful run (mimicking chef-client's behaviour), register it as a report handler. If you want to update the server on every run, register it as both a report handler and an exception handler.

Inside your handler, run_status.node.automatic_attrs will contain the data provided by ohai. See the Exception and Report Handlers documentation on the Opscode site for more details.