cookbook 'yumrepo_server', '= 0.2.1'
yumrepo_server (10) Versions 0.2.1 Follow3
Installs/Configures Yum repository server
cookbook 'yumrepo_server', '= 0.2.1', :supermarket
knife supermarket install yumrepo_server
knife supermarket download yumrepo_server
yumrepo_server Cookbook
This cookbook configures a Yum repository to be served from your system. It will automatically install and configure the Apache web server (as it's the only server that's available without requiring the EPEL yum repo). It also install the createrepo package for the utilities needed to setup a directory as a yum source.
Requirements
Ruby 1.9 or later
cookbooks
apache2
logrotate
packages
-
httpd
- needed to serve the packages in the repository -
createrepo
- needed to setup the repository -
logrotate
- needed by the httpd package to configure log file management
platforms
Any system that uses Yum and has the required pakcages
Attributes
yumrepo_server::default
['yum']['server']['repo_base_dir']
Type: String
Description: The base directory where the repositories will be configured. Will be used as Apache's DocumentRoot
Default: /var/lib/yum-repo['yum']['server']['http_aliases']
Type: Array
Description: An array of server name aliases to plug in to the httpd config
Default: [] (empty array)['yum']['server']['http_port']
Type: Integer
Description: The server port to plug in to the httpd config
Default: 80['apache']['include_logrotate']
Type: Boolean
Description: Flag to determine if logrotate will be configured for Apache logs
Default: true
Usage
Recipes
yumrepo_server::default
Just include yumrepo_server
in your node's run_list
:
{ "name":"my_node", "run_list": [ "recipe[yumrepo_server]" ] }
LWRPs
yumrepo_server
:create action
Create a yum repository inside of the relative path given (will be rooted at node['yum']['server']['repo_base_dir'])
With implied directory
yumrepo_server 'relative/yum/repo/path' do action :create options "-v --quiet" # An optional string of options to pass to the createrepo command remote_source "http://upstream.com/path" # An optional URL string used as a base to retrieve packages from packages %w(pkg1.rpm pkg2.rpm pkg3.rpm) # An optional array of package names to be configured in the repo (default is all packages). Required with the :remote_source attribute to specify which packages to retrieve. end
With explicit directory
yumrepo_server 'creates my yum repo' do action :create dir 'relative/yum/repo/path' # Required relative path to create repo at (this value will be appended to the value of node['yum']['server']['repo_base_dir']) options "-v --quiet" # An optional string of options to pass to the createrepo command remote_source "http://upstream.com/path" # An optional URL string used as a base to retrieve packages from packages %w(pkg1.rpm pkg2.rpm pkg3.rpm) # An optional array of package names to be configured in the repo (default is all packages). Required with the :remote_source attribute to specify which packages to retrieve. end
:update action
Update the the yum repository at the path given
yumrepo_server 'relative/yum/repo/path' do action :update options "-v --quiet" # An optional string of options to pass to the createrepo command end
:delete action
Deletes the repository at the given path (basically delete the directory)
yumrepo_server 'relative/yum/repo/path' do action :delete end
License and Authors
Authors: Michael Morris
License: 3-clause BSD
Dependent cookbooks
apache2 ~> 3.1 |
logrotate >= 0.0.0 |
Contingent cookbooks
There are no cookbooks that are contingent upon this one.
yumrepo_server CHANGELOG
0.1.0
- [mmmorris1975] - Initial release of yumrepo_server
0.1.1
- [mmmorris1975] - Added node['ipaddress'] to the array of server_alias values in the web_app lwrp
- [mmmorris1975] - Added test kitchen, removed Fedora from supported platforms.
0.1.2
- [mmmorris1975] - Added attribute to pass in custom httpd ServerAlias values
- [mmmorris1975] - Updated file headers to include correct copyright/license info
0.1.3
- [mmmorris1975] - Changed bundle process from tar to 'knife cookbook site share'
0.1.4
- [gimler] - Added option to specify http port
0.1.5
- [mmmorris1975] - Fixed GitHub issue #2, adding conditional guard in 'ensure' block for lwrp :create action
0.2.0
- [mmmorris1975] - Changes required to support Centos 7 to install yum repo. (should still be Chef 11 compliant!)
0.2.1
- [mmmorris1975] - Address issue #3, removed invalid Apache 2.4 directives 'Order' and 'RewriteLog'
- [mmmorris1975] - Added additional serverspec test to run
httpd -t
to test Apache syntax
Foodcritic Metric
0.2.1 passed this metric
0.2.1 passed this metric