RedHatSatellite / katello-attach-subscription

automatically assign subscriptions to hypervisors based on certain rules
GNU General Public License v2.0
10 stars 5 forks source link

implement a FactAnalyzer to determine the host type #30

Closed evgeni closed 5 years ago

evgeni commented 5 years ago

@sideangleside @Rocco83 @mossicrue this is what we talked about last week. The interesting part is in lib/katello_attach_subscription/fact_analyzer.rb, rest is just tests and fixtures and stuff :)

mossicrue commented 5 years ago

I try to use function of FactAnalyzer. If an hypervisor has no guest on it the function system_type return 'unknown' instead of 'hypervisor'

evgeni commented 5 years ago

Correct, if there are no facts and no guests, it currently returns unknown. What information would you use in this caee?

mossicrue commented 5 years ago

I search facts named 'virt', if its present, the host could be a vm or a physical one, else it's an Hypervisor

evgeni commented 5 years ago

In which case would we not have the hypervisor::* facts set at the same time?

mossicrue commented 5 years ago

If you mean the ones we gather from virt-who yes, but from a quick analysis, hypervisors seems not have any particular facts

evgeni commented 5 years ago

Yeah, I was acting/writing under the assumption that we have either https://github.com/Katello/katello/pull/7821 merged, or implement https://github.com/RedHatSatellite/katello-attach-subscription/issues/32 as a generic-ish workaround, so that we always have access to facts

mossicrue commented 5 years ago

tested and works