- Overview
- Module Description - What the module does and why it is useful
- Setup - The basics of getting started with createrepo
- Usage - Configuration options and additional functionality
- Reference - An under-the-hood peek at what the module is doing and how
- Limitations - OS compatibility, etc.
- Development - Guide for contributing to the module
- Issues
The createrepo module allows you to create and update yum repositories.
Breaking changes: Version 3.0.0 changes the enable_cron
setting. If set to false
the cron job will not be created and an update will not be performed on agent runs. An option to update on agent runs enable_update
is introduced to re-enable this functionality. If you were setting enable_cron
to false
then you need to set enable_update
to true
to maintain the same functionality.
Yum repositories are a distribution method for RPM packages usually served via HTTP. The createrepo module creates yum repositories and it's metadata caches. It also provides mechanisms to update the repositories with an optional cron job and an update script, which is useful for post hooks in CI environments.
It does not manage the directory tree up to the root of the repository and does neither make any attempt to manage a HTTP server for repository clients.
- repository and cache directories
- createrepo package
- cron jobs for repo updates (optional)
- an update script, placed in /usr/local/bin by default
Basic example:
createrepo { 'yumrepo':
repository_dir => '/var/yumrepos/yumrepo',
repo_cache_dir => '/var/cache/yumrepos/yumrepo'
}
The module provides a single define
so as many repositories can be created as needed, usually at least stable and testing repos are created.
Older versions of yum do not support some later default checksum types. From the createrepo
man page:
Choose the checksum type used in repomd.xml and for packages in the metadata. The default is now
"sha256" (if python has hashlib). The older default was "sha", which is actually "sha1", however explicitly
using "sha1" doesn’t work on older (3.0.x) versions of yum, you need to specify "sha".
createrepo
provides a checksum_type parameter to change the checksum type.
The path to the base directory of the repository. Here, or in subdirectories you store the .rpm files
- Default:
/var/yumrepos/${name}
Path to a checksum directory. Makes updates to repository much faster.
- Default:
/var/cache/yumrepos/${name}
Owner of the repository directory.
- Default:
root
Group of the repository directory.
- Default:
root
Mode of the repository directory.
- Default: '0775'
Enable recursive managing of the repository directory.
- Default: false
Ignore-list for recursive managing of the repository directory.
- Default: undef
Set the SELinux type for the repository directory.
- Default:
httpd_sys_content_t
Enable regular repository updates via cron.
- Default:
true
Enable automatic repository updates during the puppet run.
- Default:
false
Minute parameter for cron metadata update job.
- Default:
*/10
Hour parameter for cron metadata update job.
- Default:
*
Number of changelog entries to import into metadata.
- Default:
5
Sets the checksum type for repomd.xml. This needs to be set to sha
if createrepo
is defined on a RHEL/CentOS 6 host and is accessed by RHEL/CentOS 5 or earlier clients.
- Default:
undef
Location of the repository update script file.
- Default:
/usr/local/bin/createrepo-update-${name}
Redirect stdout output from cron to /dev/null.
- Default:
false
Redirect stderr output from cron to /dev/null.
- Default:
false
Number of workers to spawn to read RPMs.
- Default:
undef
Yum repository groupfile. Creates the repository metadata with supplied group information.
- Default:
undef
Exec timeout for createrepo commands. Can be useful when repositories are huge. Can even be set to 0 to disable timeouts.
- Default:
300
Manage the repository directory. If false the repository and cache directories must be created manually/externally.
- Default:
true
Should the cron/script clean up old rpm versions for each rpm?
- Default:
false
Set how many versions of each rpm to keep.
- Default:
2
Prevents corruption of the repodata, when multiple createrepo processes start building repodata at the same time. (eg in combination with incrond)
- Default:
false
full path/name of the lockfile
- Default:
/tmp/createrepo-update-${name}.lock
Name of the createrepo
package and command to use. Can be used to use /usr/bin/createrepo_c
instead of
/usr/bin/createrepo
.
- Default:
createrepo
The path of the createrepo binary to use. Allows, combined with setting
createrepo_package
, to select /usr/bin/createrepo_c
instead of /usr/bin/createrepo
.
- Default:
/usr/bin/createrepo
See Usage
createrepo is rspec tested on Puppet 3.8-4.x latest and beaker tested on CentOS 6, 7 and Ubuntu 14.04 with Puppet latest.
-
Fork the repo.
-
Run the tests. We only take pull requests with passing tests, and it's great to know that you have a clean slate
-
Add a test for your change. Only refactoring and documentation changes require no new tests. If you are adding functionality or fixing a bug, please add a test.
-
Make the test pass.
-
Push to your fork and submit a pull request.
This project contains tests for both rspec-puppet and beaker-rspec to verify functionality. For in-depth information please see their respective documentation.
Quickstart:
gem install bundler
bundle install
bundle exec rake spec
bundle exec rspec spec/acceptance
BEAKER_debug=yes bundle exec rspec spec/acceptance
BEAKER_set=centos-70-x64 bundle exec rspec spec/acceptance
BEAKER_set=debian-78-x64 bundle exec rspec spec/acceptance
Please log tickets and issues in the createrepo GitHub issue tracker