Permalink
Browse files

Merge branch 'COOK-1130'

  • Loading branch information...
2 parents 125fe0a + 87b2e74 commit 088de88f029e70770845892fc363a6bd0c8f8275 @jtimberman jtimberman committed Jun 7, 2012
Showing with 99 additions and 58 deletions.
  1. +82 −41 README.md
  2. +2 −2 attributes/default.rb
  3. +4 −4 metadata.rb
  4. +1 −1 recipes/yum.rb
  5. +5 −5 templates/default/yum-rhel5.conf.erb
  6. +5 −5 templates/default/yum-rhel6.conf.erb
View
123 README.md
@@ -1,62 +1,97 @@
-Description
-===========
+# Yum
-Configures various YUM components on Red Hat-like systems. Includes LWRP for managing repositories and their GPG keys.
+## Description
-Based on the work done by Eric Wolfe and Charles Duffy on the yumrepo cookbook. http://github.com/atomic-penguin/cookbooks/tree/yumrepo/yumrepo
+Configures various YUM components on Red Hat-like systems. Includes
+LWRP for managing repositories and their GPG keys.
+<<<<<<< HEAD
Requirements
============
RHEL, CentOS or Scientific Linux 5.x or newer, or Amazon Linux. It has not been tested on other platforms or earlier versions. RHEL 6 support is untested (testing and patches are welcome).
+=======
+Based on the work done by Eric Wolfe and Charles Duffy on the
+[yumrepo](https://github.com/atomic-penguin/cookbook-yumrepo) cookbook.
+>>>>>>> yum.exclude usage and documentation is not clear.
-Attributes
-==========
+## Requirements
-* `node['yum']['epel_release']` - Set the epel release version based on `node['platform_version']`.
-* `node['yum']['ius_release']` - Set the IUS release to install.
+RedHat Enterprise Linux 5, and 6 distributions within this platform family.
-Recipes
-=======
+## Attributes
-default
--------
-The default recipe runs `yum update` during the Compile Phase of the Chef run to ensure that the system's package cache is updated with the latest. It is recommended that this recipe appear first in a node's run list (directly or through a role) to ensure that when installing packages, Chef will be able to download the latest version available on the remote YUM repository.
+* `yum['exclude']`
+ - An array containing a list of packages to exclude from updates or
+ installs. Wildcards and shell globs are supported.
+ - Defaults to an empty exclude list.
-yum
----
-Manages the configuration of the `/etc/yum.conf` via attributes.
+* `yum['installonlypkgs']`
+ - An array containing a list of packages which should only be
+ installed, never updated.
+ - Defaults to an empty install-only list.
-epel
-----
+* `yum['epel_release']`
+ - Set the epel release version based on `node['platform_version']`.
+ - Defaults to the most current release of EPEL, based on the major
+ version of your platform release.
+<<<<<<< HEAD
On RHEL, CentOS, or Scientific Linux, installs the EPEL repository via RPM. Uses the `node['yum']['epel_release']` attribute to select the right version of the repository package to install. Also uses the node's platform version (as an integer) for the major release of EL.
On Amazon Linux, the built-in EPEL repository is activated using `yum-config-manager --quiet --enable epel`. This ignores the `node['yum']['epel_release']` attribute in favor of the version configured in the Amazon Linux AMI.
+=======
+* `yum['ius_release']`
+ - Set the IUS release to install.
+ - Defaults to the current release of the IUS repo.
+>>>>>>> yum.exclude usage and documentation is not clear.
+
+## Recipes
+
+### default
+
+The default recipe does nothing.
+
+### yum
-ius
-----
+Manages the configuration of the `/etc/yum.conf` via attributes. See
+the aforementioned Array attributes `yum['exclude']` and
+`yum['installonlypkgs']`.
-Installs the [IUS Community repositories](http://iuscommunity.org/Repos) via RPM. Uses the `node['yum']['ius_release']` attribute to select the right versino of the package to install.
+### epel
-The IUS repository requires EPEL, and the recipe includes `yum::epel` to install this.
+Installs the EPEL repository via RPM. Uses the `yum['epel_release']`
+attribute to select the right version of the repository package to
+install. Also uses the node's platform version (as an integer) for the
+major release of EL.
-Resources/Providers
-===================
+### ius
-key
----
-This LWRP handles importing GPG keys for YUM repositories. Keys can be imported by the `url` parameter or placed in `/etc/pki/rpm-gpg/` by a recipe and then installed with the LWRP without passing the URL.
+Installs the [IUS Community repositories](http://iuscommunity.org/Repos)
+via RPM. Uses the `node['yum']['ius_release']` attribute to select the
+right versino of the package to install.
+
+The IUS repository requires EPEL, and includes `yum::epel` as a
+dependency.
+
+## Resources/Providers
+
+### key
+
+This LWRP handles importing GPG keys for YUM repositories. Keys can be
+imported by the `url` parameter or placed in `/etc/pki/rpm-gpg/` by a
+recipe and then installed with the LWRP without passing the URL.
+
+#### Actions
-# Actions
- :add: installs the GPG key into `/etc/pki/rpm-gpg/`
- :remove: removes the GPG key from `/etc/pki/rpm-gpg/`
-# Attribute Parameters
+#### Attribute Parameters
- key: name attribute. The name of the GPG key to install.
- url: if the key needs to be downloaded, the URL providing the download.
-# Example
+#### Example
``` ruby
# add the Zenoss GPG key
@@ -71,16 +106,19 @@ yum_key "RPM-GPG-KEY-zenoss" do
end
```
-repository
-----------
-This LWRP provides an easy way to manage additional YUM repositories. GPG keys can be managed with the `key` LWRP.
+### repository
+
+This LWRP provides an easy way to manage additional YUM repositories.
+GPG keys can be managed with the `key` LWRP. The LWRP automatically
+updates the package management cache upon the first run, when a new
+repo is added.
-# Actions
+#### Actions
- :add: creates a repository file and builds the repository listing
- :remove: removes the repository file
-# Attribute Parameters
+#### Attribute Parameters
- repo_name: name attribute. The name of the channel to discover
- description. The description of the repository
@@ -93,7 +131,7 @@ This LWRP provides an easy way to manage additional YUM repositories. GPG keys c
- failovermethod: Optional, failovermethod
- bootstrapurl: Optional, bootstrapurl
-# Example
+#### Example
``` ruby
# add the Zenoss repository
@@ -110,13 +148,16 @@ yum_repository "zenoss" do
end
```
-Usage
-=====
+## Usage
+
+Put `recipe[yum::yum]` in the run list to ensure yum is configured
+correctly for your environment within your Chef run.
-Put `recipe[yum]` first in the run list to ensure `yum update` is run before other recipes. You can manage GPG keys either with cookbook_file in a recipe if you want to package it with a cookbook or use the `url` parameter of the `key` LWRP.
+You can manage GPG keys either with cookbook_file in a recipe if you
+want to package it with a cookbook or use the `url` parameter of the
+`key` LWRP.
-License and Author
-==================
+## License and Author
Author:: Eric G. Wolfe
Author:: Matt Ray (<matt@opscode.com>)
View
@@ -19,8 +19,8 @@
#
# Example: override.yum.exclude = "kernel* compat-glibc*"
-default[:yum][:exclude]
-default[:yum][:installonlypkgs]
+default['yum']['exclude'] = Array.new
+default['yum']['installonlypkgs'] = Array.new
default['yum']['epel_release'] = case node['platform_version'].to_i
when 6
View
@@ -3,16 +3,16 @@
license "Apache 2.0"
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version "0.5.3"
-recipe "yum", "Runs 'yum update' during compile phase"
-recipe "yum::yum", "manages yum configuration"
+recipe "yum", "Empty recipe."
+recipe "yum::yum", "Manages yum configuration"
-%w{ redhat centos scientific }.each do |os|
+%w{ redhat centos scientific amazon }.each do |os|
supports os, ">= 5.0"
end
attribute "yum/exclude",
:display_name => "yum.conf exclude",
- :description => "List of packages to exclude from updates or installs. This should be a space separated list. Shell globs using wildcards (eg. * and ?) are allowed.",
+ :description => "List of packages to exclude from updates or installs. This should be an array. Shell globs using wildcards (eg. * and ?) are allowed.",
:required => "optional"
attribute "yum/installonlypkgs",
View
@@ -19,5 +19,5 @@
#
template "/etc/yum.conf" do
- source "yum-rhel#{node[:platform_version].to_i}.conf.erb"
+ source "yum-rhel#{node['platform_version'].to_i}.conf.erb"
end
@@ -1,4 +1,4 @@
-# Generated by Chef for <%= node[:fqdn] %>
+# Generated by Chef for <%= node['fqdn'] %>
# Local modifications will be overwritten.
[main]
cachedir=/var/cache/yum
@@ -11,11 +11,11 @@ exactarch=1
obsoletes=1
gpgcheck=1
plugins=1
-<%- if node[:yum][:exclude] %>
-exclude=<%= node[:yum][:exclude].join(" ") %>
+<%- unless node['yum']['exclude'].empty? %>
+exclude=<%= node['yum']['exclude'].join(" ") %>
<%- end %>
-<%- if node[:yum][:installonlypkgs] %>
-installonlypkgs=<%= node[:yum][:installonlypkgs].join(" ") %>
+<%- unless node['yum']['installonlypkgs'].empty? %>
+installonlypkgs=<%= node['yum']['installonlypkgs'].join(" ") %>
<%- end %>
# Note: yum-RHN-plugin doesn't honor this.
@@ -1,4 +1,4 @@
-# Generated by Chef for <%= node[:fqdn] %>
+# Generated by Chef for <%= node['fqdn'] %>
# Local modifications will be overwritten.
[main]
cachedir=/var/cache/yum/$basearch/$releasever
@@ -10,11 +10,11 @@ obsoletes=1
gpgcheck=1
plugins=1
installonly_limit=3
-<%- if node[:yum][:exclude] %>
-exclude=<%= node[:yum][:exclude].join(" ") %>
+<%- unless node['yum']['exclude'].empty? %>
+exclude=<%= node['yum']['exclude'].join(" ") %>
<%- end %>
-<%- if node[:yum][:installonlypkgs] %>
-installonlypkgs=<%= node[:yum][:installonlypkgs].join(" ") %>
+<%- unless node['yum']['installonlypkgs'].empty? %>
+installonlypkgs=<%= node['yum']['installonlypkgs'].join(" ") %>
<%- end %>
# This is the default, if you make this bigger yum won't see if the metadata

0 comments on commit 088de88

Please sign in to comment.