Fix Ubuntu 24 puppet-agent installation by using version-specific collections#774
Closed
gavindidrichsen wants to merge 3 commits into
Closed
Fix Ubuntu 24 puppet-agent installation by using version-specific collections#774gavindidrichsen wants to merge 3 commits into
gavindidrichsen wants to merge 3 commits into
Conversation
When a collection is not explicitly specified, determine the appropriate collection based on the installed Puppet version rather than defaulting to the generic 'puppet' collection. This ensures platforms like Ubuntu 24 use the correct version-specific package (e.g., puppet8-release) instead of the generic package (puppet-release) which can cause failures. Signed-off-by: Gavin Didrichsen <gavin.didrichsen@gmail.com>
Signed-off-by: Gavin Didrichsen <gavin.didrichsen@gmail.com>
bastelfreak
reviewed
Apr 23, 2025
dana-doherty
approved these changes
Apr 24, 2025
dana-doherty
left a comment
There was a problem hiding this comment.
Tested this manually and it works
Contributor
Author
|
Closing this after discussion with Josh Cooper That was my initial attempt at fixing the ubuntu 24 issue by directly changing the puppet_agent::install. When I discussed this with Josh Cooper he did not want to merge this and explained I should be able to fix the issue by using the correct collection. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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/VERSIONalready 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/VERSIONpuppet --versioncommandpuppet{major_version}(e.g.,puppet8)puppetcollection as a last resortThis ensures that: