Usually, this behaviour is due missing to organization and location associations. Organizations and locations are part of the permission management in Foreman. By default, you should have a “Default Location” and “Default Organization” (unless you gave those a different name during installation). You can change the context you are using in the WebUI from the top bar. There should be two drop-down menus, one for each context. They are displayed as your current context (so e.g. “Default Location” and “Default Organization”). When you switch to “Any organization” and “Any location”, you should be able to see your hosts and reports in the UI.
After that, you can move the hosts to your organization and location. In the settings (found unter Administer -> Settings), there are to options to modify the behaviour once an unknown/new host sends a report for the first time. The are called “Default location” and “Default organization”. You can set those to your org/loc so future hosts will be associated correctly by default.
Please note that, after moving hosts to the organization/location, old reports will still not be accessible in that context, but future ones should be.
If you have further questions or this did not help you with your problem, feel free to ask again
Now, how do I get the facts from my puppetserver to my foreman?
I found some old post about the importance of pointing to the correct directory in /etc/puppetlabs/puppet/foreman.yaml.
I’m using puppet 6 and foreman 1.24 and I’ve pointed :puppetdir: to /opt/puppetlabs/server/data/puppetserver, which seems to include the relevant data - but it’s not read and sent with the reports.
Anything else I’ve missed or done wrong?
TBH, I never actually tried to integrate an external Puppet server with Foreman.
About a year ago, I have wrote down my thoughts about how that might be achieved for a Puppet enterprise system here, but there was no further response whether that worked.
The easiest way would probably be to set your Puppetserver up as smartproxy, but that will configure Foreman as ENC as well (which I do not know if you want).
There is an installer option (–puppet-server-external-nodes) that you could use to point to a different ENC script, but I can not guarantee that this is the only option you will need to set depending on your setup.
I’m only looking to get Foreman to be a report engine for my puppet server, and I want what I get in Foreman when manually running nodes.rb on my puppet server - nodes runs will get there by the “reports foreman” in puppet.conf, but I want the facts as well - which I do get if running a for loop for each node on the server. Maybe it’s time to write a script run by cron that will upload the facts to Foreman.
I was just hoping that I could combine the nodes.rb script with the reports, to get it to run when submitting reports.
Ok, I see. I was assuming that the report processor would hand the upload of facts, too, but obviously that was wrong. In that case you will probably need to go with a custom script solution. Afaik, there is no option to just handle fact uploads on it’s own and I could not find anything related to that either.
The ENC script has alternative run modes where it can use inotify the facts YAML directory and upload when a new file shows up. Haven’t used it personally but that may be more what you want. There’s also this PR that might be relevant:
Ok, thanks - then I know I have to do it myself, I don’t have to look after a solution that doesn’t exist.
(BTW, this is an honest answer, not sarcasm - I do thank you for the reply, saiving from spending time looking for something that doesn’t exist)