Please review pull request #253: Tickets/master/11263 opened by (jamtur01)

Description:

Two patches:

  1. The metadata_expire option of the yumrepo type has the wrong regex match for it’s available options. We only match seconds but the option can in fact take:

metadata_expire Time (in seconds) after which the metadata will expire. So that if the current metadata downloaded is less than this many seconds old then yum will not update the metadata against the repository. If you find that yum is not downloading information on updates as often as you would like lower the value of this option. You can also change from the default of using seconds to using days, hours or minutes by appending a d, h or m respectively. The default is 6 hours, to compliment yum-updatesd running once an hour. It’s also possible to use the word “never”, meaning that the metadata will never expire. Note that when using a metalink file the metalink must always be newer than the metadata for the repository, due to the validation, so this timeout also applies to the metalink file.

  1. Added a number of new yumrepo attributes that were missing from the type.

  • Opened: Wed Dec 07 22:01:11 UTC 2011
  • Based on: puppetlabs:master (3406081b3d91bb796f8fa666d22a05054fda42f4)
  • Requested merge: jamtur01:tickets/master/11263 (110751133e4760a9ccd87e63706b87aa27af85b1)

Diff follows:

diff --git a/lib/puppet/type/yumrepo.rb b/lib/puppet/type/yumrepo.rb
index 830b5d7..b264ee3 100644
--- a/lib/puppet/type/yumrepo.rb
+++ b/lib/puppet/type/yumrepo.rb
@@ -221,6 +221,22 @@ def flush
       newvalue(/.*/) { }
     end
 
+    newproperty(:mirrorlist_expire, :parent => Puppet::IniProperty) do
+      desc "Time (in seconds) after which the mirrorlist locally cached
+        will expire.\n#{ABSENT_DOC}"
+      newvalue(:absent) { self.should = :absent }
+      # Should really check that it's a valid URL
+      newvalue(%r{[0-9]+}) { }
+    end
+
+    newproperty(:metalink, :parent => Puppet::IniProperty) do
+      desc "Specifies a URL to a metalink file for the repomd.xml.
+        #{ABSENT_DOC}"
+      newvalue(:absent) { self.should = :absent }
+      # Should really check that it's a valid URL
+      newvalue(/.*/) { }
+    end
+
     newproperty(:baseurl, :parent => Puppet::IniProperty) do
       desc "The URL for this repository. #{ABSENT_DOC}"
       newvalue(:absent) { self.should = :absent }
@@ -251,6 +267,20 @@ def flush
       newvalue(/.*/) { }
     end
 
+    newproperty(:gpgcakey, :parent => Puppet::IniProperty) do
+      desc "The URL for the GPG CA key for this repository. #{ABSENT_DOC}"
+      newvalue(:absent) { self.should = :absent }
+      # Should really check that it's a valid URL
+      newvalue(/.*/) { }
+    end
+
+    newproperty(:repo_gpgcheck, :parent => Puppet::IniProperty) do
+      desc "This tells yum whether or not it should perform a GPG
+        signature check on the repodata from this repository. #{ABSENT_DOC}"
+      newvalue(:absent) { self.should = :absent }
+      newvalue(%r{(0|1)}) { }
+    end
+
     newproperty(:include, :parent => Puppet::IniProperty) do
       desc "The URL of a remote file containing additional yum configuration
         settings. Puppet does not check for this file's existence or validity.
@@ -287,7 +317,7 @@ def flush
       desc "The failover methode for this repository; should be either
         `roundrobin` or `priority`. #{ABSENT_DOC}"
       newvalue(:absent) { self.should = :absent }
-      newvalue(%r{roundrobin|priority}) { }
+      newvalue(%r{(roundrobin|priority)}) { }
     end
 
     newproperty(:keepalive, :parent => Puppet::IniProperty) do
@@ -297,11 +327,18 @@ def flush
       newvalue(%r{(0|1)}) { }
     end
 
-     newproperty(:http_caching, :parent => Puppet::IniProperty) do
-       desc "What to cache from this repository. #{ABSENT_DOC}"
-       newvalue(:absent) { self.should = :absent }
-       newvalue(%r(packages|all|none)) { }
-     end
+    newproperty(:http_caching, :parent => Puppet::IniProperty) do
+      desc "What to cache from this repository. #{ABSENT_DOC}"
+      newvalue(:absent) { self.should = :absent }
+      newvalue(%r{(packages|all|none)}) { }
+    end
+
+    newproperty(:skip_if_unavailable, :parent => Puppet::IniProperty) do
+      desc "Control whether yum will continue running if this repository
+        cannot be contacted for any reason.\n#{ABSENT_DOC}"
+      newvalue(:absent) { self.should = :absent }
+      newvalue(%r{(0|1)}) { }
+    end
 
     newproperty(:timeout, :parent => Puppet::IniProperty) do
       desc "Number of seconds to wait for a connection before timing
@@ -310,11 +347,19 @@ def flush
       newvalue(%r{[0-9]+}) { }
     end
 
+    newproperty(:retries, :parent => Puppet::IniProperty) do
+      desc "Set the number of times any attempt to retrieve a file should
+        retry before returning an error. Setting this to `0` makes yum 
+       try forever.\n#{ABSENT_DOC}"
+      newvalue(:absent) { self.should = :absent }
+      newvalue(%r{[0-9]+}) { } 
+    end
+
     newproperty(:metadata_expire, :parent => Puppet::IniProperty) do
       desc "Number of seconds after which the metadata will expire.
         #{ABSENT_DOC}"
       newvalue(:absent) { self.should = :absent }
-      newvalue(%r{[0-9]+}) { }
+      newvalue(%r{[0-9]+[d|h|m]?|never}) { }
     end
 
     newproperty(:protect, :parent => Puppet::IniProperty) do
@@ -339,6 +384,25 @@ def flush
       newvalue(%r{\d+}) { }
     end
 
+    newproperty(:throttle, :parent => Puppet::IniProperty) do
+      desc "Enable bandwidth throttling for downloads. This option
+        can be expressed as a absolute data rate in bytes/sec or a
+        percentage `60%`. An SI prefix (k, M or G) may be appended
+        to the data rate values.\n#{ABSENT_DOC}"
+      newvalue(:absent) { self.should = :absent }
+      newvalue(%r{[.0-9]+[k|M|G|%]?}) { }
+    end
+
+    newproperty(:bandwidth, :parent => Puppet::IniProperty) do
+      desc "Use to specify the maximum available network bandwidth
+        in bytes/second. Used with the `throttle` option. If `throttle`
+        is a percentage and `bandwidth` is `0` then bandwidth throttling
+        will be disabled. If `throttle` is expressed as a data rate then
+        this option is ignored.\n#{ABSENT_DOC}"
+      newvalue(:absent) { self.should = :absent }
+      newvalue(%r{[.0-9]+[k|M|G]?}) { }
+    end
+
     newproperty(:proxy, :parent => Puppet::IniProperty) do
       desc "URL to the proxy server for this repository. #{ABSENT_DOC}"
       newvalue(:absent) { self.should = :absent }

    

--
You received this message because you are subscribed to the Google Groups "Puppet Developers" group.
To post to this group, send email to puppet-dev@googlegroups.com.
To unsubscribe from this group, send email to puppet-dev+unsubscr...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/puppet-dev?hl=en.

Reply via email to