Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

wolfaba
Copy link

@wolfaba wolfaba commented May 30, 2025

Summary

The apt-key definition provides dir, name and filename.

In the manifest/keyring.pp (apt::keyring) the destination file on the filesystem is generated as $file = "${dir}/${filename}".

In the manifest/source.pp (apt::source) the destination file is generated with the follwing code

$_list_keyring = if $_key['dir'] and $_key['filename'] {
  "${_key['dir']}${_key['filename']}"
} elsif $_key['filename'] {
  "/etc/apt/keyrings/${_key['filename']}"
} elsif $_key['dir'] {
  "${_key['dir']}${_key['name']}"
} else {
  "/etc/apt/keyrings/${_key['name']}"
}

If the $_list_keyring is generated from dir and filename or name, then there is no / separator between dir and filename. The key::dir: of the apt::source has to contains the / otherwise incorrect filename will be generated. This PR just create final full filename by joining directory name with filename using directory separator slash /.

@wolfaba wolfaba requested review from bastelfreak, smortex and a team as code owners May 30, 2025 15:51
@bwitt
Copy link

bwitt commented Aug 24, 2025

this would be nice to have!

@bwitt
Copy link

bwitt commented Aug 30, 2025

I didn't see an issue for this, so I created #1246

@imaqsood imaqsood merged commit 8fb1825 into puppetlabs:main Sep 5, 2025
1 check passed
@imaqsood imaqsood added the bugfix label Sep 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants