cookbook 'yumserver', '~> 2.1.0'
yumserver (12) Versions 2.1.0 Follow3
Installs/Configures yumserver & mirrors remote repos.
cookbook 'yumserver', '~> 2.1.0', :supermarket
knife supermarket install yumserver
knife supermarket download yumserver
yumserver Cookbook
Table of Contents
Overview
This cookbook allows you to mirror remote Yum repos and serve them up via NGINX.
Requirements
Requires Chef 12.5 or later as this cookbook makes use of Custom Resources.
Attributes
yumserver::default
Key | Type | Description | Default |
---|---|---|---|
['yumserver']['basepath'] | String | Where to store mirroed yum repos. | /var/lib/yum-rep |
Usage
You always need to include the main recipe:
include_recipe 'yumserver::default'
This creates the basepath
and installs the following packages:
- yum-utils
- createrepo
- rsync
Additionally the recipe calls yumserver::_nginx
which;
- Sets-up the upstream NGINX repo.
- Installs
nginx
. - Configures
nginx
to serve up thebasepath
. - Manages the
nginx
service.
yumserver_mirror
Each Yum repo you wish to mirror can be defined using the yumserver_mirror
custom resource.
Each yumserver_mirror
has the following attributes:
Attribute | Type | Description | Default |
---|---|---|---|
name | String or Symbol | Resource name. | N/A |
local_path | String | The basepath where the repo should be stored. | /var/lib/yum-repo |
repo_name | String | Name of the Yum repo. | N/A |
repo_description | String | Description of the Yum repo. | N/A |
repo_baseurl | String | Base URL of the Yum repo. | N/A |
options | String | Additional options to pass to reposync . |
N/A |
timeout | Integer | Timeout for the reposync command. |
600 |
use_repo | Boolean | If the repo should be availble for the yumserver to use. | true |
repo_workers | Integer | Number of createrepo workers to start up. | server cpu count |
To Mirror EPEL for EL7 for example:
yumserver_mirror 'epel7' do repo_name 'epel' repo_description 'Extra Packages for Enterprise Linux 7' repo_baseurl 'https://dl.fedoraproject.org/pub/epel/7/x86_64/' action :create end
yumserver_rsync_mirror
Each Yum repo you wish to mirror that provides an rsync endpoint can be defined using the yumserver_rsync_mirror
custom resource.
Each yumserver_rsync_mirror
has the following attributes:
Attribute | Type | Description | Default |
---|---|---|---|
name | String or Symbol | Resource name. | N/A |
local_path | String | The basepath where the repo should be stored. | /var/lib/yum-repo |
repo_name | String | Name of the Yum repo. | N/A |
repo_description | String | Description of the Yum repo. | N/A |
repo_url | String | URL of the Yum repo. | N/A |
timeout | Integer | Timeout for the rsync command. |
600 |
rsync_options | String | Options to pass to rsync. | -aHS --numeric-ids --delete --delete-delay --delay-updates |
use_repo | Boolean | If the repo should be availble for the yumserver to use. | true |
To Mirror EPEL for EL7 for example:
yumserver_rsync_mirror 'epel7' do repo_name 'epel' repo_description 'Extra Packages for Enterprise Linux 7' repo_url 'rsync://dl.fedoraproject.org/pub/epel/7/x86_64/' action :create end
Contributing
If you would like to contribute to this cookbook please follow these steps;
- Fork the repository on Github.
- Create a named feature branch (like
add_component_x
). - Write your change.
- Write tests for your change (if applicable).
- Run the tests, ensuring they all pass.
- Submit a Pull Request using Github.
License and Authors
License: BSD 2-clause
Authors:
Dependent cookbooks
nginx_server >= 1.0.1 |
zap >= 0.10.0 |
yum >= 3.5.2 |
Contingent cookbooks
There are no cookbooks that are contingent upon this one.
2017-01-05 - Release 2.1.0
Summary
Additional features for custom resources.
Features
- Added a
timeout
option for bothyumserver_mirror
&yumserver_rsync_mirror
. - Added an
options
option foryumserver_mirror
allowing you to add additional options to the reposync command.
2016-02-14
Summary
Minor bug fix.
Bugfixes
- Fixed a bug that meant the
node['yumserver']['basepath']
attribute wasn't honoured by theyumserver_mirror
&yumserver_rsync_mirror
resources.
2016-02-11
Summary
Minor bug fix after a fault was found in production with this cookbook.
Bugfixes
- The path defined by the
yumserver_mirror
resource was incorrect. This was causing thezap
feature to fail on runs after the first. Fixing the defined path in this resource fixed the error withzap
.
2016-02-09
Summary
Major release with additional features/bug fixes that may break backwards compatibility.
Features
- Now using
mixlib-shellout
instead of exec resources foryumserver_mirrror
resources. - The
createrepo
command ran as part ofyumserver_mirror
resources are now multi-threaded. - Add
zap
support for/etc/resposync.repos.d
. - Now uses the
nginx_server
cookbook to provide the web server.
Bugfixes
- Fixed a typo in the
yumserver_mirror
resource that prevented the reposync config from beign remove on a:delete
action.
2015-12-02
Summary
Small bugfix update to make the delete action work properly across custom resources.
Bugfixes
- In the mirror resource make sure the reposync file gets deleted by switching the resource type to file instead of template.
- In both resources make sure the base path is deleted recursively (otherwise it will fail as there are packages in them).
2015-11-25 1.3.0
Summary
Large bugix release to ensure mirrored repos are properly updated after the 1st sync.
Bugfixes
- Made
reposync
in themirror
resource use alternate yum.conf & repo directory to allow them all to be enabled (enabling updates) whithout interfering with the system's yum. - Made the metadata on
reposync
in themirror
resource expire immedietly so package changes are synced more often than every 6 hours.
2015-11-22 - Release 1.2.0
Summary
General improvements to mirror resources.
Features
- Optionally (
true
by default) create ayum_repository
to allow the yumserver to use it's mirrored repos. - The
yumserver_mirror
resource now correctly removes packages no longer in the upstream repo. - The
yumserver_mirror
should complete quicker when no packages are updated.
Bugfixes
- Disable mirrored repos to avoid issues such as mirroring the same repo for two versions of the same distro and causing update issues on the yumserver.
2015-11-12 - Release 1.1.1
Summary
Let Yum repo servers use their own rsync mirrors as repos.
Features
- For each
yumserver_rsync_mirror
create ayum_repository
so the Yum server can use that repo if it needs it.
2015-11-10 - Release 1.1.0
Summary
Added the ability to mirror a repo that is available via rsync.
Features
- Mirror yum repos that provide rsync as an option.
Bugfixes
- Add regression test.
2015-11-10 - Release 1.0.2
Summary
Fix NGINX config.
Bugfixes
2015-10-11 - Release 1.0.1
Summary
Minor doc updates.
2015-10-11 - Release 1.0.0
Summary
Initial release. Includes basic functionality.
Features
- Mirrors Yum repos.
- Serves Yum repos via NGINX.
Collaborator Number Metric
2.1.0 failed this metric
Failure: Cookbook has 0 collaborators. A cookbook must have at least 2 collaborators to pass this metric.
Contributing File Metric
2.1.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a CONTRIBUTING.md file
Foodcritic Metric
2.1.0 failed this metric
FC108: Resource should not define a property named 'name': yumserver/resources/mirror.rb:1
FC108: Resource should not define a property named 'name': yumserver/resources/rsync_mirror.rb:1
Run with Foodcritic Version 16.3.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any
No Binaries Metric
2.1.0 passed this metric
Testing File Metric
2.1.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
2.1.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number
2.1.0 failed this metric
2.1.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a CONTRIBUTING.md file
Foodcritic Metric
2.1.0 failed this metric
FC108: Resource should not define a property named 'name': yumserver/resources/mirror.rb:1
FC108: Resource should not define a property named 'name': yumserver/resources/rsync_mirror.rb:1
Run with Foodcritic Version 16.3.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any
No Binaries Metric
2.1.0 passed this metric
Testing File Metric
2.1.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
2.1.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number
2.1.0 failed this metric
FC108: Resource should not define a property named 'name': yumserver/resources/rsync_mirror.rb:1
Run with Foodcritic Version 16.3.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any
2.1.0 passed this metric
Testing File Metric
2.1.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
2.1.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number
2.1.0 failed this metric
2.1.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number