puppet facts exclude filter star wildcard not working as expected
Description of problem:
When we set an exclude filter in Administer > Settings > Provisioning > 'Exclude pattern for facts stored in satellite' and use the star wildcard, the filter is not working as expected. For example filter set as:
will also exclude facts like:
i.e. facts where the string is included in the middle of the fact and not only on the beginning. I would expect that the filter to exclude docker in the middle of the string should be written like:
Steps to Reproduce:
1. On a system create custom Puppet Fact called blah_docker_blah
2. Run 'puppet agent -t' on the client to propagate the fact to Satellite
3. Navigate to Hosts > All Hosts, choose the host and click the Facts button
4. Filter the facts for docker - no result will be shown
5. Check the exclude filter in Administer > Settings > Provisioning > 'Exclude pattern for facts stored in satellite'
6. The exclude filter docker* is present there by default
Facts with the docker string included in the middle are filtered out.
Facts with the docker string included in the middle will remain reported.
Fixes #29681 - Fixing bad regex for excluding facts
Foreman uses facts from many tools like Ansible or Puppet to gather
facts about hosts. These facts are also full of facts that foreman don't
care about. That's why Excluded facts setting exist. It has some bugs
that makes fact definiton for excluding hard.