Skip to content

Commit

Permalink
[COOK-675] - add yum::epel recipe
Browse files Browse the repository at this point in the history
  • Loading branch information
jtimberman committed Aug 19, 2011
1 parent 2571079 commit 21c5e25
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 3 deletions.
15 changes: 12 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,17 @@ Changes

## v.0.1.2:

* Remove yum update in default recipe, that doesn't update caches, it
updates packages installed.
* Remove yum update in default recipe, that doesn't update caches, it updates packages installed.

Requirements
============
RHEL, CentOS or Scientific Linux 5.x or newer. It has not been tested on other platforms or earlier versions. RHEL 6 support is untested (testing and patches are welcome).

Attributes
==========

* `node['yum']['epel_release']` - Set the epel release version based on `node['platform_version']`.

Recipes
=======

Expand All @@ -28,6 +32,11 @@ yum
---
Manages the configuration of the `/etc/yum.conf` via attributes.

epel
----

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.

Resources/Providers
===================

Expand Down Expand Up @@ -75,6 +84,7 @@ This LWRP provides an easy way to manage additional YUM repositories. GPG keys c
- url: The URL providing the packages
- mirrorlist: Default is `false`, if `true` the `url` is considered a list of mirrors
- key: Optional, the name of the GPG key file installed by the `key` LWRP.

- enabled: Default is `1`, set to `0` if the repository is disabled.
- type: Optional, alternate type of repository
- failovermethod: Optional, failovermethod
Expand Down Expand Up @@ -124,4 +134,3 @@ distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

10 changes: 10 additions & 0 deletions attributes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,13 @@
# Example: override.yum.exclude = "kernel* compat-glibc*"
default[:yum][:exclude]
default[:yum][:installonlypkgs]


default['yum']['epel_release'] = case node['platform_version'].to_i
when "6"
"6-5"
when "5"
"5-4"
when "4"
"4-10"
end
25 changes: 25 additions & 0 deletions recipes/epel.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#
# Author:: Joshua Timberman (<[email protected]>)
# Cookbook Name:: yum
# Recipe:: epel
#
# Copyright:: Copyright (c) 2011 Opscode, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

major = node['platform_version'].to_i
epel = node['yum']['epel_release']

rpm_package "epel-release" do
source "http://download.fedoraproject.org/pub/epel/#{major}/i386/epel-release-#{epel}.noarch.rpm"
end

0 comments on commit 21c5e25

Please sign in to comment.