Forge Home


Adds yumrepos from parameters


20,049 latest version

3.4 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.0.3 (latest)
  • 0.0.2
  • 0.0.1
released Jul 29th 2014

Start using this module

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

Add this module to your Puppetfile:

mod 'gbrown-yumrepos', '0.0.3'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add gbrown-yumrepos
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install gbrown-yumrepos --version 0.0.3

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.



gbrown/yumrepos — version 0.0.3 Jul 29th 2014

yumrepos puppet module


I was sick of having modules for various repos and module dependencies for yet another EPEL module.

This has a dependency on the puppetlabs/stdlib for validation checks.

Simply throw the $repos parameter a nested hash of repos and stop writing yumrepo modules.

If the $heria_hash parameter is true values for $repos across all hierarchies are used so repos can be defined at multiple levels. This allows for a base set of repos to be defined at a low level of the hierarchy and more specific repos to be defined further up the hierarchy closer to what is likely more relevant definitions.

There is also a $defaults parameter intended to minimise boiler plate. This enables default attributes to be set once and applied for all puppet defined yumrepos. In this module this is set to ensure the repo is enabled. Handy if you have to proxy all your repos or something for example.

If the attribute is defined in both $repos and $defaults the value in $repos takes precedence.

The $purge parameter takes a boolean, if true all yumrepos and rpm-gpg keys will be purged unless they are provided by puppet. This defaults to false.


Include the class

include yumrepos

Pass the class a nested hash of repos

$repos = {
  epel => {
  descr     => 'Extra Packages for Enterprise Linux 6 - x86_64',
  baseurl   => '$basearch',
  gpgkey    => '/etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6',
  priority  => '10',
  myrepo => {
  descr     => 'Local mirror of Foo',
  baseurl   => '$basearch',
  gpgkey    => '/etc/pki/rpm-gpg/RPM-GPG-KEY-foo',
  priority  => '10',

Set all repos to check gpgkeys

$defaults = {
  ensure    => present,
  enabled   => true,
  gpgcheck  => true,

You can provide keys by dropping them into the files directory of this module