I followed this guide https://www.theforeman.org/manuals/1.15/index.html#3.5.5FactsandtheENC to load agent facts but still cannot see them on the board.
Copied the node.rb to /etc/puppetlabs/puppet/
server = puppet
environment = production
runinterval = 10m
strict_variables = true
vardir = /opt/puppetlabs/server/data/puppetserver
logdir = /var/log/puppetlabs/puppetserver
rundir = /var/run/puppetlabs/puppetserver
pidfile = /var/run/puppetlabs/puppetserver/puppetserver.pid
codedir = /etc/puppetlabs/code
# For puppet DB
storeconfigs = true
storeconfigs_backend = puppetdb
reports = store,puppetdb,foreman
external_nodes = /etc/puppetlabs/puppet/node.rb
node_terminus = exec
I see no errors from the agents , also executed it manually as suggested in the documentation and this is what I get.
Also executed --push-facts and no luck, Am I missing something else?
puppetserver version: 5.1.4
Foreman version Version 1.15.6
CentOS Linux release 7.4.1708 (Core)
First stop would be the Foreman logs - tail
production.log and call the ENC, and show us what’s logged during the test.
Iirc 1.16 added puppet 5 support so that might be related
Do the directories you have configured in puppet.conf match those in puppetserver.conf? Had this and reports not work a few times due to small directory differences… you should also see API call in production.log if it’s trying and failing…
I just found the same issue too.
check “puppetdir” in foreman.yaml, which is “/var/lib/puppet” by default.
but in puppet 4 or higher, facts are cached in $vardir by default, it could be found under “/opt/puppetlabs/server/data/puppetserver/yaml/facts”.
so edit foreman.yaml and set " :puppetdir: “/opt/puppetlabs/server/data/puppetserver” ", then it would be ok.
I’m not so good at English, hope this could help.
Thanks buddy , that did the trick!!! really appreciated your help
Was this an upgrade from an older Puppet/Foreman version combination? Those paths should already be correct on a fresh install, at least
This was a fresh install and I installed it on a running puppet server like this:
foreman-installer --foreman-db-host=x.x.x.x --foreman-db-type=postgresql --foreman-db-database=foreman --foreman-db-adapter=postgresql --foreman-db-username=foreman --foreman-db-password=secretpassword --firstname.lastname@example.org --foreman-admin-password=SZENhbFNvdddQCzXH8u --foreman-admin-username=foremanadmin --no-enable-puppet --foreman-db-manage=false
Interesting - I would guess that it’s because the Puppet 5 support came in 1.16, and it therefore fell back on the defaults. Probably not a big issue since 1.17 is imminent, which will render 1.15 out of support
One issue Im having now is that I have a custom fact called environment which I assign a value, for example prod , qa, test and I use it to customize my puppet configuration based on those , and puppet agent for some reason is not taking into account it’s own configuration, so instead of looking for production for example, it looks for the value assigned to that fact, and that broke everything, so I disable it by now.
In general, I’d be careful naming things after core puppet concepts. I would entirely expect having a fact called ‘environment’ to clash with the environment value set by the server, since they share the same global namespace. Call your fact ‘my_environment’ or similar to avoid clashing.
Yup, Im gonna rename it to something else.
Thanks for your time.
Hey buddy , sorry for disturbing you.
Im still having the same issue,. the agent complains about an environment value with does . not exist, but this time I renamed the fact to custom_environment and also removed it and still is overriding the agent environment variable configuration, any suggestion?
Should I remove all the content from /opt/puppetlabs/server/data/puppetserver/yaml/foreman and /opt/puppetlabs/server/data/puppetserver/yaml/facts ? It seems to be cached, just guessing here, and not being update.
If I execute node.rb and any hostname for example I get