Install Ubuntu 20.04 / 18.04 does not work after upgrading to Foreman 2.1.4

Problem:
Deploying of VMs does not work anymore

Expected outcome:
Deploy machines as usual.

Foreman and Proxy versions:
Foreman 2.1.4

Foreman and Proxy plugin versions:

Distribution and version:
CentOS Linux release 7.9.2009 (Core)

Other relevant data:
After upgrading from 2.0.3 to 2.1.4 the deployment does not work anymore.

At the end of the installation of Ubuntu the installer crashes.
Red Screen shows: Failed to run preseeded command

So I chrooted into the VM to see what’s going on there.
I downloaded the finish script and executed it line by line.

Running the following command is responsible for the problem:
/opt/puppetlabs/bin/puppet resource service puppet enable=true

unable to read /etc/init.d/puppet
Error: /Service[puppet]/enable: change from 'false' to 'true' failed: 
Execution of '/usr/bin/update-rc.d puppet defaults' returned 1: update-rc.d: error: unable to read /etc/init.d/puppet

Running in chroot, ignoring request

service {'puppet': 
  enable => 'false',
  provider => 'debian',
}

Why are you using the Debian provider? Shouldn’t you use the systemd provider since that’s what Ubuntu ships with.

Where can I change this?

I guess this comes from ‘puppet_setup.erb’
But there is no variable to set this.
<% if os_family == 'Suse' || (os_name == 'Debian' && os_major > 8) || (os_name == 'Ubuntu' && os_major >= 15) -%>
<%= bin_path %>/puppet resource service puppet enable=true

Which Puppet version are you using? Are you by any chance stuck on an old unsupported version? Current versions should support this out of the box.

Puppetmaster:
puppet-agent.x86_64 5.5.22-1.el7 @puppet5
puppet-agent-oauth.noarch 0.5.1-4.el7 @foreman
puppet5-release.noarch 5.0.0-12.el7 @puppet5
puppetdb.noarch 5.2.19-1.el7 @puppet5
puppetdb-termini.noarch 5.2.19-1.el7 @puppet5
puppetserver.noarch 5.3.16-1.el7 @puppet5
tfm-rubygem-puppetdb_foreman.noarch 5.0.0-2.fm2_1.el7 @foreman-plugins

Client:
puppet-agent \ 5.5.22-1bionic
puppet5-release \ 5.0.0.-11bionic

The only thing I can think of is that it doesn’t work well in the chroot. Sounds like a bug in Puppet. Have you tried their support? You can also try Puppet 6 since Puppet 5 goes EOL in a few days.

I tried Ubuntu 20.04 and puppet-agent 6.10.1-1focal but the problem stays the same.
The problem occurred after upgrading Foreman from 2.0.3 to 2.1.4.
I guess the provisioning templates in use will never be changed after an upgrade?
Is the slack channel the best way to get information from the puppet people?

The real problem is somewhere else.
The last wget command fails every time because the image can not be ejected.

2020-11-30T15:53:17 [W|app|f15bbd95] Failed to set Build on x.y…net: [“Failed to detach ISO image from CDROM drive of instance x.y…net: GenericVmConfigFault: Connection control op
eration failed for disk ‘ide0:0’.”]

Just want to link this issue here, since I also get the error message about the missing /etc/init.d/puppet file.