Skip to content

Commit

Permalink
Import yum version 0.5.2
Browse files Browse the repository at this point in the history
  • Loading branch information
xdissent committed Dec 18, 2011
1 parent 319197a commit f57fbb2
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 8 deletions.
8 changes: 6 additions & 2 deletions cookbooks/yum/README.md
Expand Up @@ -8,10 +8,14 @@ Based on the work done by Eric Wolfe and Charles Duffy on the yumrepo cookbook.
Changes
=======

## v0.5.2:

* [COOK-825] - epel and ius `remote_file` should notify the `rpm_package` to install

## v0.5.0:

* COOK-675: add recipe for handling EPEL repository
* COOK-722: add recipe for handling IUS repository
* [COOK-675] - add recipe for handling EPEL repository
* [COOK-722] - add recipe for handling IUS repository

## v.0.1.2:

Expand Down
4 changes: 2 additions & 2 deletions cookbooks/yum/metadata.json
@@ -1,7 +1,7 @@
{
"name": "yum",
"description": "A fabulous new cookbook",
"long_description": "Description\n===========\n\nConfigures various YUM components on Red Hat-like systems. Includes LWRP for managing repositories and their GPG keys.\n\nBased on the work done by Eric Wolfe and Charles Duffy on the yumrepo cookbook. http://github.com/atomic-penguin/cookbooks/tree/yumrepo/yumrepo\n\nChanges\n=======\n\n## v0.5.0:\n\n* COOK-675: add recipe for handling EPEL repository\n* COOK-722: add recipe for handling IUS repository\n\n## v.0.1.2:\n\n* Remove yum update in default recipe, that doesn't update caches, it updates packages installed.\n\nRequirements\n============\nRHEL, 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).\n\nAttributes\n==========\n\n* `node['yum']['epel_release']` - Set the epel release version based on `node['platform_version']`.\n* `node['yum']['ius_release']` - Set the IUS release to install.\n\nRecipes\n=======\n\ndefault\n-------\nThe 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.\n\nyum\n---\nManages the configuration of the `/etc/yum.conf` via attributes.\n\nepel\n----\n\nInstalls 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.\n\nius\n----\n\nInstalls 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.\n\nThe IUS repository requires EPEL, and the recipe includes `yum::epel` to install this.\n\nResources/Providers\n===================\n\nkey\n---\nThis 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.\n\n# Actions\n- :add: installs the GPG key into `/etc/pki/rpm-gpg/`\n- :remove: removes the GPG key from `/etc/pki/rpm-gpg/`\n\n# Attribute Parameters\n\n- key: name attribute. The name of the GPG key to install.\n- url: if the key needs to be downloaded, the URL providing the download.\n\n# Example\n\n``` ruby\n# add the Zenoss GPG key\nyum_key \"RPM-GPG-KEY-zenoss\" do\n url \"http://dev.zenoss.com/yum/RPM-GPG-KEY-zenoss\"\n action :add\nend\n \n# remove Zenoss GPG key\nyum_key \"RPM-GPG-KEY-zenoss\" do\n action :remove\nend\n```\n\nrepository\n----------\nThis LWRP provides an easy way to manage additional YUM repositories. GPG keys can be managed with the `key` LWRP.\n\n# Actions\n\n- :add: creates a repository file and builds the repository listing\n- :remove: removes the repository file\n\n# Attribute Parameters\n\n- repo_name: name attribute. The name of the channel to discover\n- description. The description of the repository\n- url: The URL providing the packages\n- mirrorlist: Default is `false`, if `true` the `url` is considered a list of mirrors\n- key: Optional, the name of the GPG key file installed by the `key` LWRP.\n\n- enabled: Default is `1`, set to `0` if the repository is disabled.\n- type: Optional, alternate type of repository\n- failovermethod: Optional, failovermethod\n- bootstrapurl: Optional, bootstrapurl\n\n# Example\n\n``` ruby\n# add the Zenoss repository\nyum_repository \"zenoss\" do\n name \"Zenoss Stable repo\"\n url \"http://dev.zenoss.com/yum/stable/\"\n key \"RPM-GPG-KEY-zenoss\"\n action :add\nend\n \n# remove Zenoss repo\nyum_repository \"zenoss\" do\n action :remove\nend\n```\n\nUsage\n=====\n\nPut `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.\n\nLicense and Author\n==================\n\nAuthor:: Eric G. Wolfe\nAuthor:: Matt Ray (<matt@opscode.com>)\nAuthor:: Joshua Timberman (<joshua@opscode.com>)\n\nCopyright:: 2010 Tippr Inc.\nCopyright:: 2011 Eric G. Wolfe\nCopyright:: 2011 Opscode, Inc.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n",
"long_description": "Description\n===========\n\nConfigures various YUM components on Red Hat-like systems. Includes LWRP for managing repositories and their GPG keys.\n\nBased on the work done by Eric Wolfe and Charles Duffy on the yumrepo cookbook. http://github.com/atomic-penguin/cookbooks/tree/yumrepo/yumrepo\n\nChanges\n=======\n\n## v0.5.2:\n\n* [COOK-825] - epel and ius `remote_file` should notify the `rpm_package` to install\n\n## v0.5.0:\n\n* [COOK-675] - add recipe for handling EPEL repository\n* [COOK-722] - add recipe for handling IUS repository\n\n## v.0.1.2:\n\n* Remove yum update in default recipe, that doesn't update caches, it updates packages installed.\n\nRequirements\n============\nRHEL, 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).\n\nAttributes\n==========\n\n* `node['yum']['epel_release']` - Set the epel release version based on `node['platform_version']`.\n* `node['yum']['ius_release']` - Set the IUS release to install.\n\nRecipes\n=======\n\ndefault\n-------\nThe 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.\n\nyum\n---\nManages the configuration of the `/etc/yum.conf` via attributes.\n\nepel\n----\n\nInstalls 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.\n\nius\n----\n\nInstalls 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.\n\nThe IUS repository requires EPEL, and the recipe includes `yum::epel` to install this.\n\nResources/Providers\n===================\n\nkey\n---\nThis 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.\n\n# Actions\n- :add: installs the GPG key into `/etc/pki/rpm-gpg/`\n- :remove: removes the GPG key from `/etc/pki/rpm-gpg/`\n\n# Attribute Parameters\n\n- key: name attribute. The name of the GPG key to install.\n- url: if the key needs to be downloaded, the URL providing the download.\n\n# Example\n\n``` ruby\n# add the Zenoss GPG key\nyum_key \"RPM-GPG-KEY-zenoss\" do\n url \"http://dev.zenoss.com/yum/RPM-GPG-KEY-zenoss\"\n action :add\nend\n \n# remove Zenoss GPG key\nyum_key \"RPM-GPG-KEY-zenoss\" do\n action :remove\nend\n```\n\nrepository\n----------\nThis LWRP provides an easy way to manage additional YUM repositories. GPG keys can be managed with the `key` LWRP.\n\n# Actions\n\n- :add: creates a repository file and builds the repository listing\n- :remove: removes the repository file\n\n# Attribute Parameters\n\n- repo_name: name attribute. The name of the channel to discover\n- description. The description of the repository\n- url: The URL providing the packages\n- mirrorlist: Default is `false`, if `true` the `url` is considered a list of mirrors\n- key: Optional, the name of the GPG key file installed by the `key` LWRP.\n\n- enabled: Default is `1`, set to `0` if the repository is disabled.\n- type: Optional, alternate type of repository\n- failovermethod: Optional, failovermethod\n- bootstrapurl: Optional, bootstrapurl\n\n# Example\n\n``` ruby\n# add the Zenoss repository\nyum_repository \"zenoss\" do\n name \"Zenoss Stable repo\"\n url \"http://dev.zenoss.com/yum/stable/\"\n key \"RPM-GPG-KEY-zenoss\"\n action :add\nend\n \n# remove Zenoss repo\nyum_repository \"zenoss\" do\n action :remove\nend\n```\n\nUsage\n=====\n\nPut `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.\n\nLicense and Author\n==================\n\nAuthor:: Eric G. Wolfe\nAuthor:: Matt Ray (<matt@opscode.com>)\nAuthor:: Joshua Timberman (<joshua@opscode.com>)\n\nCopyright:: 2010 Tippr Inc.\nCopyright:: 2011 Eric G. Wolfe\nCopyright:: 2011 Opscode, Inc.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n",
"maintainer": "Opscode, Inc.",
"maintainer_email": "cookbooks@opscode.com",
"license": "Apache 2.0",
Expand Down Expand Up @@ -56,5 +56,5 @@
"yum": "Runs 'yum update' during compile phase",
"yum::yum": "manages yum configuration"
},
"version": "0.5.0"
"version": "0.5.2"
}
2 changes: 1 addition & 1 deletion cookbooks/yum/metadata.rb
Expand Up @@ -2,7 +2,7 @@
maintainer_email "cookbooks@opscode.com"
license "Apache 2.0"
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version "0.5.0"
version "0.5.2"
recipe "yum", "Runs 'yum update' during compile phase"
recipe "yum::yum", "manages yum configuration"

Expand Down
11 changes: 9 additions & 2 deletions cookbooks/yum/recipes/epel.rb
Expand Up @@ -25,10 +25,17 @@

remote_file "#{Chef::Config[:file_cache_path]}/epel-release-#{epel}.noarch.rpm" do
source "http://download.fedoraproject.org/pub/epel/#{major}/i386/epel-release-#{epel}.noarch.rpm"
not_if "rpm -qa | grep -qx '^epel-release-#{epel}.noarch$'"
not_if "rpm -qa | egrep -qx 'epel-release-#{epel}(|.noarch)'"
notifies :install, "rpm_package[epel-release]", :immediately
end


rpm_package "epel-release" do
source "#{Chef::Config[:file_cache_path]}/epel-release-#{epel}.noarch.rpm"
only_if {::File.exists?("#{Chef::Config[:file_cache_path]}/epel-release-#{epel}.noarch.rpm")}
action :nothing
end

file "epel-release-cleanup" do
path "#{Chef::Config[:file_cache_path]}/epel-release-#{epel}.noarch.rpm"
action :delete
end
10 changes: 9 additions & 1 deletion cookbooks/yum/recipes/ius.rb
Expand Up @@ -24,9 +24,17 @@

remote_file "#{Chef::Config[:file_cache_path]}/ius-release-#{ius}.ius.el#{major}.noarch.rpm" do
source "http://dl.iuscommunity.org/pub/ius/stable/Redhat/#{major}/i386/ius-release-#{ius}.ius.el#{major}.noarch.rpm"
not_if "rpm -qa | grep -qx 'ius-release-#{ius}'"
not_if "rpm -qa | grep -q '^ius-release-#{ius}'"
notifies :install, "rpm_package[ius-release]", :immediately
end

rpm_package "ius-release" do
source "#{Chef::Config[:file_cache_path]}/ius-release-#{ius}.ius.el#{major}.noarch.rpm"
only_if {::File.exists?("#{Chef::Config[:file_cache_path]}/ius-release-#{ius}.ius.el#{major}.noarch.rpm")}
action :nothing
end

file "ius-release-cleanup" do
path "#{Chef::Config[:file_cache_path]}/ius-release-#{ius}.ius.el#{major}.noarch.rpm"
action :delete
end

0 comments on commit f57fbb2

Please sign in to comment.