Kickstart provisioning templates do not install puppet agents

Problem:

I am trying to provision a Rocky Linux 9 instance. During the provisioning process, several tasks will be carried out, such as registering the instance’s DNS, joining the domain, installing packages, registering a subscription, etc., in addition to these, we have the installation of the puppet agent and registration in the Foreman.

It turns out that the instance is provisioned in the VMWare environment, but the puppet agent installation does not happen.

Provisioning model used: XXXX_Kickstart_default_rocky_9

<%#
name: XXXX_Kickstart_default_rocky_9
snippet: false
model: ProvisioningTemplate
kind: provision
oses:
- Rocky
organizations:
- XXXX
locations:
- Goiania
%>
<%#
This template accepts the following parameters:
- lang: string (default="en_US.UTF-8")
- selinux-mode: string (default="enforcing")
- keyboard: string (default="us")
- time-zone: string (default="UTC")
- http-proxy: string (default="")
- http-proxy-port: string (default="")
- force-puppet: boolean (default=true)
- enable-epel: boolean (default=true)
- enable-puppetlabs-repo: boolean (default=true)
- enable-puppetlabs-puppet5-repo: boolean (default=false)
- enable-puppetlabs-puppet6-repo: boolean (default=false)
- enable-official-puppet7-repo: boolean (default=true)
- enable-official-puppet8-repo: boolean (default=false)
- salt_master: string (default=undef)
- ntp-server: string (default="a.ntp.xxx.xxx.br")
- bootloader-append: string (default="nofb quiet splash=quiet")
- disable-firewall: boolean (default=false)
- package_upgrade: boolean (default=true)
- disable-uek: boolean (default=false)
- use-ntp: boolean (default depends on OS release)
%>
<%
  rhel_compatible = @host.operatingsystem.family == 'Redhat' && @host.operatingsystem.name != 'Fedora'
  is_fedora = @host.operatingsystem.name == 'Fedora'
  os_major = @host.operatingsystem.major.to_i
  os_minor = @host.operatingsystem.minor.to_i
  realm_compatible = (@host.operatingsystem.name == 'Fedora' && os_major >= 20) || (rhel_compatible && os_major >= 7)
  # safemode renderer does not support unary negation
  pm_set = @host.puppetmaster.empty? ? false : true
  proxy_uri = host_param('http-proxy') ? "http://#{host_param('http-proxy')}:#{host_param('http-proxy-port')}" : nil
  proxy_string = proxy_uri ? " --proxy=#{proxy_uri}" : ''
  puppet_enabled = pm_set || host_param_true?('force-puppet')
  salt_enabled = host_param('salt_master') ? true : false
  chef_enabled = @host.respond_to?(:chef_proxy) && @host.chef_proxy
  section_end = (rhel_compatible && os_major <= 5) ? '' : '%end'
  use_ntp = host_param_true?('use-ntp') || (is_fedora && os_major < 16) || (rhel_compatible && os_major <= 7)
%>

<%
if host_param('kickstart_liveimg')
  img_name = host_param('kickstart_liveimg')
  liveimg_url = if host_param('kt_activation_keys')
    repository_url(img_name, 'isos')
  else
    if img_name.match(%r|^([\w\-\+]+)://|)
      img_name
    else
      "#{@host.operatingsystem.medium_uri(@host)}/#{img_name}"
    end
  end
%>
liveimg --url=<%= liveimg_url %> <%= proxy_string %>
<% else %>
<%= @mediapath %><%= proxy_string %>
<% @additional_media.each do |medium| -%>
repo --name <%= medium[:name] %> --baseurl <%= medium[:url] %> <%= medium[:install] ? ' --install' : '' %><%= proxy_string %>
<% end -%>
<% end %>
lang <%= host_param('lang') || 'en_US.UTF-8' %>
selinux --<%= host_param('selinux-mode') || host_param('selinux') || 'enforcing' %>
keyboard <%= host_param('keyboard') || 'us' %>
skipx




<% subnet = @host.subnet -%>
<% if subnet.respond_to?(:dhcp_boot_mode?) -%>
<% dhcp = subnet.dhcp_boot_mode? && !@static -%>
<% else -%>
<% dhcp = !@static -%>
<% end -%>

network --bootproto <%= dhcp ? 'dhcp' : "static --ip=#{@host.ip} --netmask=#{subnet.mask} --gateway=#{subnet.gateway} --nameserver=#{[subnet.dns_primary, subnet.dns_secondary].select{ |item| item.present? }.join(',')} --mtu=#{subnet.mtu.to_s}" %> --hostname <%= @host %><%= os_major >= 6 ? " --device=#{@host.mac}" : '' -%>

rootpw --iscrypted <%= root_pass %>
<% if host_param_true?('disable-firewall') -%>
firewall --disable
<% else -%>
firewall --<%= os_major >= 6 ? 'service=' : '' %>ssh
<% end -%>
<% if (is_fedora && os_major >= 28) || (rhel_compatible && os_major > 7) -%>
authselect --useshadow --passalgo=<%= @host.operatingsystem.password_hash.downcase || 'sha256' %> --kickstart
<% else -%>
authconfig --useshadow --passalgo=<%= @host.operatingsystem.password_hash.downcase || 'sha256' %> --kickstart
<% end -%>
<% if use_ntp -%>
timezone --utc <%= host_param('time-zone') || 'UTC' %>
<% else -%>
timezone --utc <%= host_param('time-zone') || 'UTC' %> <%= host_param('ntp-server') ? "--ntpservers #{host_param('ntp-server')}" : '' %>
<% end -%>

<% if rhel_compatible -%>

services --disabled="gpm,sendmail,cups,pcmcia,isdn,rawdevices,hpoj,bluetooth,openibd,avahi-daemon,avahi-dnsconfd,hidd,hplip,pcscd"
<% end -%>

<% if realm_compatible && host_enc['parameters']['realm'] && @host.realm && @host.realm.realm_type == 'Active Directory' -%>
# One-time password will be requested at install time. Otherwise, $HOST[OTP] is used as a placeholder value.
realm join --one-time-password='<%= @host.otp || "$HOST[OTP]" %>' <%= @host.realm %>
<% end -%>



#<% if @host.operatingsystem.name == 'Fedora' -%>

#<% end -%>

#<% if @host.operatingsystem.name == 'OracleLinux' && os_major == 7 && os_minor < 5 -%>
#repo --name="Server-Mysql"
#<% end -%>

<% if @host.operatingsystem.name == 'Fedora' && os_major <= 16 -%>
# Bootloader exception for Fedora 16:
bootloader --append="<%= host_param('bootloader-append') || 'nofb quiet splash=quiet' %> <%= ks_console %>" <%= @grub_pass %>
part biosboot --fstype=biosboot --size=1
<% else -%>
bootloader --location=mbr --append="<%= host_param('bootloader-append') || 'nofb quiet splash=quiet' %>" <%= @grub_pass %>
<% if os_major == 5 -%>
key --skip
<% end -%>
<% end -%>

<% if @dynamic -%>
%include /tmp/diskpart.cfg
<% else -%>
<%= @host.diskLayout %>
<% end -%>

text
<% if @host.respond_to?(:bootdisk_build?) && @host.bootdisk_build? %>
reboot --eject
<% else -%>
reboot
<% end -%>

#repo --name=rocky_linux_appstream --baseurl=http://foreman.exemple.com/pulp/repos/Default_Organization/Producao/generico_Rocky_9/custom/Rocky_linux_9/rocky_linux_appstream/

%packages

@Core
@server-product-environment
wget
dnf-utils
ipa-client
vim
iprutils
tuned
dracut-config-generic
sysstat
audispd-plugins
ncurses-term
rsyslog-gnutls
rsyslog-gssapi
rsyslog-relp
uuidd
subscription-manager
glibc-langpack-pt




<% if salt_enabled %>
salt-minion
<% end -%>
<%= section_end -%>

<% if @dynamic -%>
%pre
<%= @host.diskLayout %>
<%= section_end -%>
<% end -%>

%post --nochroot
exec < /dev/tty3 > /dev/tty3
#changing to VT 3 so that we can see whats going on....
/usr/bin/chvt 3
(
cp -va /etc/resolv.conf /mnt/sysimage/etc/resolv.conf
/usr/bin/chvt 1
) 2>&1 | tee /mnt/sysimage/root/install.postnochroot.log
<%= section_end -%>

%post
logger "Starting anaconda <%= @host %> postinstall"
exec < /dev/tty3 > /dev/tty3
#changing to VT 3 so that we can see whats going on....
/usr/bin/chvt 3
(
<% if subnet.respond_to?(:dhcp_boot_mode?) || @host.subnet6.respond_to?(:dhcp_boot_mode?) -%>
<%= snippet 'kickstart_networking_setup' %>
<% end -%>

echo "Updating system time"
<% if use_ntp -%>
/usr/sbin/ntpdate -sub <%= host_param('ntp-server') || 'a.ntp.xxx.xxx.br' %>
<% else -%>
/usr/bin/chronyc makestep
<% end -%>
/usr/sbin/hwclock --systohc

<% if proxy_uri -%>
# Yum proxy
echo 'proxy = <%= proxy_uri %>' >> /etc/yum.conf
<% end -%>

<% if rhel_compatible && !host_param_false?('enable-epel') -%>
<%= snippet 'epel' -%>
<% end -%>



<%= snippet 'XXXX_redhat_register_rocky9' %>

<% if host_enc['parameters']['realm'] && @host.realm && (@host.realm.realm_type == 'FreeIPA' || @host.realm.realm_type == 'Red Hat Identity Management') -%>
<%= snippet 'freeipa_register' %>
<% end -%>

<% unless host_param_false?('package_upgrade') -%>
# update all the base packages from the updates repository
#if [ -f /usr/bin/dnf ]; then
#  dnf -y update
#else
#  yum -t -y update
#fi
<% end -%>

<%= snippet('remote_execution_ssh_keys') %>

<%= snippet "blacklist_kernel_modules" %>

<% if chef_enabled %>
<%= snippet 'chef_client' %>
<% end -%>

<% if puppet_enabled %>
<% if host_param_true?('enable-puppetlabs-repo') || host_param_true?('enable-official-puppet8-repo') || host_param_true?('enable-official-puppet7-repo') || host_param_true?('enable-puppetlabs-puppet6-repo')|| host_param_true?('enable-puppetlabs-puppet5-repo') -%>
<%= snippet 'puppetlabs_repo' %>
<% end -%>
<%= snippet 'XXXX_puppet_setup_rocky_9' %>
echo "preferred_serialization_format = pson" >> /etc/puppetlabs/puppet/puppet.conf
ln -s /opt/puppetlabs/bin/puppet /usr/bin/puppet
<% end -%>

<% if salt_enabled %>
<%= snippet 'saltstack_setup' %>
<% end -%>

<% if @host.operatingsystem.name == 'OracleLinux' && host_param_true?('disable-uek') -%>
# Uninstall the Oracle Unbreakable Kernel packages
yum -t -y remove kernel-uek*
sed -e 's/DEFAULTKERNEL=kernel-uek/DEFAULTKERNEL=kernel/g' -i /etc/sysconfig/kernel
<% end -%>

<%= snippet('ansible_provisioning_callback') %>

sync

echo "Informing Foreman that we are built"
<%= snippet 'built' %>
) 2>&1 | tee /root/install.post.log
exit 0

<%= section_end -%>

snippet ‘XXXX_puppet_setup_rocky_9’

<%#
name: XXXX_puppet_setup_rocky_9
description: |-
  Bootstraps the Puppet agent and performs one run to create a certificate request.

  In more details it installs a Puppet agent, creates the necessary configuration files,
  enables the Puppet agent service and performs a single run with a specified tag.
  By default the tag `no_such_tag` is used to generate an empty run.
  An empty run can be used for the agent to detect it's missing a client certificate
  and ask for a new one from the host's Puppet CA.
snippet: true
model: ProvisioningTemplate
locations:
- Goiania
-%>
<%
os_family = @host.operatingsystem.family
os_major  = @host.operatingsystem.major.to_i
os_name   = @host.operatingsystem.name

aio_enabled = host_param_true?('enable-puppetlabs-repo') || host_param_true?('enable-official-puppet8-repo') || host_param_true?('enable-official-puppet7-repo') || host_param_true?('enable-puppet7') || host_param_true?('enable-puppetlabs-puppet6-repo') || host_param_true?('enable-puppet6') || host_param_true?('enable-puppetlabs-puppet5-repo') || host_param_true?('enable-puppet5')

if host_param('run-puppet-in-installer-tags')
  puppet_tags = host_param('run-puppet-in-installer-tags')
else
  puppet_tags = 'no_such_tag'
end

if os_family == 'Freebsd'
  freebsd_package = host_param_true?('enable-puppet6') ? 'puppet6' : 'puppet5'
  etc_path = '/usr/local/etc/puppet'
  bin_path = '/usr/local/bin'
elsif os_family == 'Windows'
  windows_package = "puppet-agent-#{@host.architecture}.msi"
  etc_path = 'C:\ProgramData\PuppetLabs\puppet\etc'
  bin_path = 'C:\Program Files\Puppet Labs\Puppet\bin'
elsif aio_enabled
  linux_package = 'puppet-agent'
  etc_path = '/etc/puppetlabs/puppet'
  bin_path = '/opt/puppetlabs/bin'
else
  linux_package = os_family == 'Suse' ? 'rubygem-puppet' : 'puppet'
  etc_path = '/etc/puppet'
  bin_path = '/usr/bin'
end
-%>
<% if os_family == 'Debian' -%>
apt-get update
apt-get install -y <%= linux_package %>
<% elsif os_family == 'Freebsd' -%>
pkg install -y <%= freebsd_package %>
<% elsif os_family == 'Redhat' -%>
if [ -f /usr/bin/dnf ]; then
  dnf -y install <%= linux_package %>
else
  yum -t -y install <%= linux_package %>
fi
<% elsif os_family == 'Suse' -%>
<% if host_param_true?('enable-puppetlabs-repo') || host_param_true?('enable-official-puppet8-repo') || host_param_true?('enable-official-puppet7-repo') || host_param_true?('enable-puppetlabs-puppet6-repo') || host_param_true?('enable-puppetlabs-puppet5-repo') -%>
rpmkeys --import https://yum.puppet.com/RPM-GPG-KEY-puppetlabs
rpmkeys --import https://yum.puppet.com/RPM-GPG-KEY-puppet
<% end -%>
<% if @host.provision_method == 'image' -%>
/usr/bin/zypper -n install <%= linux_package %>
<% end -%>
<% elsif os_family == 'Windows' -%>
$puppet_agent_msi = "${env:TEMP}\<%= windows_package %>"
$puppet_install_args = @(
  '/qn',
  '/norestart',
  '/i',
  "${puppet_agent_msi}",
  <%- if host_puppet_ca_server.present? -%>
  "PUPPET_CA_SERVER=<%= host_puppet_ca_server %>",
  <%- end -%>
  "PUPPET_MASTER_SERVER=<%= host_puppet_server %>"
)

Write-Host "Installing ${puppet_agent_msi} with args ${puppet_install_args}"
Start-Process 'msiexec.exe' -ArgumentList $puppet_install_args -Wait -NoNewWindow
<% end -%>

<% if os_family == 'Windows' -%>
$puppet_conf = @("<%= snippet 'puppet.conf' %>".Replace("`n","`r`n"))
Out-File -FilePath <%= etc_path %>\puppet.conf -InputObject $puppet_conf
<% else -%>
cat > <%= etc_path %>/puppet.conf << EOF
<%= snippet 'puppet.conf' %>
EOF
<% end -%>

<% if @host.puppetca_token.present? -%>
<% if os_family == 'Windows' -%>
$csr_attributes = @("<%= snippet 'csr_attributes.yaml' %>".Replace("`n","`r`n"))
Out-File -FilePath <%= etc_path %>\csr_attributes.yaml -InputObject $csr_attributes
<% else -%>
cat > <%= etc_path %>/csr_attributes.yaml << EOF
<%= snippet 'csr_attributes.yaml' %>
EOF
<% end -%>
<% end -%>

<% if os_family == 'Redhat' -%>
<% if os_major > 6 -%>
puppet_unit=puppet
/usr/bin/systemctl list-unit-files | grep -q puppetagent && puppet_unit=puppetagent
/usr/bin/systemctl enable ${puppet_unit}
<% else -%>
/sbin/chkconfig --level 345 puppet on
<% end -%>
<% end -%>
<% if os_family == 'Freebsd' -%>
echo 'puppet_enable="YES"' >>/etc/rc.conf
<% end -%>
<% unless aio_enabled -%>
<% if os_family == 'Debian' -%>
if [ -f "/etc/default/puppet" ]
then
/bin/sed -i 's/^START=no/START=yes/' /etc/default/puppet
fi
<%= bin_path %>/puppet agent --enable
<% elsif os_family == 'Suse' -%>
if [ -f "/etc/sysconfig/puppet" ]
then
/usr/bin/sed -ie s/^PUPPET_SERVER=.*/PUPPET_SERVER=<%= host_puppet_server %>/ /etc/sysconfig/puppet
fi
<% end -%>
<% end -%>
<%#
IMPORTANT NOTE: Setting "run-puppet-in-installer" is UNSUPPORTED!

The default mode of operation in Foreman is only to set up Puppet, but to not run it inside the installer environment.
Running Puppet inside the installer can cause various hard to diagnose errors, many of them resulting from the fact that
services are not started inside the installer.

If you are aware of the downsides, you can trigger a Puppet run inside the installer by setting the variable
run-puppet-in-installer to true.

Note, that this is an *unsupported mode of operation* and not supported by Foreman at all. You have been warned!
%>
<% if host_param_true?('run-puppet-in-installer') -%>
<% if (os_name == 'Ubuntu' && os_major >= 15) || (os_name == 'Debian' && os_major >= 8) -%>
# Puppet tries to detect the init system by checking the presence of the directory /run/systemd/system. That detection
# fails in a chroot environment like the one the installer provides. See Puppet tickets PA-136 and PUP-5577
#
# We work around that here until it gets fixed in Puppet (probably never for Puppet 3.x)
mkdir -p /run/systemd/system
<% end -%>
<% end -%>
# export a custom fact called 'is_installer' to allow detection of the installer environment in Puppet modules
<% if os_family == 'Windows' -%>
$env:FACTER_is_installer = $TRUE

# passing a non-existent tag like "no_such_tag" to the puppet agent only initializes the node
# You can select specific tag(s) with the "run-puppet-in-installer-tags" parameter
# or set a full puppet run by setting "run-puppet-in-installer" = true
$puppet_agent_args = @(
  "agent",
  "--config", "<%= etc_path %>\puppet.conf",
  "--onetime",
  <%= host_param_true?('run-puppet-in-installer') || @full_puppet_run ? '' : "\"--tags #{puppet_tags}\"," %>
  <%= host_puppet_server.blank? ? '' : "\"--server #{host_puppet_server}\"," %>
  "--no-daemonize"
)
Start-Process '<%= bin_path %>\puppet' -ArgumentList $puppet_agent_args -Wait -NoNewWindow
<% else -%>
export FACTER_is_installer=true
# passing a non-existent tag like "no_such_tag" to the puppet agent only initializes the node
# You can select specific tag(s) with the "run-puppet-in-installer-tags" parameter
# or set a full puppet run by setting "run-puppet-in-installer" = true
<% if host_param_true?('run-puppet-in-installer') || @full_puppet_run -%>
echo "Performing initial full puppet run"
<% else -%>
echo "Performing initial puppet run for --tags <%= puppet_tags %>"
<% end -%>
<%= bin_path %>/puppet agent --config <%= etc_path %>/puppet.conf --onetime <%= host_param_true?('run-puppet-in-installer') || @full_puppet_run ? '' : "--tags #{puppet_tags}" %> <%= host_puppet_server.blank? ? '' : "--server #{host_puppet_server}" %> --no-daemonize
<% if os_family == 'Suse' || (os_name == 'Debian' && os_major > 8) || (os_name == 'Ubuntu' && os_major >= 15) -%>
<% if os_family == 'Suse' -%>
<%= bin_path %>/puppet resource service puppet enable=true
<% else -%>
systemctl enable puppet
<% end -%>
<% end -%>
<% if @host.provision_method == 'image' -%>
<%= bin_path %>/puppet resource service puppet ensure=running
<% end -%>
<% end -%>

Expected outcome:

The provisioning process was complete, including the puppet part.

Foreman and Proxy versions:
Version 3.10.0-rc2 © 2009-2024 Paul Kelly and Ohad Levy
Foreman and Proxy plugin versions:

Installed Packages
ansible-collection-theforeman-foreman-4.0.0-2.el8.noarch
ansiblerole-foreman_scap_client-0.2.0-2.el8.noarch
candlepin-4.3.12-1.el8.noarch
candlepin-selinux-4.3.12-1.el8.noarch
foreman-3.10.0-0.10.rc2.el8.noarch
foreman-cli-3.11.0-0.2.develop.20240312180849git4abf925.el8.noarch
foreman-dynflow-sidekiq-3.10.0-0.10.rc2.el8.noarch
foreman-installer-3.11.0-0.1.develop.20240312031240git3f846ff.el8.noarch
foreman-installer-katello-3.11.0-0.1.develop.20240312031240git3f846ff.el8.noarch
foreman-postgresql-3.10.0-0.10.rc2.el8.noarch
foreman-proxy-3.10.0-0.2.rc2.el8.noarch
foreman-proxy-content-4.12.0-0.2.rc3.el8.noarch
foreman-redis-3.10.0-0.10.rc2.el8.noarch
foreman-release-3.10.0-0.2.rc2.el8.noarch
foreman-selinux-3.11.0-0.1.develop.20240226091422gita8664f9.el8.noarch
foreman-service-3.10.0-0.10.rc2.el8.noarch
foreman-vmware-3.10.0-0.10.rc2.el8.noarch
katello-4.12.0-0.2.rc3.el8.noarch
katello-ca-consumer-sv-cmdb-p05.tjgo.ldc-1.0-1.noarch
katello-certs-tools-2.9.0-2.el8.noarch
katello-client-bootstrap-1.7.9-2.el8.noarch
katello-common-4.12.0-0.2.rc3.el8.noarch
katello-repos-4.12.0-0.2.rc3.el8.noarch
katello-selinux-5.0.2-1.el8.noarch
pulpcore-selinux-2.0.1-1.el8.x86_64
python3.11-pulp-ansible-0.20.2-3.el8.noarch
python3.11-pulp-certguard-1.7.1-2.el8.noarch
python3.11-pulp-cli-0.21.2-5.el8.noarch
python3.11-pulp-container-2.16.4-1.el8.noarch
python3.11-pulp-deb-3.0.1-1.el8.noarch
python3.11-pulp-file-1.15.1-2.el8.noarch
python3.11-pulp-glue-0.21.2-3.el8.noarch
python3.11-pulp-python-3.10.0-3.el8.noarch
python3.11-pulp-rpm-3.23.3-1.el8.noarch
python3.11-pulpcore-3.39.11-1.el8.noarch
rubygem-foreman-tasks-9.1.0-1.fm3_10.el8.noarch
rubygem-foreman_ansible-13.0.3-2.fm3_10.el8.noarch
rubygem-foreman_bootdisk-21.2.2-1.fm3_11.el8.noarch
rubygem-foreman_discovery-24.0.1-1.fm3_10.el8.noarch
rubygem-foreman_hooks-0.3.17-3.fm3_9.el8.noarch
rubygem-foreman_maintain-1.5.1-1.el8.noarch
rubygem-foreman_openscap-7.1.1-2.fm3_10.el8.noarch
rubygem-foreman_puppet-6.2.0-1.fm3_10.el8.noarch
rubygem-foreman_remote_execution-12.0.5-3.fm3_10.el8.noarch
rubygem-hammer_cli-3.11.0-0.1.pre.develop.el8.noarch
rubygem-hammer_cli_foreman-3.11.0-0.1.pre.develop.el8.noarch
rubygem-hammer_cli_foreman_puppet-0.0.7-1.fm3_10.el8.noarch
rubygem-hammer_cli_foreman_remote_execution-0.3.0-1.fm3_10.el8.noarch
rubygem-hammer_cli_foreman_tasks-0.0.20-1.fm3_10.el8.noarch
rubygem-hammer_cli_katello-1.12.0-0.1.pre.master.20240122184453git9a6ae05.el8.noarch
rubygem-katello-4.12.0-0.3.rc3.el8.noarch
rubygem-pulp_ansible_client-0.20.3-1.el8.noarch
rubygem-pulp_certguard_client-1.6.5-1.el8.noarch
rubygem-pulp_container_client-2.16.4-1.el8.noarch
rubygem-pulp_deb_client-3.0.1-1.el8.noarch
rubygem-pulp_file_client-1.15.1-1.el8.noarch
rubygem-pulp_ostree_client-2.1.3-1.el8.noarch
rubygem-pulp_python_client-3.10.0-1.el8.noarch
rubygem-pulp_rpm_client-3.23.2-1.el8.noarch
rubygem-pulpcore_client-3.39.9-1.el8.noarch
rubygem-smart_proxy_pulp-3.3.0-1.fm3_10.el8.noarch

Distribution and version:

Server where Foreman is installed.

NAME="Rocky Linux"
VERSION="8.9 (Green Obsidian)"
ID="rocky"
ID_LIKE="rhel centos fedora"
VERSION_ID="8.9"
PLATFORM_ID="platform:el8"
PRETTY_NAME="Rocky Linux 8.9 (Green Obsidian)"

Other relevant data:

The instance appears in Foreman, I can access it with my domain user via ssh.

I added the Puppetlabs repository to the Rocky 9 content view.
In the production.log and proxy.log logs I have no errors.

I found the solution

  1. I added the puppetlabs repository to my product called Rocky Linux 9. http://yum.puppetlabs.com/puppet/el/9/x86_64/
  2. I added this new repository to my content view called generico_rocky_9.
  3. I published a new version of this content view in the production environment.
  4. In the Activation Keys called ak_generico_rocky_9, in the repository Sets tab, I changed the Puppetlabs Rocky Linux 9 repository to Override to Enabled in the Select Action button.