Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Merge branch 'COOK-1130'

  • Loading branch information...
commit 088de88f029e70770845892fc363a6bd0c8f8275 2 parents 125fe0a + 87b2e74
Joshua Timberman jtimberman authored
123 README.md
Source Rendered
... ... @@ -1,62 +1,97 @@
1   -Description
2   -===========
  1 +# Yum
3 2
4   -Configures various YUM components on Red Hat-like systems. Includes LWRP for managing repositories and their GPG keys.
  3 +## Description
5 4
6   -Based on the work done by Eric Wolfe and Charles Duffy on the yumrepo cookbook. http://github.com/atomic-penguin/cookbooks/tree/yumrepo/yumrepo
  5 +Configures various YUM components on Red Hat-like systems. Includes
  6 +LWRP for managing repositories and their GPG keys.
7 7
  8 +<<<<<<< HEAD
8 9 Requirements
9 10 ============
10 11 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).
  12 +=======
  13 +Based on the work done by Eric Wolfe and Charles Duffy on the
  14 +[yumrepo](https://github.com/atomic-penguin/cookbook-yumrepo) cookbook.
  15 +>>>>>>> yum.exclude usage and documentation is not clear.
11 16
12   -Attributes
13   -==========
  17 +## Requirements
14 18
15   -* `node['yum']['epel_release']` - Set the epel release version based on `node['platform_version']`.
16   -* `node['yum']['ius_release']` - Set the IUS release to install.
  19 +RedHat Enterprise Linux 5, and 6 distributions within this platform family.
17 20
18   -Recipes
19   -=======
  21 +## Attributes
20 22
21   -default
22   --------
23   -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.
  23 +* `yum['exclude']`
  24 + - An array containing a list of packages to exclude from updates or
  25 + installs. Wildcards and shell globs are supported.
  26 + - Defaults to an empty exclude list.
24 27
25   -yum
26   ----
27   -Manages the configuration of the `/etc/yum.conf` via attributes.
  28 +* `yum['installonlypkgs']`
  29 + - An array containing a list of packages which should only be
  30 + installed, never updated.
  31 + - Defaults to an empty install-only list.
28 32
29   -epel
30   -----
  33 +* `yum['epel_release']`
  34 + - Set the epel release version based on `node['platform_version']`.
  35 + - Defaults to the most current release of EPEL, based on the major
  36 + version of your platform release.
31 37
  38 +<<<<<<< HEAD
32 39 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.
33 40
34 41 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.
  42 +=======
  43 +* `yum['ius_release']`
  44 + - Set the IUS release to install.
  45 + - Defaults to the current release of the IUS repo.
  46 +>>>>>>> yum.exclude usage and documentation is not clear.
  47 +
  48 +## Recipes
  49 +
  50 +### default
  51 +
  52 +The default recipe does nothing.
  53 +
  54 +### yum
35 55
36   -ius
37   -----
  56 +Manages the configuration of the `/etc/yum.conf` via attributes. See
  57 +the aforementioned Array attributes `yum['exclude']` and
  58 +`yum['installonlypkgs']`.
38 59
39   -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.
  60 +### epel
40 61
41   -The IUS repository requires EPEL, and the recipe includes `yum::epel` to install this.
  62 +Installs the EPEL repository via RPM. Uses the `yum['epel_release']`
  63 +attribute to select the right version of the repository package to
  64 +install. Also uses the node's platform version (as an integer) for the
  65 +major release of EL.
42 66
43   -Resources/Providers
44   -===================
  67 +### ius
45 68
46   -key
47   ----
48   -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.
  69 +Installs the [IUS Community repositories](http://iuscommunity.org/Repos)
  70 +via RPM. Uses the `node['yum']['ius_release']` attribute to select the
  71 +right versino of the package to install.
  72 +
  73 +The IUS repository requires EPEL, and includes `yum::epel` as a
  74 +dependency.
  75 +
  76 +## Resources/Providers
  77 +
  78 +### key
  79 +
  80 +This LWRP handles importing GPG keys for YUM repositories. Keys can be
  81 +imported by the `url` parameter or placed in `/etc/pki/rpm-gpg/` by a
  82 +recipe and then installed with the LWRP without passing the URL.
  83 +
  84 +#### Actions
49 85
50   -# Actions
51 86 - :add: installs the GPG key into `/etc/pki/rpm-gpg/`
52 87 - :remove: removes the GPG key from `/etc/pki/rpm-gpg/`
53 88
54   -# Attribute Parameters
  89 +#### Attribute Parameters
55 90
56 91 - key: name attribute. The name of the GPG key to install.
57 92 - url: if the key needs to be downloaded, the URL providing the download.
58 93
59   -# Example
  94 +#### Example
60 95
61 96 ``` ruby
62 97 # add the Zenoss GPG key
@@ -71,16 +106,19 @@ yum_key "RPM-GPG-KEY-zenoss" do
71 106 end
72 107 ```
73 108
74   -repository
75   -----------
76   -This LWRP provides an easy way to manage additional YUM repositories. GPG keys can be managed with the `key` LWRP.
  109 +### repository
  110 +
  111 +This LWRP provides an easy way to manage additional YUM repositories.
  112 +GPG keys can be managed with the `key` LWRP. The LWRP automatically
  113 +updates the package management cache upon the first run, when a new
  114 +repo is added.
77 115
78   -# Actions
  116 +#### Actions
79 117
80 118 - :add: creates a repository file and builds the repository listing
81 119 - :remove: removes the repository file
82 120
83   -# Attribute Parameters
  121 +#### Attribute Parameters
84 122
85 123 - repo_name: name attribute. The name of the channel to discover
86 124 - description. The description of the repository
@@ -93,7 +131,7 @@ This LWRP provides an easy way to manage additional YUM repositories. GPG keys c
93 131 - failovermethod: Optional, failovermethod
94 132 - bootstrapurl: Optional, bootstrapurl
95 133
96   -# Example
  134 +#### Example
97 135
98 136 ``` ruby
99 137 # add the Zenoss repository
@@ -110,13 +148,16 @@ yum_repository "zenoss" do
110 148 end
111 149 ```
112 150
113   -Usage
114   -=====
  151 +## Usage
  152 +
  153 +Put `recipe[yum::yum]` in the run list to ensure yum is configured
  154 +correctly for your environment within your Chef run.
115 155
116   -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.
  156 +You can manage GPG keys either with cookbook_file in a recipe if you
  157 +want to package it with a cookbook or use the `url` parameter of the
  158 +`key` LWRP.
117 159
118   -License and Author
119   -==================
  160 +## License and Author
120 161
121 162 Author:: Eric G. Wolfe
122 163 Author:: Matt Ray (<matt@opscode.com>)
4 attributes/default.rb
@@ -19,8 +19,8 @@
19 19 #
20 20
21 21 # Example: override.yum.exclude = "kernel* compat-glibc*"
22   -default[:yum][:exclude]
23   -default[:yum][:installonlypkgs]
  22 +default['yum']['exclude'] = Array.new
  23 +default['yum']['installonlypkgs'] = Array.new
24 24
25 25 default['yum']['epel_release'] = case node['platform_version'].to_i
26 26 when 6
8 metadata.rb
@@ -3,16 +3,16 @@
3 3 license "Apache 2.0"
4 4 long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
5 5 version "0.5.3"
6   -recipe "yum", "Runs 'yum update' during compile phase"
7   -recipe "yum::yum", "manages yum configuration"
  6 +recipe "yum", "Empty recipe."
  7 +recipe "yum::yum", "Manages yum configuration"
8 8
9   -%w{ redhat centos scientific }.each do |os|
  9 +%w{ redhat centos scientific amazon }.each do |os|
10 10 supports os, ">= 5.0"
11 11 end
12 12
13 13 attribute "yum/exclude",
14 14 :display_name => "yum.conf exclude",
15   - :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.",
  15 + :description => "List of packages to exclude from updates or installs. This should be an array. Shell globs using wildcards (eg. * and ?) are allowed.",
16 16 :required => "optional"
17 17
18 18 attribute "yum/installonlypkgs",
2  recipes/yum.rb
@@ -19,5 +19,5 @@
19 19 #
20 20
21 21 template "/etc/yum.conf" do
22   - source "yum-rhel#{node[:platform_version].to_i}.conf.erb"
  22 + source "yum-rhel#{node['platform_version'].to_i}.conf.erb"
23 23 end
10 templates/default/yum-rhel5.conf.erb
... ... @@ -1,4 +1,4 @@
1   -# Generated by Chef for <%= node[:fqdn] %>
  1 +# Generated by Chef for <%= node['fqdn'] %>
2 2 # Local modifications will be overwritten.
3 3 [main]
4 4 cachedir=/var/cache/yum
@@ -11,11 +11,11 @@ exactarch=1
11 11 obsoletes=1
12 12 gpgcheck=1
13 13 plugins=1
14   -<%- if node[:yum][:exclude] %>
15   -exclude=<%= node[:yum][:exclude].join(" ") %>
  14 +<%- unless node['yum']['exclude'].empty? %>
  15 +exclude=<%= node['yum']['exclude'].join(" ") %>
16 16 <%- end %>
17   -<%- if node[:yum][:installonlypkgs] %>
18   -installonlypkgs=<%= node[:yum][:installonlypkgs].join(" ") %>
  17 +<%- unless node['yum']['installonlypkgs'].empty? %>
  18 +installonlypkgs=<%= node['yum']['installonlypkgs'].join(" ") %>
19 19 <%- end %>
20 20
21 21 # Note: yum-RHN-plugin doesn't honor this.
10 templates/default/yum-rhel6.conf.erb
... ... @@ -1,4 +1,4 @@
1   -# Generated by Chef for <%= node[:fqdn] %>
  1 +# Generated by Chef for <%= node['fqdn'] %>
2 2 # Local modifications will be overwritten.
3 3 [main]
4 4 cachedir=/var/cache/yum/$basearch/$releasever
@@ -10,11 +10,11 @@ obsoletes=1
10 10 gpgcheck=1
11 11 plugins=1
12 12 installonly_limit=3
13   -<%- if node[:yum][:exclude] %>
14   -exclude=<%= node[:yum][:exclude].join(" ") %>
  13 +<%- unless node['yum']['exclude'].empty? %>
  14 +exclude=<%= node['yum']['exclude'].join(" ") %>
15 15 <%- end %>
16   -<%- if node[:yum][:installonlypkgs] %>
17   -installonlypkgs=<%= node[:yum][:installonlypkgs].join(" ") %>
  16 +<%- unless node['yum']['installonlypkgs'].empty? %>
  17 +installonlypkgs=<%= node['yum']['installonlypkgs'].join(" ") %>
18 18 <%- end %>
19 19
20 20 # 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.
Something went wrong with that request. Please try again.