Skip to content
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

Allow passing all keyring params in apt::source #1147

Merged
merged 3 commits into from
Nov 21, 2023

Conversation

kenyon
Copy link

@kenyon kenyon commented Nov 21, 2023

  • keyring: rename parameters to remove redundancy
  • keyring: remove the file param
  • source: allow passing all apt::keyring attributes

We don't need apt::keyring::keyring_thing, it should just be
apt::keyring::thing.
Being able to provide the dir, filename, and full file path makes the
logic too complicated for users of this defined type. We should only
allow providing the filename and dir, and then compute the full path
from those. Otherwise, someone could pass all three parameters, in which
case the filename and dir would be ignored, which could be confusing.
This uses the same logic as apt::keyring itself, and what I think would
be the least surprising logic:

1. Passing both `dir` and `filename`: you have provided the full path,
   so that is used in the signed-by setting.
2. Passing just the `filename` means you want to use the default dir,
   /etc/apt/keyrings.
3. Passing just the `dir` means you want to use the given directory, and
   the `name` attribute as the filename.
4. Passing only `name` means use `name` with the default dir.
Copy link
Collaborator

@bastelfreak bastelfreak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As in the other PR, I think it's a good change but we should wait until we've more breaking changes

@kenyon
Copy link
Author

kenyon commented Nov 21, 2023

I'm intending to make use of this to modernize puppetlabs-puppet_agent in https://github.com/puppetlabs/puppetlabs-puppet_agent/blob/bd687442d8eaf9a08cb3f138f1e7a965c46f8490/manifests/osfamily/debian.pp

@kenyon
Copy link
Author

kenyon commented Nov 21, 2023

@bastelfreak IMO these aren't backwards-incompatible changes since there hasn't been a release done with apt::keyring (#1128) yet.

@kenyon
Copy link
Author

kenyon commented Nov 21, 2023

Ended up not needing this for puppetlabs/puppetlabs-puppet_agent#681, but I think these changes are good still.

@bastelfreak
Copy link
Collaborator

@kenyon oh right!

@bastelfreak bastelfreak merged commit f9be175 into puppetlabs:main Nov 21, 2023
20 checks passed
kali-brandwatch pushed a commit to brandwatch/puppetlabs-apt that referenced this pull request May 10, 2024
Allow passing all `keyring` params in `apt::source`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants