rackspace-cookbooks/rackspace_cloudbackup — pull request #20 by steve-jansen (2014-12-10 15:59:12+00:00)
Title: Use the yum-epel community cookbook on rhel/centos

Hi @martinb3

This PR refactors the `yum_repository 'epel'` resource to use the [`yum-epel` community cookbook](https://supermarket.chef.io/cookbooks/yum-epel) instead.

This avoids contention and duplication of resources between `yum_repository 'epel'` resource and `yum-epel` when the converge already includes `yum-epel::default` elsewhere (which is very likely on rhel/centos).

In our case, our base role sees contention like this over `/etc/yum.repos.d/epel.repo`

```
INFO: template[/etc/yum.repos.d/epel.repo] updated file contents /etc/yum.repos.d/epel.repo

- update content in file /etc/yum.repos.d/epel.repo from c3f673 to b89733
--- /etc/yum.repos.d/epel.repo 2014-12-10 06:10:08.408304982 +0000
+++ /tmp/chef-rendered-template20141210-4263-bkmtog 2014-12-10 14:19:30.408367358 +0000
@@ -2,7 +2,7 @@
# Do NOT modify this file by hand.

[epel]
-name=Extra Packages for Enterprise Linux
+name=Extra Packages for Enterprise Linux 6 - $basearch
enabled=1
failovermethod=priority
gpgcheck=1
```
...

```
- update content in file /etc/yum.repos.d/epel.repo from b89733 to c3f673
--- /etc/yum.repos.d/epel.repo	2014-12-10 14:29:48.864885067 +0000
+++ /tmp/chef-rendered-template20141210-5243-9086hc	2014-12-10 14:30:03.884806863 +0000
@@ -2,7 +2,7 @@
# Do NOT modify this file by hand.

[epel]
-name=Extra Packages for Enterprise Linux 6 - $basearch
+name=Extra Packages for Enterprise Linux
enabled=1
failovermethod=priority
gpgcheck=1
```

This then needlessly creates a cascade of notification actions to rebuild the yum cache. This happens on every converge when nothing has really changed. (See below for example).

There are also a few other small commits to make testing happy with the latest dependencies.

Enjoy,
Steve

```
[2014-12-10T14:30:04+00:00] INFO: template[/etc/yum.repos.d/epel.repo] sending run action to execute[yum-makecache-epel] (immediate)
* execute[yum-makecache-epel] action run[2014-12-10T14:30:04+00:00] INFO: Processing execute[yum-makecache-epel] action run (/tmp/kitchen/cache/cookbooks/yum/providers/repository.rb line 55)
[2014-12-10T14:30:09+00:00] INFO: execute[yum-makecache-epel] ran successfully

- execute yum -q makecache --disablerepo=* --enablerepo=epel

[2014-12-10T14:30:09+00:00] INFO: template[/etc/yum.repos.d/epel.repo] sending create action to ruby_block[yum-cache-reload-epel] (immediate)
* ruby_block[yum-cache-reload-epel] action create[2014-12-10T14:30:09+00:00] INFO: Processing ruby_block[yum-cache-reload-epel] action create (/tmp/kitchen/cache/cookbooks/yum/providers/repository.rb line 61)
[2014-12-10T14:30:09+00:00] INFO: ruby_block[yum-cache-reload-epel] called

- execute the ruby block yum-cache-reload-epel
[2014-12-10T14:30:09+00:00] INFO: template[/etc/yum.repos.d/epel.repo] sending run action to execute[yum-makecache-epel] (immediate)
* execute[yum-makecache-epel] action run[2014-12-10T14:30:09+00:00] INFO: Processing execute[yum-makecache-epel] action run (/tmp/kitchen/cache/cookbooks/yum/providers/repository.rb line 55)
[2014-12-10T14:30:14+00:00] INFO: execute[yum-makecache-epel] ran successfully

- execute yum -q makecache --disablerepo=* --enablerepo=epel

[2014-12-10T14:30:14+00:00] INFO: template[/etc/yum.repos.d/epel.repo] sending create action to ruby_block[yum-cache-reload-epel] (immediate)
* ruby_block[yum-cache-reload-epel] action create[2014-12-10T14:30:14+00:00] INFO: Processing ruby_block[yum-cache-reload-epel] action create (/tmp/kitchen/cache/cookbooks/yum/providers/repository.rb line 61)
[2014-12-10T14:30:14+00:00] INFO: ruby_block[yum-cache-reload-epel] called

- execute the ruby block yum-cache-reload-epel
* execute[yum-makecache-epel] action nothing
[2014-12-10T14:30:14+00:00] INFO: Processing execute[yum-makecache-epel] action nothing (/tmp/kitchen/cache/cookbooks/yum/providers/repository.rb line 55)
(skipped due to action :nothing)
* ruby_block[yum-cache-reload-epel] action nothing[2014-12-10T14:30:14+00:00] INFO: Processing ruby_block[yum-cache-reload-epel] action nothing (/tmp/kitchen/cache/cookbooks/yum/providers/repository.rb line 61)
(skipped due to action :nothing)
```