Manages installed repos through hiera

Justin Lambert



477,662 latest version

4.6 quality score

Version information

  • 0.2.1 (latest)
  • 0.2.0
released Jan 15th 2016
This version is compatible with:
  • RedHat

Start using this module

Tags: yum


jlambert121/yum — version 0.2.1 Jan 15th 2016

Table of Contents

  1. Overview
  2. Module Description - What the module does and why it is useful
  3. Setup - The basics of getting started with yum
  4. Usage - Configuration options and additional functionality
  5. Reference - An under-the-hood peek at what the module is doing and how
  6. Limitations - OS compatibility, etc.
  7. Development - Guide for contributing to the module
  8. Changelog/Contributors


A puppet module to install (and purge) yum repositories as well as manage installed GPG keys.

Module Description

Why another yum module with so many in the forge? All of the modules I found in the forge either hardcode the available repositories, contain no tests, or appear to be unmaintained given the untouched issues and/or pull requests.

This module will install repos (as defined by the repos parameter) and optionally purge unmanaged repos (based on the purge parameter) and manage gpg keys (based on the gpg_source parameter).


What yum affects

  • Repos in /etc/yum.repos.d
  • GPG keys in /etc/pki/rpm-gpg (optional)

Beginning with yum

Including yum with no parameters has the amazing effect of doing nothing:

    class { 'yum': }




Hash of repos to include on the system

  class { 'yum':
    repos => {
      "epel" => {
        "descr"     => 'Extra Packages for Enterprise Linux 6 - x86_64',
        "baseurl"   => 'http://download.fedoraproject.org/pub/epel/6/$basearch',
        "gpgkey"    => 'https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-6'
      "corp_repo" => {
        "descr"     => 'Local corporate repo',
        "baseurl"   => 'https://yum.example.com/6/$basearch',
        "gpgkey"    => 'https://yum.example.com/RPM-GPG-KEY-corp'


A hash of parameters that should be used on all repos (unless overridden on the repo itself). These parameters will only apply to repos defined by repos. In the below example, epel will be disabled, corp_repo will be enabled.

  class { 'yum':
    repos => {
      "epel" => {
        "descr"     => 'Extra Packages for Enterprise Linux 6 - x86_64',
        "baseurl"   => 'http://download.fedoraproject.org/pub/epel/6/$basearch',
        "gpgkey"    => '/etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6',
        "enabled"   => '0'
      "corp_repo" => {
        "descr"     => 'Local corporate repo',
        "baseurl"   => 'http://yum.example.com/6/$basearch',
        "gpgkey"    => '/etc/pki/rpm-gpg/RPM-GPG-KEY-corp'
    defaults => { enabled => '1' },


If set to true, unmanaged repos will be removed from the system. This also applies to GPG keys (if gpg_source is defined - see below) If no repos are defined and purge is true, all repos will be removed.

  class { 'yum':
    repos => ...,
    purge => true,


A puppet resource that contains all of the RPM GPG keys to be installed. If purge => true is also set, unamanged keys will be removed.

  class { 'yum':
    repos => ...,
    gpg_source => 'puppet:///data/yum/gpg',


Public classes

  • yum


This module is only relavent on RedHat-based machines.


Improvements and bug fixes are greatly appreciated. See the contributing guide for information on adding and validating tests for PRs.

Changelog / Contributors

Changelog Contributors