Version information
This version is compatible with:
Start using this module
Add this module to your Puppetfile:
mod 'treydock-repo_centos', '4.0.0'
Learn more about managing modules with a PuppetfileDocumentation
puppet-repo_centos
####Table of Contents
- Overview
- Backwards Compatibility - 4.x
- Usage - Configuration options
- Reference - Parameter and detailed reference to all options
- 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 modulerepo_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
treydock-repo_centos changelog
Release notes for the treydock-repo_centos module.
4.0.0 - 2017/01/30
This release is a major refactor of this module to use the repo files shipped with CentOS.
- Rename all yumrepo resources (except source repos) to match the names used by CentOS
- Do not remove yum repo files that are installed by the OS packages
- Remove management of CentOS GPG keys
- The source repos are no longer present by default
- The SCL repo on CentOS 6 is no longer present by default
- The CR repo is only present by default for CentOS 7
- Remove 'ensure' parameters for all repos except cr, scl and source
- Do not set 'enable' parameters for base, extras and updates if they are enabled (maintain CentOS defaults)
- Use augeas to define all repos
- Use stages to ensure CentOS repositories come before other resources
- Module requires presence of operatingsystemmajrelease fact
- Add compat classes to attempt a "smooth" upgrade from 3.x to 4.x of this module
- Updates to travis-ci test matrix
3.0.2 - 2015/12/17
- Fix gpgkey used for debug repositories on CentOS 5
3.0.1 - 2015/04/10
- Add treydock/gpg_key module dependency back as it was accidentally removed
3.0.0 - 2015/04/10
This release is the first under new author that contains backwards incompatible changes.
Backwards incompatible changes:
- By default mirrorlist is now set for repos but can be overridden using
enable_mirrorlist
parameter. Default mirrorlist values are that of stock CentOS repo files shipped with the operating system
Features:
- Manage fasttrack repo
- Manage source repos
- Manage debuginfo repo
- Remove management of the contents for CentOS GPG keys
- Updates to development dependencies, rake tasks and travis-ci test coverage
2.0.0 - 2014/04/01
This major release
Detailed Changes:
- Use the Anchor pattern to order the classes so existing repo files are removed before new repos added.
- Use Package resource collector to ensure this module runs before any managed Package resources
- Add dependency treydock-gpg_key to manage GPG keys replacing the repo_centos::rpm_gpg_key defined type
- Remove CentOS-Vault.repo and CentOS-SCL.repo files
- Add newline to GPG keys so they aren't unnecessarily replaced
- Remove os_maj_version fact in favor of using external facts in the following order:
- facter's operatingsystemmajrelease
- another module's os_maj_version
- inline template parsing facter's operatingsystemrelease fact
- Cleanup code to pass puppet-lint tests (proper variable scopes, spacing ,etc)
- Add rspec-puppet unit testing
- Add beaker-rspec system tests
- NOTE: The
should_not
matchers do not work despite the module correctly disabling yumrepo resources and removing repo files.
- NOTE: The
New in 0.1.0 - 2013/02/06
Initial release.
This module is based on the following puppetlabs module: http://github.com/stahnma/puppet-module-puppetlabs_yum
Dependencies
- puppetlabs/stdlib (>=2.0.0 <5.0.0)
Copyright 2015 Trey Dockendorf Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.