Bug #32194
openPreseed Finish template tries to configure Puppet-Service without Systemd
Description
When using headless deployment on Ubuntu machines using Preseed, the finish template includes the snippet puppet_setup, which concludes with these lines:
<% if os_family 'Suse' || (os_name 'Debian' && os_major > 8) || (os_name == 'Ubuntu' && os_major >= 15) ->
<= bin_path >/puppet resource service puppet enable=true
< end ->
< if @host.provision_method == 'image' ->
<= bin_path >/puppet resource service puppet ensure=running
< end ->
< end -%>
The problem is that puppet resource service puppet enable=true will resolve the init provider as "debian" and not as "systemd", because outside the target, preseed runs on busybox.
Explicitly adding the systemd provider is a workaround (currently only tested on Ubuntu):
<% if os_family 'Suse' || (os_name 'Debian' && os_major > 8) || (os_name == 'Ubuntu' && os_major >= 15) ->
systemctl enable puppet
< end ->
< if @host.provision_method == 'image' ->
systemctl start puppet
< end ->
< end -%>
This problem is already mentioned in the template and refers to https://tickets.puppetlabs.com/browse/PA-136 and https://tickets.puppetlabs.com/browse/PUP-5577 with the latter being already closed and the former stating, the problem should be fixed while it isn't. I will be referring to this ticket to tell them, that it isn't solved.
Updated by Dennis Plöger about 3 years ago
Actually, isn't using systemctl the best way here? It's more transparent than working around puppet's init detection I'd say.
I can open a new Puppet ticket (as they requested) but I like to have a feedback from you guys before I do. Thanks!