Bug #38248
openDuplicate facts from discovery and Puppet
Description
We use Foreman (currently 3.11.2) with the "foreman_puppet" plugin (7.0.0). After the first regular puppet run on a newly provisioned new bare metal host, the Foreman database contains a number of facts for the host that have the same name, but different name types ("DiscoveryFactName" and "PuppetFactName") and, crucially, different values. When querying the Foreman API for hosts by fact values, Foreman seems to arbitrarily use either of the two values for the fact name, leading to inconsistent results. While some of the inconsistencies are questionable, other fact values collected during discovery such as memory used and load averages are clearly useless later on.
I'm not sure what the error here is (maybe there is a mistake on our side), but I guess the discovery facts should be removed automatically after provisioning/the first successful puppet run?