Facts not populating to Foreman

Hi all,

New Foreman user here. I'm working on a distributed setup with many Puppet
Masters and Foreman installed on its own server with no puppet master. All
servers involved have a puppet agent running on them and share a Puppet CA.
SSL communication is enabled. I've installed a foreman proxy on my Puppet
Master, but I cannot get facts to populate to foreman. Reports are sending
fine and node classification appears to work fine. I don't receive any
errors, but I can't seem to discover existing facts from hosts. I've
installed and configured the latest ENC script (node.rb) and the yaml files
are getting created, but the files are empty except for the hostname.
Also, I never see an entry in the foreman logs for POST "/api/hosts/facts" which
I'm sure is a red flag, but I cannot figure out why its happening.

Foreman 1.15.3

Puppet 4.5

All on RHEL 7.3

Should Puppet core facts appear in these yaml files? How do I get core
facts to populate to Foreman? Any guidance would be great.

Example of yaml files being created:

··· ---

classes: []

parameters:

puppetmaster: ‘’

root_pw:

foreman_subnets: []

foreman_interfaces:

  • ip:

    ip6:

    mac:

    name: lbtslp000439.corptools.sidclab

    attrs: {}

    virtual: false

    link: true

    identifier:

    managed: true

    primary: true

    provision: true

    subnet:

    subnet6:

    tag:

    attached_to:

    type: Interface

foreman_config_groups: []

Turns out my issue was caused by having an incorrect "puppetdir" URL in
my foreman.yaml file. It would appear that puppetdir setting in
foreman.yaml needs to be the same as the "vardir" Puppet Master setting. I
suppose this makes sense as I believe the ENC script is leveraging the
cached facts stored in vardir and sending them to Foreman.

Perhaps the docs could be a bit more explicit about this setting? It
wasn't clear to me anyways.

Cheers,
-Shaun

··· On Tuesday, September 5, 2017 at 11:17:54 PM UTC-7, Shaun McEvoy wrote: > > Hi all, > > > > New Foreman user here. I'm working on a distributed setup with many > Puppet Masters and Foreman installed on its own server with no puppet > master. All servers involved have a puppet agent running on them and share > a Puppet CA. SSL communication is enabled. I've installed a foreman proxy > on my Puppet Master, but I cannot get facts to populate to foreman. > Reports are sending fine and node classification appears to work fine. I > don't receive any errors, but I can't seem to discover existing facts from > hosts. I've installed and configured the latest ENC script (node.rb) and > the yaml files are getting created, but the files are empty except for the > hostname. Also, I never see an entry in the foreman logs for POST > "/api/hosts/facts" which I'm sure is a red flag, but I cannot figure out > why its happening. > > > > Foreman 1.15.3 > > Puppet 4.5 > > All on RHEL 7.3 > > > > Should Puppet core facts appear in these yaml files? How do I get core > facts to populate to Foreman? Any guidance would be great. > > > Example of yaml files being created: > > --- > > classes: [] > > parameters: > > puppetmaster: '' > > root_pw: > > foreman_subnets: [] > > foreman_interfaces: > > - ip: > > ip6: > > mac: > > name: lbtslp000439.corptools.sidclab > > attrs: {} > > virtual: false > > link: true > > identifier: > > managed: true > > primary: true > > provision: true > > subnet: > > subnet6: > > tag: > > attached_to: > > type: Interface > > foreman_config_groups: [] >

> Turns out my issue was caused by having an incorrect "puppetdir" URL
> in my foreman.yaml file. It would appear that puppetdir setting in
> foreman.yaml needs to be the same as the "vardir" Puppet Master
> setting. I suppose this makes sense as I believe the ENC script is
> leveraging the cached facts stored in vardir and sending them to
> Foreman.

Glad you found it

> Perhaps the docs could be a bit more explicit about this setting? It
> wasn't clear to me anyways.

That sounds reasonable - care to send a patch? Easy way to make
yourself a contributor :slight_smile:

https://github.com/theforeman/theforeman.org/tree/gh-pages/_includes/ma
nuals/1.15

Cheers
Greg

··· On Thu, 2017-09-07 at 01:08 -0700, Shaun McEvoy wrote: