opscode-cookbooks/yum — pull request #20 by atomic-penguin (2012-10-15 20:03:12+00:00)
Title: COOK-1772 - Simplify management of EPEL with LWRP

[COOK-1772]

When I first authored the yumrepo cookbook, Matt Ray was of the opinion that managing repository files was not something the Yum cookbook should enforce. Rather that cookbook should merely provide an LWRP for configuring repo files. Since then, the yum::epel recipe has evolved into something contrary to the design of its own cookbook. This particular recipe is mixing RPM managed repo files with LWRP managed repo files.

I happen to have been maintaining an EPEL recipe in my yumrepo cookbook all along, which does follow this method of using the LWRP to manage every repo file. Using the LWRP allows you to focus on fixing issues which creep up in the LWRP without having to track every single version of EPEL. As a bonus, this is a sanity check that your LWRP is working. Since this blocks idem-potency on systems using both yum::epel and yumrepo::epel, I motion to adopt the LWRP-EPEL version of the recipe as the better pattern. I will deprecate yumrepo::epel in turn, once this is merged so that further recipe conflict in the future is avoided.

[root@lists ~]# chef-client
[2012-10-15T15:57:02-04:00] INFO: *** Chef 10.14.4 ***
[2012-10-15T15:57:03-04:00] INFO: Run List is [recipe[yum::epel]]
[2012-10-15T15:57:03-04:00] INFO: Run List expands to [yum::epel]
[2012-10-15T15:57:03-04:00] INFO: Starting Chef Run for lists.marshall.edu
[2012-10-15T15:57:03-04:00] INFO: Running start handlers
[2012-10-15T15:57:03-04:00] INFO: Start handlers complete.
[2012-10-15T15:57:03-04:00] INFO: Loading cookbooks [yum]
[2012-10-15T15:57:05-04:00] INFO: Storing updated cookbooks/yum/resources/key.rb in the cache.
[2012-10-15T15:57:05-04:00] INFO: Storing updated cookbooks/yum/resources/repository.rb in the cache.
[2012-10-15T15:57:05-04:00] INFO: Storing updated cookbooks/yum/providers/key.rb in the cache.
[2012-10-15T15:57:05-04:00] INFO: Storing updated cookbooks/yum/providers/repository.rb in the cache.
[2012-10-15T15:57:05-04:00] INFO: Storing updated cookbooks/yum/recipes/epel.rb in the cache.
[2012-10-15T15:57:05-04:00] INFO: Storing updated cookbooks/yum/recipes/repoforge.rb in the cache.
[2012-10-15T15:57:05-04:00] INFO: Storing updated cookbooks/yum/attributes/epel.rb in the cache.
[2012-10-15T15:57:05-04:00] INFO: Storing updated cookbooks/yum/attributes/default.rb in the cache.
[2012-10-15T15:57:05-04:00] INFO: Storing updated cookbooks/yum/Gemfile in the cache.
[2012-10-15T15:57:05-04:00] INFO: Storing updated cookbooks/yum/CHANGELOG.md in the cache.
[2012-10-15T15:57:05-04:00] INFO: Storing updated cookbooks/yum/README.md in the cache.
[2012-10-15T15:57:05-04:00] INFO: Storing updated cookbooks/yum/.gitignore in the cache.
[2012-10-15T15:57:05-04:00] INFO: Storing updated cookbooks/yum/metadata.rb in the cache.
[2012-10-15T15:57:06-04:00] INFO: Chef Run complete in 2.318346333 seconds
[2012-10-15T15:57:06-04:00] INFO: Removing cookbooks/yum/metadata.json from the cache; it is no longer needed by chef-client.
[2012-10-15T15:57:06-04:00] INFO: Removing cookbooks/yum/templates/default/yum-rhel5.conf.erb from the cache; it is no longer needed by chef-client.
[2012-10-15T15:57:06-04:00] INFO: Running report handlers
[2012-10-15T15:57:06-04:00] INFO: Report handlers complete

[root@lists ~]# cat /etc/yum.repos.d/epel.repo
[epel]
name=Extra Packages for Enterprise Linux
mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=epel-5&arch=$basearch
failovermethod=priority
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL