yum

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

Garrett Honeycutt

ghoneycutt

7,324 downloads

1,195 latest version

5.0 quality score

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
  • RedHat
    ,
    CentOS
    ,
    OracleLinux
    ,
    Scientific

Start using this module

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