Version information
This version is compatible with:
This module has been deprecated by its author since Sep 28th 2017.
The reason given was: This module has been moved to the care of Vox Pupuli where it is now being maintained and updated.
The author has suggested puppet-mrepo as its replacement.
Start using this module
Documentation
Puppet Mrepo
This module creates and synchronizes rpm based repositories by managing mrepo.
Synopsis
Install and configure a basic mrepo installation
node default {
class { 'mrepo': }
}
Override default values and enable redhat network support for use in other classes
class { 'mrepo::params':
selinux => true,
rhn => true,
rhn_username => 'user',
rhn_password => 'pass',
}
Or using Hiera for parameters (same example)
code: class { 'mrepo': }
Hiera: mrepo::params::selinux: true mrepo::params::rhn: true mrepo::params::rhn_username: user mrepo::params::rhn_password: pass
Mirror multiple centos 5 repositories
mrepo::repo { 'centos5-x86_64':
ensure => present,
update => 'nightly',
repotitle => 'CentOS 5.6 64 bit',
arch => 'x86_64',
release => '5.6',
urls => {
addons => 'rsync://mirrors.kernel.org/centos/$release/addons/$arch/',
centosplus => 'rsync://mirrors.kernel.org/centos/$release/centosplus/$arch/',
updates => 'rsync://mirrors.kernel.org/centos/$release/updates/$arch/',
}
}
mrepo::repo { 'centos5-i386':
ensure => present,
update => 'nightly',
repotitle => 'CentOS 5.6 64 bit',
arch => 'i386',
release => '5.6',
urls => {
addons => 'rsync://mirrors.kernel.org/centos/$release/addons/$arch/',
centosplus => 'rsync://mirrors.kernel.org/centos/$release/centosplus/$arch/',
updates => 'rsync://mirrors.kernel.org/centos/$release/updates/$arch/',
}
}
Mirror multiple rhel channels
mrepo::repo { 'rhel6server-x86_64':
ensure => present,
update => 'nightly',
repotitle => 'Red Hat Enterprise Linux Server $release ($arch)',
rhn => true,
type => 'rhn',
arch => 'x86_64',
release => '6',
typerelease => '6Server',
iso => 'rhel-server-6.0-$arch-dvd.iso',
urls => {
updates => 'rhns:///rhel-$arch-server-$release',
vt => 'rhns:///rhel-$arch-server-vt-$release',
supplementary => 'rhns:///rhel-$arch-server-supplementary-$release',
fasttrack => 'rhns:///rhel-$arch-server-fasttrack-$release',
hts => 'rhns:///rhel-$arch-server-hts-$release',
rhn-tools => 'rhns:///rhn-tools-rhel-$arch-server-$release',
}
}
Usage
If you need to customize the mrepo default settings, include the mrepo::params class and include the appropriate variables. Else, you should be able to use the mrepo::repo by itself to instantiate repositories.
For class/define specific documentation, view the puppet doc in the given file.
Prerequisites
This module expects the following modules to be available:
- puppetlabs-apache
- puppetlabs-stdlib
- puppetlabs-vcsrepo
It also is configured for a redhat derived system and makes assumptions about the available users and groups. Alternate parameters may override these assumptions.
Mirror data can grow extremely large, so you will want to ensure that src_root is located on a large volume.
If you are planning on using ISOs, you will also need fuse-iso.
Repository URL formatting
You can take advantage of the variables that mrepo itself supports when defining a repository or ISO to mirror. Mrepo uses the following variables:
- $dist is set to the title of the resource
- $arch is set to the arch parameter
- $nick is set to $dist-$arch
- $repo is set to the key of the specific repository
- $release is set to the release parameter
Note that these are variables within mrepo; if you are using them, make sure to surround the string in single quotes so puppet doesn't try to expand them.
So this:
mrepo::repo { 'centos5-x86_64':
ensure => present,
update => 'nightly',
repotitle => 'CentOS 5.6 64 bit',
arch => 'x86_64',
release => '5.6',
urls => {
addons => 'rsync://mirrors.kernel.org/centos/$release/$repo/$arch/',
centosplus => 'rsync://mirrors.kernel.org/centos/$release/$repo/$arch/',
updates => 'rsync://mirrors.kernel.org/centos/$release/$repo/$arch/',
}
}
Is equivalent to this:
mrepo::repo { 'centos5-x86_64':
ensure => present,
update => 'nightly',
repotitle => 'CentOS 5.6 64 bit',
arch => 'x86_64',
release => '5.6',
addons => 'rsync://mirrors.kernel.org/centos/5.6/addons/x86_64/',
centosplus => 'rsync://mirrors.kernel.org/centos/5.6/centosplus/x86_64/',
updates => 'rsync://mirrors.kernel.org/centos/5.6/updates/x86_64/',
}
}
Be warned that you can make a repository with the name of 'release'; however, this will overwrite the actual release variable. If you have a repository with a name of release, change the key to something else, and explicitly define the url instead of using a variable.
For full details on how mrepo is used, see the mrepo usage page.
Caveats
SELinux
Default SELinux policy prevents the httpd context from manipulating loopback devices without having an explicit httpd context. This can be corrected by changing the context as a mount option for a regular mount. However, fuseiso does not have the capability to change selinux contexts. If you are planning on mounting ISOs, either do so as root, change the httpd context to permit fuseiso to run using audit2allow, or disable SELinux. If neither of these are viable options, you can locate and mirror an outside repository of the ISO data.
Further clarification of this issue can be found on the repoforge tools list.
Fuse ISO
Fuse iso is not available in any yum repository. You will need to locate an RPM or source file and install it for yourself. In addition, if you are using a non-root user to mount the ISOs, you will need to ensure that the user is in the 'fuse' group.
CHANGELOG
1.2.1
A small release to address some previous issues and errors.
- Removed non-root user cron jobs
- Fixed issue in which the grep string did not match the mount point of the ISO
- The summary in metadata used to throw an error, it has been shortened to fix this
1.2.0
- Add ability specify package source protocol other than git
- Add ability to specify source version other than latest
- Add ability to use ip_based vhost
- Fix some RHN related issues.
- Add ability to specify releases and release types (eg, 6Server)
- Add ability to customize mrepo command, options, environment vars
- Add
mrepo::repos
for hiera integration.
1.1.1
NOTE: This version requires puppetlabs/apache 0.6.0, which is a backwards incompatible release. If you are using that module elsewhere then you'll need to resolve the upgrade for apache first.
- Manage /var/log/mrepo.log so that mrepo user can write to it while running
- Remove dependency cycle when using mrepo with apache
- Don't use
undef
for rhn username or password
1.1.0
- Correct invalid Modulefile dependency
- Changes to conform to style guide.
- Allow tuning of email recipient
- Add in mrepo::exports class
- Add in support for creating NFS shares of mrepo disks. This is primarily needed for mirroring and building on SLES.
1.0.0
This is a backwards incompatible release.
- Split out mirroring for RHN and NCC repositories, since they have nontrivial amounts of logic needed to authenticate to the mirror source.
- Add hour parameter to mrepo::repo define to permit staggering synchronization time.
- Add mrepo::iso define. This will copy ISOs from to the mrepo host for mirroring from ISOs. This adds a dependency on nanliu-staging
- Clean up repository name munging by extracting the logic into a Puppet function.
- Respect mrepo docroot for apache
Dependencies
- puppetlabs/apache (>= 0.6.0 < 2.0.0)
- puppetlabs/vcsrepo (>= 0.0.3 < 2.0.0)
- puppetlabs/stdlib (>= 0.1.6 < 5.0.0)
- nanliu/staging (>= 0.1.0 < 2.0.0)
Copyright 2011 Puppet Labs 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.