voxpupuli / puppet-yum

Puppet module for Yum
https://forge.puppet.com/puppet/yum
MIT License
16 stars 99 forks source link

Deploying multiple gpgkey in one repo #278

Closed teluq-pbrideau closed 1 year ago

teluq-pbrideau commented 1 year ago

Pull Request (PR) description

The yum repository format should support entering multiple keys in the gpgkey entry, like the following entry for gitlab:

[gitlab_gitlab-ce]
name=gitlab_gitlab-ce
baseurl=https://packages.gitlab.com/gitlab/gitlab-ce/el/8/$basearch
repo_gpgcheck=1
gpgcheck=1
enabled=1
gpgkey=https://packages.gitlab.com/gitlab/gitlab-ce/gpgkey
       https://packages.gitlab.com/gitlab/gitlab-ce/gpgkey/gitlab-gitlab-ce-3D645A26AB9FBD22.pub.gpg
sslverify=1
sslcacert=/etc/pki/tls/certs/ca-bundle.crt
metadata_expire=300

Currently, this module only deploy the first gpgkey it encounter. This change allow to deploy multiples gpg keys (separated by any white spaces), for example:

class { 'yum' :
  managed_repos => ['gitlab'],
  gpgkeys       => {
    '/etc/pki/rpm-gpg/RPM-GPG-KEY-gitlab'                  => { source => 'https://packages.gitlab.com/gitlab/gitlab-ce/gpgkey' },
    '/etc/pki/rpm-gpg/RPM-GPG-KEY-gitlab-3D645A26AB9FBD22' => { source => 'https://packages.gitlab.com/gitlab/gitlab-ce/gpgkey/gitlab-gitlab-ce-3D645A26AB9FBD22.pub.gpg' },
  },
  repos         => {
    'gitlab' => {
      [...]
      'gpgkey' => 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-gitlab file:///etc/pki/rpm-gpg/RPM-GPG-KEY-gitlab-3D645A26AB9FBD22',
    },
}
teluq-pbrideau commented 1 year ago

I’m not sure, but does this PR fixes #116? It seems old

jhoblitt commented 1 year ago

This LGTM to me now. Thank you for contributing.