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

Please add support for repos with multiple gpgkeys #187

Open
anselmic opened this issue Jul 23, 2020 · 2 comments
Open

Please add support for repos with multiple gpgkeys #187

anselmic opened this issue Jul 23, 2020 · 2 comments

Comments

@anselmic
Copy link

anselmic commented Jul 23, 2020

Hello,

I have currently installed version 4.1.0.
Some repos like atomic or occasionally puppet come with multiple keys. In the current module, it is possible to specify more than one gpgkey for a repo, but then the keys are not automatically included. It is possible that I missed the correct way of specifying the keys, but after several attempts with Foreman, I locally solved the problem by a slight modification of the code (see hereafter).

I hope this helps.
C

diff init.pp init.pp.sav
145,158c145,155
< $matches0 = split ($attributes['gpgkey'], ' ')
< $matches0.each |String $attr| {
< $matches = $attr.match('^file://(.*)$')
< if $matches {
< $gpgkey = $matches[1]
< if $gpgkey =~ Stdlib::AbsolutePath and $gpgkey in $gpgkeys {
< if !defined(Yum::Gpgkey[$gpgkey]) {
< yum::gpgkey { $gpgkey:
< * => $gpgkeys[$gpgkey],
< }
< } # end if Yum::Gpgkey[$gpgkey] is not defined
< } # end if $gpgkey exists in gpgkeys
< } # end if gpgkey is a file:// resource
< }

      $matches = $attributes['gpgkey'].match('^file://(.*)$')
      if $matches {
        $gpgkey = $matches[1]
        if $gpgkey =~ Stdlib::AbsolutePath and $gpgkey in $gpgkeys {
          if !defined(Yum::Gpgkey[$gpgkey]) {
            yum::gpgkey { $gpgkey:
              * => $gpgkeys[$gpgkey],
            }
          } # end if Yum::Gpgkey[$gpgkey] is not defined
        } # end if $gpgkey exists in gpgkeys
      } # end if gpgkey is a file:// resource
@Legends0
Copy link

Even the puppet release repo has multiple gpgkeys in it. So this is a sensible request.

Example /etc/yum.repos.d/puppet.repo

[puppet]
name=Puppet Repository el 7 - $basearch
baseurl=http://yum.puppetlabs.com/puppet/el/7/$basearch
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-puppet-release
       file:///etc/pki/rpm-gpg/RPM-GPG-KEY-2025-04-06-puppet-release
enabled=1
gpgcheck=1

@Legends0
Copy link

This issue is a duplicate of #131.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants