Foreman + Windows Clients + Puppet Server OS on different machine

I installed Puppet OS Server + PuppetDB based on instructions on Puppet project. Installed puppet client on Windows machines and signed theirs certs in server from CLI. I did simple class to create empty file to confirm that things are working and they are.

Later I discovered Foreman, and I tried to install it on different host, to have situation where VM is doing one thing mostly. I figured out how to configure foreman-proxy on puppet serwer to show certificates from it. But I had problem with importing machines as hosts to foreman. Probably missed something in documentation.

Reading much information online, I found out that there is rake job: foreman-rake puppet:import:hosts_and_facts

It is importing all hosts (output):

# foreman-rake puppet:import:hosts_and_facts
Importing from /opt/puppetlabs/server/data/puppetserver/yaml/facts
Importing client-lenovo01
Importing client-surface01
Importing client-dell01
Importing puppetserver.domain
Importing client-dell02
Importing windowsdev

But in my foreman hosts I only see two machines from list. How can I debug what is going on, and why other hosts are not visible in foreman panel?

Expected outcome:
Expected to see all of machines in foreman hosts.

Foreman and Proxy versions:
Foreman 3.1.1
Foreman-Proxy 3.1.1

Foreman and Proxy plugin versions:

# foreman-rake plugin:list
Collecting plugin information
Foreman plugin: foreman_monitoring, 2.1.0, ...
Foreman plugin: foreman_puppet, 2.0.0, ...
Foreman plugin: puppetdb_foreman, 5.0.0, ...

Distribution and version:
Linux Ubuntu 20.04
Windows clients are on:

  • Windows 10 Home Edition
  • Windows 7 Profesional
  • Windows 10 Profesional

Hi again,
searching through codebase I found file: lib/tasks/puppet.rake

Basicly this is file definig job puppet:import:hosts_and_facts if someone want’t to read more check out Rake documentation. On line 20 of this file there is line:
host = Host::Managed.import_host(facts_stripped_of_class_names['name'], 'puppet')

Problem is second param in method import host, it defines cert as puppet, and that is problem. To fix it just change line by deleting second param.

host = Host::Managed.import_host(facts_stripped_of_class_names['name'])

That fixed problem and all hosts where imported corectly.
Hope that will help someone.