Fix Ubuntu 24 puppet-agent installation by using version-specific collections #774
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Outstanding tasks
/opt/puppetlabs/puppet/VERSION
already exists? See tim's commentIssue
When running Bolt apply with Ubuntu 24 (noble), if no collection is explicitly specified, the task defaults to using the generic 'puppet' collection, resulting in installing 'puppet-release-noble.deb' instead of the version-specific 'puppet8-release-noble.deb'. This causes installation failures specific to Ubuntu 24, while other OSes work fine.
A previous fix attempted to address this in bolt's apply_prep function, but that placed OS-specific logic in the wrong architectural layer.
Solution
This PR moves the solution to the correct location by enhancing the collection selection logic in install_shell.sh to:
First check if a collection was explicitly specified (unchanged)
If no collection is specified, intelligently determine the appropriate collection:
/opt/puppetlabs/puppet/VERSION
puppet --version
commandpuppet{major_version}
(e.g.,puppet8
)puppet
collection as a last resortThis ensures that: