Puppet and director registration

Hello all!

Is there a way to register a machine to the director via puppet?
As of now I am using the icinga powershell module for windows agents to register them to the director but I can’t find any similar ways to do this with puppet for linux machines.


You could try looking at the rest api documentation for the Director module

Link is directly to request processing for host registration portion.

Using that you could make a script or something to be kicked off by puppet (I’m more familiar with Ansible)

1 Like

I am pretty sure the puppet module has no such capability, but it could be done with the rest api as @steaksauce mentioned. This would require basic auth for the webinterface, so some configuration to the webserver is needed, but when using a function on the puppet server you can utilize rewrite to do an address based login like this:

RewriteCond %{REMOTE_ADDR} ^192\.168\.142\.3
RewriteRule ^(.*)$ - [E=REMOTE_USER:puppet]

Another idea would be exported resources, a resource collector and then running a deferred function on the director server itself using the cli. This is what I typically do with Ansible and delegate_to.

Third option would be the most easy one if you already use the PuppetDB: https://github.com/icinga/icingaweb2-module-puppetdb
This would allow to use PuppetDB as import source in the director.

And if your Puppet is managed by Foreman, there would be another option with the Foreman and Smart Proxy monitoring plugins when using the icinga2 and icingadirector provider. This would push hosts from Foreman to the Director, but it has never left an early development stage as I never found someone willing to sponsor more development.

1 Like

Aha understood, thanks a lot both of you for your help!

Hey there! I would like to ask you to mark an answer as the solution, if it resolves your topic. :slight_smile: