Registration script is trying to install a package "puppet"

Problem: after upgrade from 3.15 to 3.16→3.17 Registration script is trying to install a package.

Expected outcome:

Foreman and Proxy versions: 3.17

Foreman and Proxy plugin versions: 3.17

Distribution and version: Almalinux9

Other relevant data:

registration_host_init.sh:

set +e
trap ‘exit_and_cancel_build’ ERR

if [ -f /usr/bin/dnf ]; then
dnf -y install puppet
else
yum -t -y install puppet
fi

cat > /etc/puppet/puppet.conf << EOF
[main]
vardir = /var/lib/puppet
logdir = /var/log/puppet
rundir = /var/run/puppet
ssldir = $vardir/ssl

Hi,

this snippet in the script originates from this part of the init_config template: foreman/app/views/unattended/provisioning_templates/host_init_config/host_init_config_default.erb at develop · theforeman/foreman · GitHub . That section of the templates has been unchanged for at least 4 years according to the git history, so I think we can rule out changes in the template.

Since you did not provide an “expected outcome” I assume from the style of your post that you do not use Puppet and thus do not want to install it.

For the installation snippet to become active, you need to either have a puppetserver set on your host or have the host parameter “force-puppet” set and evaluationg to true, so those are the places I would look first.

Hi! We use puppet and puppetserver on Foreman (Openvox realy). The problem is that the registration script is trying to install the puppet package, and the package is called puppet-agent (openvox-agent).

Foreman web-ui Hosts→Register Host.

End of registration script Foreman 3.15:
```
Restart yggdrasild if installed and running

systemctl try-restart yggdrasil >/dev/null 2>&1 || true
subscription-manager register
–org=‘Almalinux’
–activationkey=‘nBCD’ || cleanup_and_exit 1

register_katello_host | bash

cleanup_and_exit
``

End of registration script Foreman 3.17:
```
bash /root/registration_host_init.sh
init_conf_status=$?

if [ $init_conf_status -ne 0 ]; then
echo “Host initialization script failed, see the logs for more information.”
echo “You can access the script source by running ‘cat /root/registration_host_init.sh’”
cleanup_and_exit $init_conf_status
fi
``
In 3.16 or 3.17 I see
bash /root/registration_host_init.sh
and in /root/registration_host_init.sh I see:
``
dnf -y install puppet
yum -t -y install puppet
```
Script fails with errors:

Error:
Problem: conflicting requests

  • nothing provides augeas-libs >= 1.10.1 needed by puppet-7.27.0-1.el9.noarch from rbru-epel-9
  • nothing provides augeas >= 1.10.1 needed by puppet-7.27.0-1.el9.noarch from rbru-epel-9
  • nothing provides /usr/bin/ruby needed by puppet-7.27.0-1.el9.noarch from rbru-epel-9
  • nothing provides ruby(selinux) needed by puppet-7.27.0-1.el9.noarch from rbru-epel-9

I can’t say if this changed in 3.16 or 3.17.

Ah, this is the important part. With Fixes #38624 - Adapt Registration Template to support OpenVox Agent by lumarel · Pull Request #10630 · theforeman/foreman · GitHub , the template for the Puppet installation was changed recently to properly support openvox. From glancing at the PR, you will need to use the enable-openvox7 or enable-openvox8 parameters to tell the template that you want to install openvox.

We install and configure the Openvox agent as a separate task. How can I disable the installation of Puppet/Openvox when subscribing?
set -o pipefail && curl --silent --show-error ‘https://foremanservername/register?activation_keys=nBCD&download_utility=curl&hostgroup_id=1&location_id=2&organization_id=1&update_packages=false&enable-openvox8=false&enable-puppet=false’ --header ‘*****’
Don’t help me :frowning:

If you want to skip the Puppet/OpenVox setup during registration completely and handle installation and setup yourself, you can set the skip-puppet-setup parameter (either per-host, per-hostgroup or as a global parameter, whatever fits your needs).

@areyus Thank you so much for your help!!!

1 Like