Forge Home


Custom type and provider to manage GPG keys


196,280 latest version

4.6 quality score

We run a couple of automated
scans to help you access a
module's quality. Each module is
given a score based on how well
the author has formatted their
code and documentation and
modules are also checked for
malware using VirusTotal.

Please note, the information below
is for guidance only and neither of
these methods should be considered
an endorsement by Puppet.

Version information

  • 0.1.0 (latest)
  • 0.0.4
  • 0.0.3
  • 0.0.2
  • 0.0.1
released Aug 23rd 2018
This version is compatible with:
  • , ,

Start using this module

  • r10k or Code Manager
  • Bolt
  • Manual installation
  • Direct download

Add this module to your Puppetfile:

mod 'treydock-gpg_key', '0.1.0'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add treydock-gpg_key
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install treydock-gpg_key --version 0.1.0

Direct download is not typically how you would use a Puppet module to manage your infrastructure, but you may want to download the module in order to inspect the code.

Tags: gpg, rpm


treydock/gpg_key — version 0.1.0 Aug 23rd 2018


Puppet Forge Build Status

The gpg_key module lets you manage GPG keys with Puppet.

Currently the only provider is to import RPM GPG keys.


Puppet Versions < 2.6 2.6 2.7 3.x 4.x
gpg_key 0.0.x no no yes yes yes


Tested using

  • CentOS 5.9
  • CentOS 6.4
  • Fedora 18



Installs a GPG key at the given path. This type autorequires the file resource in path

file { 'RPM-GPG-KEY-foo':
  ensure  => present,
  path    => '/etc/pki/rpm-gpg/RPM-GPG-KEY-foo',
  source  => 'file:///modules/foo/RPM-GPG-KEY-foo',

gpg_key { 'foo':
  path  => '/etc/pki/rpm-gpg/RPM-GPG-KEY-foo',



Type: gpg_key

This type provides the capability to manage GPG keys within Puppet.


Indicates if the GPG key should be imported or removed.

Can either be present or absent. Defaults to present.


The path of the GPG key to import.

This value must be an absolute filesystem path.



Make sure you have:

  • rake
  • bundler

Install the necessary gems:

bundle install

Run the tests from root of the source code:

bundle exec rake test

If you have Vagrant you can also run system tests:

bundle exec rake beaker
BEAKER_set=centos-59-x64 bundle exec rake beaker
BEAKER_set=fedora-18-x64 bundle exec rake beaker