A new project has been started to use chef Report and Exception handler to send reports to Foreman.
The repo can be found here :
This needs Foreman 1.3+ to work

chef_handler_foreman is distributed as a gem, see

Future work:

Foreman needs to support multiple type of reports (only Puppet report for now).

Greg: The reports API is only JSON, and much of it is optional. I would suggest we extend the API rather than creating whole new routes.
Marek: It would be nice to detect where the report comes from but +1 for same route
Greg: This could be a case for STI-ing the reports table and allowing plugins to extend the report layout?
Marek: Sounds good to me, +1.

Same thing could be reused for ABRT or any other kind of reports.

Change Fact to non-specific CM vocabulary (Romain)

Greg: I disagree, a name is a name. I don't really care what we call it, but Fact is as good as anything else and avoids large changes to the codebase.
Marek: some fact names should be unified because of statistics though

Chef facts uploading

Facts uploading is also a part of the chef_handler_foreman projec. Facts in here means data from ohai and host attributes. It makes a plain hash from nested attributes so we converts {:lsb => {:id => 'Fedora'}} to lsb::id => Fedora. As a workaround we convert lsb_id to operatingsystem and lsb_release to operatingsystemrelease so Foreman can parse it.


  • There are ~2000 facts we get this way for every host.
  • Plain names are too long because ohai provides very nested structure. Foreman has support for nested facts already and foreman requires foreman_chef plugin
  • Using chef reporter we can get to all node attributes, not just those coming from ohai. This could be handy later.

Romain: On top of authentication issue, communication flow are still to be discussed. In this first PoC all chef-client are directly sending reports and facts to Foreman server. How ever Foreman has been fully designed to avoid direct communication between. If we use smart-proxy to send reports and facts, webrick may be a serious bottleneck.
Marek: I think users can add more smart proxies if needed.