Problem:
The default Puppet provisioning script seems to always fail on a somewhat bare setup using the instructions at Configuring hosts by using Puppet. This is because the first puppet agent run (foreman/app/views/unattended/provisioning_templates/snippet/puppet_setup.erb at 5.0-stable · theforeman/foreman · GitHub) attempts to do SSL registration with the server, but fails if the server does not reply in time (probably if automatic certificate signing is not enabled).
The docs indicate that the server will not sign the certificate immediately and an administrator should go to the Certificates tab to sign the request, so I think this is expected behavior.
The solution would be adding the --waitforcert=1 parameter that makes the Puppet agent wait until the certificate is signed before exiting - tested with Puppet agent 8.
Additionally, the puppet service does not appear to be started at any point in the script, so system monitoring fails unless the service is started manually. The service is enabled in multiple places - line 110 for RedHat-based systems, line 126 for Debian-based systems (possibly?), and line 184 for SUSE, Debian and Ubuntu. The service would automatically start on next boot, but the documentation does not appear to indicate that a reboot is required.
Expected outcome:
The provisioning script should finish successfully and the puppet agent should be started at the end of the run to allow monitoring / configuring the system.
Foreman and Proxy versions:
Foreman 3.19.1 and Foreman Proxy 3.19.1.
Foreman and Proxy plugin versions:
Distribution and version:
AlmaLinux 9.8, with the latest updates applied.
Other relevant data:
Setting up auto-signing may remove the issue with the setup run failing, but I have not tested it.
Foreman was installed using foreman-install with default settings, on a single server (there is no dedicated proxy server).
The hosts are registered in custom organization and location (both created with default settings, by clicking the “New” button and configuring a name - if it matters, since the default Smart Proxy (the Foreman host) appears in the default organization / location.