Applying Puppet plans fails on Debian 12 Bookworm targets
Closed this issue · 7 comments
Describe the Bug
Applying a Puppet plan against Debian Bookworm fails with the following error :
$ bolt plan run server_install::configure -t test
Starting: plan server_install::configure
Starting: install puppet and gather facts on test
Finished: plan server_install::configure in 11.06 sec
Failed on test:
The task failed with exit code 127 and no stdout, but stderr contained:
bash: line 1: /tmp/fc36dad6-d110-4cd6-abb3-ed7f53cf2a07/custom_facts.rb: cannot execute: required file not found
Failed on 1 target: test
Ran on 1 target
Expected Behavior
Correct behavior is to not fail and going on.
Steps to Reproduce
Steps to reproduce the behavior:
- Create a Bolt projet
- Add a plan in Puppet format using
apply_prep
- Run the plan against a target running Debian 12 Bookworm
Environment
- Version 3.27.4
- Platform Ubuntu 20.04LTS running Bolt, Debian 12 Bookworm as target
Additional Context
The problem was wrongly reported in the PHP project Bolt here
The file custom_facts.rb uses #! /opt/puppetlabs/puppet/bin/ruby
as shebang which does not exist on the target.
Changing the shebang to #! /usr/bin/ruby
on the Bolt machine makes the script work.
The problem seems to be in fact that Puppet is not currently officially ported to Debian 12 Bookworm as there is no puppet-release-bookworm.deb on apt.puppet.com.
So installing Puppet from Bolt requires to configure the plugin-hooks to use the task plugin with the package task. It installs Ruby as /usr/bin/ruby so the expected ruby path in the custom_facts.rb does not exist.
Did you try upgrading the puppet_agent package to >= 4.17.0 ? puppetlabs/puppetlabs-puppet_agent@43fbd93 Bolt ships with an older one, but if you install a newer one into your project that should be used.
I'm not sure what I have to do but I added puppetlabs-puppet_agent to my PuppetFile and ran bolt module install --no-resolve
.
The problem remains so I maybe done it the wrong way.
Still not fixed in bolt 3.28. Plan still fails as there's a hardcoded download url. Missing case for bookworm results in /modules/puppet_agent/tasks/install_shell.sh
attempting to download https://apt.puppet.com/puppet-release-.deb
Adding the missing case to the script (here), then the missing package file at https://apt.puppet.com/puppet-release-bookworm.deb can be worked around by adding the following to inventory.yaml
plugin_hooks:
puppet_library:
plugin: task
task: puppet_agent::install
parameters:
collection: puppet7 # or puppet8
Working with bolt 3.29.0.
Yeah, the updated puppet_agent package was included in latest bolt release.