This cookbook allows you to mirror remote Yum repos and serve them up via NGINX.
Requires Chef 12.5 or later as this cookbook makes use of Custom Resources.
Key | Type | Description | Default |
---|---|---|---|
['yumserver']['basepath'] | String | Where to store mirroed yum repos. | /var/lib/yum-rep |
Key | Type | Description | Default |
---|---|---|---|
['yumserver']['nginx']['config_cookbook'] | String | Which cookbook to use for the NGINX config template. | yumserver |
['yumserver']['nginx']['servername'] | String | Server name to use in NGINX config. | node['fqdn'] |
You always need to include the main recipe:
include_recipe 'yumserver::default'
This creates the basepath
and installs the following packages:
- yum-utils
- createrepo
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.
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 |
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
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: BSD 2-clause
Authors: