Skip to content

Commit

Permalink
specific GPG key for RH7
Browse files Browse the repository at this point in the history
  • Loading branch information
vaol committed Jan 5, 2024
1 parent 12ed576 commit e8c1db2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 15 deletions.
File renamed without changes.
26 changes: 11 additions & 15 deletions manifests/repo/yum_postgresql_org.pp
Original file line number Diff line number Diff line change
@@ -1,24 +1,20 @@
# @api private
class postgresql::repo::yum_postgresql_org inherits postgresql::repo {
$version_parts = split($postgresql::repo::version, '[.]')
$package_version = "${version_parts[0]}${version_parts[1]}"
$gpg_key_path = "/etc/pki/rpm-gpg/RPM-GPG-KEY-PGDG-${package_version}"
$gpg_key_path_common = '/etc/pki/rpm-gpg/RPM-GPG-KEY-PGDG-common'
$version_parts = split($postgresql::repo::version, '[.]')
$package_version = "${version_parts[0]}${version_parts[1]}"
$gpg_key_path = "/etc/pki/rpm-gpg/RPM-GPG-KEY-PGDG-${package_version}"

file { $gpg_key_path:
content => file('postgresql/RPM-GPG-KEY-PGDG'),
owner => 'root',
group => 'root',
mode => '0644',
before => Yumrepo['yum.postgresql.org'],
$gpg_key_file = $facts['os']['release']['major'] ? {
'7' => 'postgresql/RPM-GPG-KEY-PGDG-7',
default => 'postgresql/RPM-GPG-KEY-PGDG',
}

file { $gpg_key_path_common:
content => file('postgresql/RPM-GPG-KEY-PGDG-common'),
file { $gpg_key_path:
content => file($gpg_key_file),
owner => 'root',
group => 'root',
mode => '0644',
before => Yumrepo['pgdg-common'],
before => Yumrepo['yum.postgresql.org'],
}

if($facts['os']['name'] == 'Fedora') {
Expand All @@ -39,7 +35,7 @@
baseurl => $_baseurl,
enabled => 1,
gpgcheck => 1,
gpgkey => "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-PGDG-${package_version}",
gpgkey => "file://${gpg_key_path}",
proxy => $postgresql::repo::proxy,
}

Expand All @@ -48,7 +44,7 @@
baseurl => $_commonurl,
enabled => 1,
gpgcheck => 1,
gpgkey => 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-PGDG-common',
gpgkey => "file://${gpg_key_path}",
proxy => $postgresql::repo::proxy,
}

Expand Down

0 comments on commit e8c1db2

Please sign in to comment.