-
Notifications
You must be signed in to change notification settings - Fork 459
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for deb822 APT sources #1167
base: main
Are you sure you want to change the base?
Conversation
Inline ASCII GPG keys are still not working, but not necessary for an initial implementation. Same with generating apt::keyring resources from within the apt::source_deb822 resource. But I don't really think this is necessary at all since you can just create the keyring resource separately. Spec tests are done. I'm happy with the state of this PR. Happy to hear people's thoughts/suggestions. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another area of improvement would be to use this in acceptance testing, otherwise 👍
@jps-help thanks for the PR! Can you please rebase against main to get rid of the merge commit? |
The fork has been rebased. Should be good to go. |
Woops... I have accidentally reset my fork force pushed while testing another PR. Luckily I still have my original deb822 branch. I'll fix and push again. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What exactly is your reason to add an additional resource instead of extending the apt::source resource with an Enum parameter with the values "list" and "source" or "legacy" and "deb822"?
Otherwise thanks for your work!
I think the main reason is just because of how different the two styles are. If you look at the current apt::source, many of the parameters take a single value, whereas, with deb822 parameters like There might be a way we can extend the current type, I'm open to suggestions. My main focus was simply to add the new functionality without breaking the existing type at all. |
I'd suggest keeping this under
Indeed, I'd suggest adding an edit: also, using any of the new field names should implicitly force deb822, and trying to combine the new fields with the legacy source would be an error. See the handling of keyrings in the |
@rrotter All very good points. Let me take this back to the drawing board and try to implement with all these suggestions. I think we will need a lot of new logic to handle the switch between the two versions, but in the end hopefully will be a better experience! |
Okay... I have merged some new changes that integrate the deb822 functionality into the existing This is very much a work-in-progress and has several points to consider:
Comments are greatly appreciated. TLDR; I used a case statement to separate the functionality and added a new Enum parameter to control it. Also I left the separate manifest for |
IMHO the 'list' and 'sources' options would be better since these are the file extensions that are eventually used. This makes it easier to remember the possible values. In case that there will be another file format change in the future, the name of that format can easily be added here as allowed value. Otherwise 'deb822' would be the legacy format then. |
Finally had a chance to update this. I've used "list" and "sources" as the possible values for I've also removed the separate I think there will be more logic to add but can't think of anything right now. The only thing I see left are spec tests and README documentation but won't do those until we're happy with functionality. |
Thank you for implementing the approach of only having one source resource. As far as I can see the only thing I am missing in your implementation is @rrotter s suggestion of making the migration a one line change. This means, that the values I understand the idea of having the parameter names mapped to the corresponding keys of the format that is used. The concern I have with this is that the definition will explode every time a new format is added (hopefully not). Saying this I suggest that the doubled parameters should stay the old ones OR the new ones, but not both and "only" adapt the parameter types and improve the documentation accordingly. Thanks again for your work on this. (And sorry for the late comment) |
Sounds like a good idea. Thinking on this again, it doesn't make sense to add what are essentially duplicate parameters. I think it will require a lot more logic though since we need to allow the original |
Migration between .list and .sources should now be much easier. I have consolidated the parameters used for both formats so they now mostly share the same parameters.
|
Okay. All suggestions have been implemented where possible. I have now added spec tests, updated README and rebased against MAIN since we were quite a bit out-of-sync. Unless there are any more notes, I think this is ready. |
I saw main had some new commits, so I have rebased again. |
Should be roughly drop-in alternative to the existing apt::source type Does not currently support inline ascii gpg key
Use 'sources' instead of 'source' as the setting_type parsed to apt::setting Fix the data type of apt::source::signed_by
Correctly handle newline/whitespace trimming for `signed_by` parameter.
Match the possible values to the file suffix of the created source files.
Allow array values for certain parameters to allow easy switching between .list and .sources formats.
Convert string values to arrays where possible and warn the user.
This reverts commit 9d88e93.
Correctly compare data type when generating deb822 sources Remove unused class parameters and descriptions
Remove references to unused deb822 parameters Update parameter descriptions Update deb822 example Update warnings for $pin and $key usage with deb822. Currently unsupported Don't fail if $location is missing unless $ensure is 'present'
eliminate params.pp and create_resources() params.pp and create_resources() are obsolete. This module was converted to non-params.pp style puppetlabs#667, but was reverted in puppetlabs#680. Using Hiera in modules and no params.pp are the preferred styles these days.
Add support for deb822 .sources files
Re-apply data-type changes for apt::source::pin from 1e1baad Regenerate puppet strings to match.
Remove leading whitespace
Simplify apt::setting logic Co-authored-by: Tim Meusel <tim@bastelfreak.de>
is this PR good to be merged? |
Summary
Adds a new defined type,
apt::source_deb822
, and corresponding EPP template for managing deb822 APT sources.Works alongside the existing
apt::source
type.TO DO
apt::source
type, doesn't currently support generating associatedapt::keyring
resources. Need to be created separately.Additional Context
.sources
filesRelated Issues (if any)
Mention any related issues or pull requests.
Checklist
puppet apply
)