New reported_data facet introduced in Foreman core

Hello Foreman devs,

I just wanted to let everyone know that after https://github.com/theforeman/foreman/pull/6843 has been merged, we have now new (and first) host facet in Foreman core. Facets are mechanism to extend host object with additional feature while we avoid adding more responsibilities to the Host class itself.

The new facet is called reported_data. Today we use it to store only one information - the boot time of the host. Boot time is derived from facts (puppet/ansible/salt/chef/subscription manager). Each facter reports that a bit differently, but FactParser converts and provides this information in a format we can consume and store. If you deal with a situation where you’d like to store some information reported from facts, it is recommended to extend this facet.

We already have a few candidates to be moved to this facet, e.g. reported OS version that we know causes a lot of pain since it’s mixed with provisioned OS version. To set the right expectations, I do not plan to move more things to this facet myself right now, but please keep this in mind, in case you’re working in this area or plan to work with new reported data.

Thanks for reading and please feel free to raise questions

5 Likes

Thanks, looking forward to moving the OS info there so we stop mixing host setup and host reported data!

I do believe this needs some further design, what info is displayed where. Maybe worth starting a separate thread with a small design proposal. I’m thinking of an “actual state” and “desired state”, I’m just not sure whether it’s a good idea.

1 Like