Forge Home

repo_centos

Manage the CentOS YUM repositories on CentOS clients.

22,258 downloads

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

  • 4.0.0 (latest)
  • 3.0.2
  • 3.0.1
  • 3.0.0
released Jan 30th 2017
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 'treydock-repo_centos', '4.0.0'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add treydock-repo_centos
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install treydock-repo_centos --version 4.0.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

treydock/repo_centos — version 4.0.0 Jan 30th 2017

puppet-repo_centos

Puppet Forge Build Status

####Table of Contents

  1. Overview
  2. Backwards Compatibility - 4.x
  3. Usage - Configuration options
  4. Reference - Parameter and detailed reference to all options
  5. Development - Guide for contributing to the module

Overview

This is a puppet module that manages the CentOS repositories on CentOS clients.

Originally based off of https://github.com/flakrat/repo_centos

Default states for each operating system of the repositories managed by this module:

Repository CentOS 5 CentOS 6 CentOS 7
base enabled enabled enabled
updates enabled enabled enabled
extras enabled enabled enabled
cr absent absent disabled
contrib disabled disabled not supported
fasttrack disabled disabled disabled
plus disabled disabled disabled
debug disabled disabled disabled
scl not supported absent not supported
centos-base-source absent absent absent
centos-updates-source absent absent absent

Backwards Compatibility

The 4.x release of this module drastically changes the behavior of this module from previous releases. The module now attempts to manage the repo files shipped with CentOS and as such extra steps must be taken to ensure a smooth transition from a release prior to 4.x. The transition can be automated if attempt_compatibility_mode is set to true. When attempt_compatibility_mode is true this module will re-install (or update) the centos-release package, remove previously added centos-* repositories, then modify the stock repo files based on parameter values.

Usage

Class: repo_centos

By default, the module configures the repo files to use http://mirror.centos.org/centos as the package source.

class { 'repo_centos': }

A custom repository can be used by setting the repourl parameter and disabling the use of mirrorlist by setting enable_mirrorlist to false:

class { 'repo_centos':
  repourl           => 'http://myrepo/centos',
  enable_mirrorlist => false,
}

Alternate usage via hiera YAML:

repo_centos::repourl: 'http://myrepo/centos'
repo_centos::enable_mirrorlist: false

To enable SCL (CentOS 6 only)

class { 'repo_centos':
  enable_scl => true,
}

To install the SCL repo but leave it disabled (CentOS 6 only)

class { 'repo_centos':
  ensure_scl => 'present',
}

The same method of enable/ensure can be used with the CR repo via enable_cr and ensure_cr.

To install the CentOS base and updates source repos

class { 'repo_centos':
  ensure_source => 'present',
}

Reference

Classes

Public classes

  • repo_centos: Configs all the managed CentOS yumrepo resources.

Private classes

  • repo_centos::base: Configures base yumrepo.
  • repo_centos::contrib: Configures contrib yumrepo.
  • repo_centos::cr: Configures cr yumrepo.
  • repo_centos::debug: Configures debug yumrepo.
  • repo_centos::extras: Configures extras yumrepo.
  • repo_centos::fasttrack: Configures fasttrack yumrepo.
  • repo_centos::params: Defines default parameter values.
  • repo_centos::plus: Configures centosplus yumrepo.
  • repo_centos::scl: Configures scl yumrepo.
  • repo_centos::source: Configures source yumrepos.
  • repo_centos::updates: Configures updates yumrepo.
  • repo_centos::compat::start: Removes yumrepo resources previously managed by this module
  • repo_centos::compat::end: Removes the repo files previously managed by this module

Parameters

repo_centos

#####enable_mirrorlist

Boolean to decide if the yumrepo mirrorlist or the baseurl are used (defaults to true).

#####repourl

The base repo URL. Defaults to http://mirror.centos.org/centos.

#####debug_repourl

The base repo URL for centos-debug. Defaults to http://debuginfo.centos.org

#####source_repourl

The base repo URL for source repos. Defaults to http://vault.centos.org/centos

#####mirrorlisturl

The mirrorlist URL. Defaults to 'http://mirrorlist.centos.org'

#####enable_base

Boolean to decide if the CentOS Base Repo should be enabled (defaults to true).

#####enable_contrib

Boolean to decide if the CentOS User Contrib Repo should be enabled (defaults to false).

#####enable_cr

Boolean to decide if the CentOS Continuous Release Repo should be enabled (defaults to false).

#####enable_extras

Boolean to decide if the CentOS Extras Repo should be enabled (defaults to true).

#####enable_plus

Boolean to decide if the CentOS Plus Repo should be enabled (defaults to false).

#####enable_scl

Boolean to decide if the CentOS SCL Repo should be enabled (defaults to false).

This only affects to CentOS 6.

#####enable_updates

Boolean to decide if the CentOS Updates Repo should be enabled (defaults to true).

#####enable_fasttrack

Boolean to decide if the CentOS Fasttrack Repo should be enabled (defaults to false).

#####enable_source

Boolean to decide if the CentOS source repos should be enabled (defaults to false).

#####enable_debug

Boolean to decide if the CentOS debug repo should be enabled (defaults to false).

#####ensure_cr

Ensure parameter for the CR repo (defaults to undef). By default only CentOS 7 has the CR repo present.

#####ensure_scl

Ensure parameter for the SCL repo (defaults to undef). By default the repo is absent.

This only affects CentOS 6.

#####ensure_source

Ensure parameter for the source repos (defaults to absent).

#####attempt_compatibility_mode

Boolean to decide if compatibility classes should be included that are intended to help transition to version 4.x of this module (defaults to false).

Development

Testing

Make sure you have:

  • rake
  • bundler

Install the necessary gems:

bundle install

Run the tests from root of the source code:

bundle exec rake test

You can also run acceptance tests:

bundle exec rake beaker