summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2017-09-21 21:12:54 -0700
committerTim Smith <tsmith@chef.io>2017-09-21 21:12:54 -0700
commit9e93d83a451e034c0720b55efce6d8751174a546 (patch)
tree9b69e4e3a9b4943703e425d445529644af5453f9
parentf3605a53528a262a0367e47d2303cb49e7d5e35d (diff)
downloadchef-yum_repo.tar.gz
Add support for metalink and throttle in yum_repositoryyum_repo
metalink shipped in Fedora 10. I'm not sure about throttle as it doesn't google well, but there's references to it going back 5 years at least. Signed-off-by: Tim Smith <tsmith@chef.io>
-rw-r--r--lib/chef/provider/support/yum_repo.erb6
-rw-r--r--lib/chef/resource/yum_repository.rb5
2 files changed, 10 insertions, 1 deletions
diff --git a/lib/chef/provider/support/yum_repo.erb b/lib/chef/provider/support/yum_repo.erb
index 6f1325573d..f60d8688da 100644
--- a/lib/chef/provider/support/yum_repo.erb
+++ b/lib/chef/provider/support/yum_repo.erb
@@ -61,6 +61,9 @@ keepalive=1
<% if @config.metadata_expire %>
metadata_expire=<%= @config.metadata_expire %>
<% end %>
+<% if @config.metalink %>
+metalink=<%= @config.metalink %>
+<% end %>
<% if @config.mirrorlist %>
mirrorlist=<%= @config.mirrorlist %>
<% end %>
@@ -112,6 +115,9 @@ sslclientkey=<%= @config.sslclientkey %>
<% unless @config.sslverify.nil? %>
sslverify=<%= ( @config.sslverify ) ? 'true' : 'false' %>
<% end %>
+<% if @config.throttle %>
+throttle=<%= @config.throttle %>
+<% end %>
<% if @config.timeout %>
timeout=<%= @config.timeout %>
<% end %>
diff --git a/lib/chef/resource/yum_repository.rb b/lib/chef/resource/yum_repository.rb
index 54a0a96aad..012a74908a 100644
--- a/lib/chef/resource/yum_repository.rb
+++ b/lib/chef/resource/yum_repository.rb
@@ -24,7 +24,8 @@ class Chef
resource_name :yum_repository
provides :yum_repository
- # http://linux.die.net/man/5/yum.conf
+ # http://linux.die.net/man/5/yum.conf as well as
+ # http://dnf.readthedocs.io/en/latest/conf_ref.html
property :baseurl, [String, Array], regex: /.*/
property :clean_headers, [TrueClass, FalseClass], default: false # deprecated
property :clean_metadata, [TrueClass, FalseClass], default: true
@@ -44,6 +45,7 @@ class Chef
property :make_cache, [TrueClass, FalseClass], default: true
property :max_retries, [String, Integer]
property :metadata_expire, String, regex: [/^\d+$/, /^\d+[mhd]$/, /never/]
+ property :metalink, String, regex: /.*/
property :mirror_expire, String, regex: [/^\d+$/, /^\d+[mhd]$/]
property :mirrorexpire, String, regex: /.*/
property :mirrorlist_expire, String, regex: [/^\d+$/, /^\d+[mhd]$/]
@@ -65,6 +67,7 @@ class Chef
property :sslclientkey, String, regex: /.*/
property :sslverify, [TrueClass, FalseClass]
property :timeout, String, regex: /^\d+$/
+ property :throttle, [String, Integer]
property :username, String, regex: /.*/
default_action :create