Permalink
Browse files

[COOK-1653] - fix mirrorlist in yum_repository

* makes "url" in the yum_repository only affect baseurl in yum config
  file
* mirrorlist can be a string to the URI of the mirrorlist
  • Loading branch information...
1 parent c16fec7 commit 33b543b7faa953c48b58330af4aeec102bcc2b04 @jtimberman jtimberman committed Oct 4, 2012
Showing with 16 additions and 6 deletions.
  1. +13 −5 README.md
  2. +1 −1 resources/repository.rb
  3. +2 −0 templates/default/repo.erb
View
@@ -122,20 +122,28 @@ repo is added.
- :add: creates a repository file and builds the repository listing (default)
- :remove: removes the repository file
+- :update: updates the repository
#### Attribute Parameters
- repo_name: name attribute. The name of the channel to discover
- description. The description of the repository
-- 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.
-
+- url: The URL providing the packages, used for baseurl in the config
+- mirrorlist: Set this as a string containing the URI to the
+ mirrorlist, start with "http://", "ftp://", "file://"; use "file://"
+ if the mirrorlist is a text file on the system.
+- 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
- bootstrapurl: Optional, bootstrapurl
-- make_cache: Optional, Default is `true`, if `false` then `yum -q makecache` will not be ran
+- make_cache: Optional, Default is `true`, if `false` then `yum -q
+ makecache` will not be ran
+
+*Note*: When using both url (to set baseurl) and mirrorlist, it is probably a
+good idea to also install the fastestmirror plugin, and use
+failovermethod "priority".
### Example
@@ -22,7 +22,7 @@
#name of the repo, used for .repo filename
attribute :repo_name, :kind_of => String, :name_attribute => true
attribute :description, :kind_of => String #long description
-attribute :url, :kind_of => String
+attribute :url, :kind_of => String, :default => ""
attribute :mirrorlist, :default => false
attribute :key, :kind_of => String, :default => nil
attribute :enabled, :default => 1
@@ -5,7 +5,9 @@ name=<%= @description %>
<% if @type %>
type=<%= @type %>
<% end %>
+<% unless @url.empty? -%>
baseurl=<%= @url %>
+<% end -%>
<% if @mirrorlist %>
mirrorlist=<%= @mirrorlist %>
<% end %>

0 comments on commit 33b543b

Please sign in to comment.