summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThom May <thom@may.lt>2017-09-22 10:13:51 +0100
committerGitHub <noreply@github.com>2017-09-22 10:13:51 +0100
commitb4ccc561837ce66738b5306b0829d65c86a92dca (patch)
tree9b69e4e3a9b4943703e425d445529644af5453f9
parent8b91c383a5e88d5039163831f50f8bc42673bb61 (diff)
parent9e93d83a451e034c0720b55efce6d8751174a546 (diff)
downloadchef-b4ccc561837ce66738b5306b0829d65c86a92dca.tar.gz
Merge pull request #6431 from chef/yum_repo
Add throttle and metalink options to yum_repository
-rw-r--r--lib/chef/provider/support/yum_repo.erb6
-rw-r--r--lib/chef/resource/yum_repository.rb21
2 files changed, 18 insertions, 9 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 f59ad56d16..012a74908a 100644
--- a/lib/chef/resource/yum_repository.rb
+++ b/lib/chef/resource/yum_repository.rb
@@ -24,11 +24,12 @@ 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 :cost, String, regex: /^\d+$/
property :clean_headers, [TrueClass, FalseClass], default: false # deprecated
property :clean_metadata, [TrueClass, FalseClass], default: true
+ property :cost, String, regex: /^\d+$/
property :description, String, regex: /.*/, default: "Yum Repository"
property :enabled, [TrueClass, FalseClass], default: true
property :enablegroups, [TrueClass, FalseClass]
@@ -44,17 +45,18 @@ class Chef
property :make_cache, [TrueClass, FalseClass], default: true
property :max_retries, [String, Integer]
property :metadata_expire, String, regex: [/^\d+$/, /^\d+[mhd]$/, /never/]
- property :mirrorexpire, String, regex: /.*/
- property :mirrorlist, String, regex: /.*/
+ property :metalink, String, regex: /.*/
property :mirror_expire, String, regex: [/^\d+$/, /^\d+[mhd]$/]
+ property :mirrorexpire, String, regex: /.*/
property :mirrorlist_expire, String, regex: [/^\d+$/, /^\d+[mhd]$/]
+ property :mirrorlist, String, regex: /.*/
property :mode, default: "0644"
+ property :options, Hash
+ property :password, String, regex: /.*/
property :priority, String, regex: /^(\d?[0-9]|[0-9][0-9])$/
- property :proxy, String, regex: /.*/
- property :proxy_username, String, regex: /.*/
property :proxy_password, String, regex: /.*/
- property :username, String, regex: /.*/
- property :password, String, regex: /.*/
+ property :proxy_username, String, regex: /.*/
+ property :proxy, String, regex: /.*/
property :repo_gpgcheck, [TrueClass, FalseClass]
property :report_instanceid, [TrueClass, FalseClass]
property :repositoryid, String, regex: /.*/, name_property: true
@@ -65,7 +67,8 @@ class Chef
property :sslclientkey, String, regex: /.*/
property :sslverify, [TrueClass, FalseClass]
property :timeout, String, regex: /^\d+$/
- property :options, Hash
+ property :throttle, [String, Integer]
+ property :username, String, regex: /.*/
default_action :create
allowed_actions :create, :remove, :makecache, :add, :delete