How to get Run Puppet button working on Foreman?
Solution 1:
Finally managed to get it running!
It seems the error code (ERF12-4252
) corresponds to different errors. I had different misconfigurations that returned different errors on the console, but Foreman always reported the same message.
The way to solve the issue for me was to use the puppet kick <mynode>
command from the command line. There I discovered that my client certificate had a typo in its name and thus did not fit to the hostname.
On the Windows client I did the same (stopping the puppet windows service and starting the agent in the puppet command line window with puppet agent --debug --no-daemonize
to verify if anything happens on the agent.
This also helped in finding the correct directory for the auth.conf file. When installing the agent on Windows, the auth.conf file is placed in the install directory (usually C:\Program Files\PuppetLabs\Puppet\puppet\conf
), but it is expected in C:\ProgramData\PuppetLabs\puppet\etc
!
So, copying the file to this location and adding the required lines did the trick.
path /run
allow puppetmaster.dev.nextgen.local
After that, I only had to delete the old host in foreman, create a new certificate on the agent, sign it on the puppetmaster and add the new host in foreman.
Solution 2:
The documentation on how to set different methods to make 'Run puppet' work is here:
Puppet section (4.3.7) of the Foreman manual
Currently remote runs can be setup through 'MCollective', 'Puppetssh' and 'puppetrun (or kick)' (deprecated).
Solution 3:
it worked for me i opted for puppetssh source http://theforeman.org/manuals/1.11/index.html#4.3.6Puppet
follow that one instruction from the above link under the content puppetssh now edit the following line in the file.
/etc/foreman-proxy/settings.d/puppet
:puppetssh_command: /usr/bin/puppet agent --onetime --no-usecacheonfailure
convert it to
:puppetssh_command: /usr/bin/puppet agent --test
now it will work like charm feel free to reply if it doesn't worked cheers