Forge Home

yum

Puppet module to manage yum (client, server, and key management)

8,429 downloads

1,712 latest version

5.0 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

  • 2.3.0 (latest)
  • 2.2.0
  • 2.1.0
  • 2.0.0
  • 1.4.0
  • 1.3.0
  • 1.2.0
  • 1.1.0
released Oct 25th 2019
This version is compatible with:
  • Puppet Enterprise 2019.8.x, 2019.7.x, 2019.5.x, 2019.4.x, 2019.3.x, 2019.2.x, 2019.1.x, 2019.0.x, 2018.1.x
  • Puppet >= 5.5.8 < 7.0.0
  • , , ,

Start using this module

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

Add this module to your Puppetfile:

mod 'ghoneycutt-yum', '2.3.0'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

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

Manually install this module globally with Puppet module tool:

puppet module install ghoneycutt-yum --version 2.3.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.

Download

Documentation

ghoneycutt/yum — version 2.3.0 Oct 25th 2019

puppet-module-yum

Table of Contents

  1. Module Description
  2. Setup - The basics of getting started with yum
  3. Usage - Configuration options and additional functionality
  4. Limitations - OS compatibility, etc.
  5. Examples
  6. Development - Guide for contributing to the module

Module description

Manage yum (client, server, and key management). This module manages /etc/yum.conf and can manage a repo file such as /etc/yum.repos.d/foo.repo using yum::repo. This functionality is feature complete and supports all documented options. The module can fetch and install RPM GPG keys to aid in the usage of GPG keys for repositories.

This module has the ability to create a yum server to serve up yum repositories to agents using Apache.

Setup

What yum affects

See the description.

Beginning with yum

Declare the main ::yum class. See profile examples below.

Usage

See examples below.

Minimum usage

include '::yum'

Parameters to configure classes and defined types.

Please consult the REFERENCE.md file for all parameters or the puppet-strings generated documentation at http://ghoneycutt.github.io/puppet-module-yum/.

Limitations

This module is built for use with Puppet versions 5 and 6 on the following platforms and supports the Ruby version associated with each puppet agent release. See .travis.yml for an exact matrix.

  • EL 6
  • EL 7

Development

See CONTRIBUTING.md for information related to the development of this module.

Examples

Create simple yum repo file

yum::repo { 'example_plain':
  gpgkey  => 'http://yum.test.local/keys/RPM-GPG-KEY-EXAMPLE_PLAIN',
  baseurl => 'http://yum.test.local/customrepo/5/10/$basearch',
}

Using Hiera:

yum::repos:
  example_plain:
    gpgkey:   'http://yum.test.local/keys/RPM-GPG-KEY-EXAMPLE_PLAIN'
    baseurl:  'http://yum.test.local/customrepo/5/10/$basearch'

Create secured repository and import GPG key into local store:

yum::repo { 'example_secure':
  gpgkey   => 'https://yum.test.local/keys/RPM-GPG-KEY-EXAMPLE_SECURE',
  baseurl  => 'https://yum.test.local/customrepo/5/10/$basearch',
  username => 'example',
  password => 'secret',
  gpgcheck => true,
}

yum::rpm_gpg_key { 'example_secure':
  gpgkey     => '/etc/pki/rpm-gpg/RPM-GPG-KEY-EXAMPLE_SECURE',
  gpgkey_url => 'https://yum.test.local/keys/RPM-GPG-KEY-EXAMPLE_SECURE',
}

Using Hiera:

yum::repos:
  example_secure:
    gpgkey:   'https://yum.test.local/keys/RPM-GPG-KEY-EXAMPLE_SECURE'
    baseurl   'https://yum.test.local/customrepo/5/10/$basearch'
    username: 'example'
    password: 'secret'
    gpgcheck: true
yum::rpm_gpg_keys:
  example_secure:
    gpgkey:     '/etc/pki/rpm-gpg/RPM-GPG-KEY-EXAMPLE_SECURE'
    gpgkey_url: 'https://yum.test.local/keys/RPM-GPG-KEY-EXAMPLE_SECURE'

Profile for a yum server

include ::yum::server

Profile for all EL systems

include ::yum

Design patterns

Use Hiera to include the yum class on all EL6 and EL7 systems.

Create a profile such as profile::yumrepos that lists all your yum repos as virtual resources and then realizing the repos in the appropriate profiles.

# profile::yumrepos

@yum::repo { 'app_foo':
  baseurl => 'http://yum.test.local/app_foo/7/$basearch',
}

@yum::repo { 'app_bar':
  baseurl => 'http://yum.test.local/app_bar/7/$basearch',
}
# profile::foo

realize Yum::repo['app_foo']