Forge Home

yum

Manages installed repos through hiera

576,257 downloads

576,087 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.2.1 (latest)
  • 0.2.0
released Jan 15th 2016
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 'jlambert121-yum', '0.2.1'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add jlambert121-yum
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install jlambert121-yum --version 0.2.1

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.

Download
Tags: yum

Documentation

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

Overview

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).

Setup

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': }

Usage

Parameters

####repos

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'
      }
    }
  }

####defaults

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' },
  }

####purge

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,
  }

####gpg_source

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',
  }

Reference

Public classes

  • yum

Limitations

This module is only relavent on RedHat-based machines.

Development

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

Changelog / Contributors

Changelog Contributors