Defined Type: epel::rpm_gpg_key

Defined in:
manifests/rpm_gpg_key.pp

Summary

Import an RPM gpg key

Overview

Examples:

Sample Usage

epel::rpm_gpg_key{ 'EPEL-8':
  path => '/etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-8',
}

Parameters:

  • path (Any)

    Path of the RPM GPG key to import



12
13
14
15
16
17
18
19
20
21
# File 'manifests/rpm_gpg_key.pp', line 12

define epel::rpm_gpg_key ($path) {
  # Given the path to a key, see if it is imported, if not, import it
  exec { "import-${name}":
    path      => '/bin:/usr/bin:/sbin:/usr/sbin',
    command   => "rpm --import ${path}",
    unless    => "rpm -q gpg-pubkey-$(echo $(gpg -q --batch --with-colons --throw-keyids --keyid-format short < ${path}) | grep pub | cut -d ':' -f 5 | cut --characters=9- | tr '[A-Z]' '[a-z]')",
    require   => File[$path],
    logoutput => 'on_failure',
  }
}