chef 14.4.56 → 14.5.27

Sign up to get free protection for your applications and to get access to all the features.
Files changed (101) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +0 -1
  3. data/VERSION +1 -1
  4. data/lib/.DS_Store +0 -0
  5. data/lib/chef/.DS_Store +0 -0
  6. data/lib/chef/client.rb +1 -1
  7. data/lib/chef/cookbook_version.rb +2 -2
  8. data/lib/chef/mixin/powershell_out.rb +1 -1
  9. data/lib/chef/node_map.rb +4 -10
  10. data/lib/chef/provider/.DS_Store +0 -0
  11. data/lib/chef/provider/dsc_resource.rb +2 -2
  12. data/lib/chef/provider/dsc_script.rb +4 -4
  13. data/lib/chef/provider/package/powershell.rb +1 -1
  14. data/lib/chef/provider/powershell_script.rb +3 -3
  15. data/lib/chef/provider/script.rb +2 -2
  16. data/lib/chef/resource/apt_package.rb +1 -0
  17. data/lib/chef/resource/apt_repository.rb +1 -1
  18. data/lib/chef/resource/build_essential.rb +38 -38
  19. data/lib/chef/resource/chef_gem.rb +4 -1
  20. data/lib/chef/resource/chocolatey_package.rb +2 -1
  21. data/lib/chef/resource/directory.rb +6 -2
  22. data/lib/chef/resource/dmg_package.rb +1 -4
  23. data/lib/chef/resource/dnf_package.rb +20 -23
  24. data/lib/chef/resource/dpkg_package.rb +1 -3
  25. data/lib/chef/resource/dsc_resource.rb +2 -5
  26. data/lib/chef/resource/dsc_script.rb +1 -8
  27. data/lib/chef/resource/execute.rb +4 -1
  28. data/lib/chef/resource/gem_package.rb +17 -19
  29. data/lib/chef/resource/git.rb +4 -4
  30. data/lib/chef/resource/homebrew_cask.rb +2 -2
  31. data/lib/chef/resource/homebrew_tap.rb +3 -3
  32. data/lib/chef/resource/hostname.rb +4 -4
  33. data/lib/chef/resource/http_request.rb +1 -3
  34. data/lib/chef/resource/ifconfig.rb +1 -1
  35. data/lib/chef/resource/locale.rb +93 -0
  36. data/lib/chef/resource/macos_userdefaults.rb +2 -4
  37. data/lib/chef/resource/macosx_service.rb +2 -3
  38. data/lib/chef/resource/mount.rb +45 -18
  39. data/lib/chef/resource/msu_package.rb +10 -7
  40. data/lib/chef/resource/ohai.rb +2 -4
  41. data/lib/chef/resource/ohai_hint.rb +3 -3
  42. data/lib/chef/resource/openssl_dhparam.rb +5 -5
  43. data/lib/chef/resource/openssl_ec_private_key.rb +5 -5
  44. data/lib/chef/resource/openssl_ec_public_key.rb +5 -5
  45. data/lib/chef/resource/openssl_rsa_private_key.rb +6 -6
  46. data/lib/chef/resource/openssl_rsa_public_key.rb +7 -7
  47. data/lib/chef/resource/openssl_x509_certificate.rb +11 -11
  48. data/lib/chef/resource/openssl_x509_crl.rb +2 -2
  49. data/lib/chef/resource/openssl_x509_request.rb +7 -7
  50. data/lib/chef/resource/osx_profile.rb +13 -8
  51. data/lib/chef/resource/package.rb +26 -8
  52. data/lib/chef/resource/paludis_package.rb +3 -1
  53. data/lib/chef/resource/portage_package.rb +2 -1
  54. data/lib/chef/resource/powershell_package.rb +17 -9
  55. data/lib/chef/resource/powershell_package_source.rb +1 -1
  56. data/lib/chef/resource/reboot.rb +7 -2
  57. data/lib/chef/resource/rhsm_errata_level.rb +1 -3
  58. data/lib/chef/resource/route.rb +1 -1
  59. data/lib/chef/resource/scm.rb +42 -14
  60. data/lib/chef/resource/subversion.rb +7 -0
  61. data/lib/chef/resource/sudo.rb +7 -7
  62. data/lib/chef/resource/swap_file.rb +2 -2
  63. data/lib/chef/resource/sysctl.rb +1 -1
  64. data/lib/chef/resource/systemd_unit.rb +2 -1
  65. data/lib/chef/resource/windows_ad_join.rb +9 -4
  66. data/lib/chef/resource/windows_auto_run.rb +5 -5
  67. data/lib/chef/resource/windows_env.rb +1 -3
  68. data/lib/chef/resource/windows_feature_dism.rb +4 -5
  69. data/lib/chef/resource/windows_font.rb +3 -5
  70. data/lib/chef/resource/windows_package.rb +1 -2
  71. data/lib/chef/resource/windows_printer.rb +7 -9
  72. data/lib/chef/resource/windows_printer_port.rb +1 -1
  73. data/lib/chef/resource/windows_service.rb +26 -21
  74. data/lib/chef/resource/windows_shortcut.rb +4 -4
  75. data/lib/chef/resource/windows_task.rb +82 -36
  76. data/lib/chef/resource/windows_workgroup.rb +101 -0
  77. data/lib/chef/resource/yum_package.rb +30 -20
  78. data/lib/chef/resource/yum_repository.rb +134 -45
  79. data/lib/chef/resource/zypper_package.rb +8 -4
  80. data/lib/chef/resource/zypper_repository.rb +58 -20
  81. data/lib/chef/resource_inspector.rb +5 -3
  82. data/lib/chef/resources.rb +2 -0
  83. data/lib/chef/util/powershell/cmdlet.rb +1 -1
  84. data/lib/chef/version.rb +1 -1
  85. data/spec/functional/resource/dsc_resource_spec.rb +3 -3
  86. data/spec/functional/resource/powershell_script_spec.rb +2 -2
  87. data/spec/functional/win32/crypto_spec.rb +1 -1
  88. data/spec/unit/cookbook_version_file_specificity_spec.rb +20 -0
  89. data/spec/unit/node_map_spec.rb +3 -3
  90. data/spec/unit/platform/query_helpers_spec.rb +4 -4
  91. data/spec/unit/provider/dsc_resource_spec.rb +2 -2
  92. data/spec/unit/provider/dsc_script_spec.rb +1 -1
  93. data/spec/unit/resource/dsc_resource_spec.rb +1 -1
  94. data/spec/unit/resource/locale_spec.rb +60 -0
  95. data/spec/unit/resource/scm_spec.rb +0 -10
  96. data/spec/unit/resource/windows_workgroup_spec.rb +47 -0
  97. data/tasks/dependencies.rb +2 -22
  98. data/tasks/templates/prerelease.md.erb +2 -2
  99. data/tasks/templates/release.md.erb +1 -1
  100. metadata +8 -5
  101. data/tasks/cbgb.rb +0 -84
@@ -24,15 +24,15 @@ class Chef
24
24
  resource_name :windows_shortcut
25
25
  provides(:windows_shortcut) { true }
26
26
 
27
- description "Use the windows_shortcut resource to create shortcut files on Windows"
27
+ description "Use the windows_shortcut resource to create shortcut files on Windows."
28
28
  introduced "14.0"
29
29
 
30
30
  property :shortcut_name, String,
31
- description: "The name for the shortcut if it differs from the resource name.",
31
+ description: "The name for the shortcut, if it differs from the resource name.",
32
32
  name_property: true
33
33
 
34
34
  property :target, String,
35
- description: "Where the shortcut links to."
35
+ description: "The destination that the shortcut links to."
36
36
 
37
37
  property :arguments, String,
38
38
  description: "Arguments to pass to the target when the shortcut is executed."
@@ -44,7 +44,7 @@ class Chef
44
44
  description: "Working directory to use when the target is executed."
45
45
 
46
46
  property :iconlocation, String,
47
- description: "Icon to use for the shortcut, in the format of 'path, index'. Index is the icon file to use. See https://msdn.microsoft.com/en-us/library/3s9bx7at.aspx for details"
47
+ description: "Icon to use for the shortcut. Accepts the format of 'path, index', where index is the icon file to use. See https://msdn.microsoft.com/en-us/library/3s9bx7at.aspx for details"
48
48
 
49
49
  load_current_value do |desired|
50
50
  require "win32ole" if RUBY_PLATFORM =~ /mswin|mingw32|windows/
@@ -24,48 +24,94 @@ class Chef
24
24
  resource_name :windows_task
25
25
  provides(:windows_task) { true }
26
26
 
27
- description "Use the windows_task resource to create, delete or run a Windows"\
28
- " scheduled task. Requires Windows Server 2008 or later due to API usage."
27
+ description "Use the windows_task resource to create, delete or run a Windows scheduled task. Requires Windows Server 2008 or later due to API usage."
29
28
  introduced "13.0"
30
29
 
31
30
  allowed_actions :create, :delete, :run, :end, :enable, :disable, :change
32
31
  default_action :create
33
32
 
34
- property :task_name, String, regex: [/\A[^\/\:\*\?\<\>\|]+\z/], name_property: true
35
- property :command, String
36
- property :cwd, String
37
- property :user, String, default: "SYSTEM"
38
- property :password, String
39
- property :run_level, equal_to: [:highest, :limited], default: :limited
40
- property :force, [TrueClass, FalseClass], default: false
41
- property :interactive_enabled, [TrueClass, FalseClass], default: false
42
- property :frequency_modifier, [Integer, String], default: 1
43
- property :frequency, equal_to: [:minute,
44
- :hourly,
45
- :daily,
46
- :weekly,
47
- :monthly,
48
- :once,
49
- :on_logon,
50
- :onstart,
51
- :on_idle,
52
- :none]
53
- property :start_day, String
54
- property :start_time, String
55
- property :day, [String, Integer]
56
- property :months, String
57
- property :idle_time, Integer
58
- property :random_delay, [String, Integer]
59
- property :execution_time_limit, [String, Integer], default: "PT72H" # 72 hours in ISO8601 duration format
60
- property :minutes_duration, [String, Integer]
61
- property :minutes_interval, [String, Integer]
62
- property :priority, Integer, description: "Use to set Priority Levels range from 0 to 10.", default: 7,
63
- callbacks: { "should be in range of 0 to 10" => proc { |v| v >= 0 && v <= 10 } }
64
- property :disallow_start_if_on_batteries, [TrueClass, FalseClass], default: false,
65
- introduced: "14.4",
33
+ property :task_name, String, regex: [/\A[^\/\:\*\?\<\>\|]+\z/],
34
+ description: "The task name, such as 'Task Name' or '/Task Name'",
35
+ name_property: true
36
+
37
+ property :command, String,
38
+ description: "The command to be executed by the windows scheduled task."
39
+
40
+ property :cwd, String,
41
+ description: "The directory the task will be run from."
42
+
43
+ property :user, String,
44
+ description: "The user to run the task as.",
45
+ default: "SYSTEM"
46
+
47
+ property :password, String,
48
+ description: "The user’s password. The user property must be set if using this property."
49
+
50
+ property :run_level, Symbol, equal_to: [:highest, :limited],
51
+ description: "Run with ':limited' or ':highest' privileges.",
52
+ default: :limited
53
+
54
+ property :force, [TrueClass, FalseClass],
55
+ description: "When used with create, will update the task.",
56
+ default: false
57
+
58
+ property :interactive_enabled, [TrueClass, FalseClass],
59
+ description: "Allow task to run interactively or non-interactively. Requires user and password to also be set.",
60
+ default: false
61
+
62
+ property :frequency_modifier, [Integer, String],
63
+ default: 1
64
+
65
+ property :frequency, Symbol, equal_to: [:minute,
66
+ :hourly,
67
+ :daily,
68
+ :weekly,
69
+ :monthly,
70
+ :once,
71
+ :on_logon,
72
+ :onstart,
73
+ :on_idle,
74
+ :none],
75
+ description: "The frequency with which to run the task."
76
+
77
+ property :start_day, String,
78
+ description: "Specifies the first date on which the task runs in MM/DD/YYYY format."
79
+
80
+ property :start_time, String,
81
+ description: "Specifies the start time to run the task, in HH:mm format."
82
+
83
+ property :day, [String, Integer],
84
+ description: "The day(s) on which the task runs."
85
+
86
+ property :months, String,
87
+ description: "The Months of the year on which the task runs, such as: 'JAN, FEB' or '\*'. Multiple months should be comma delimited. e.g. 'Jan, Feb, Mar, Dec'."
88
+
89
+ property :idle_time, Integer,
90
+ description: "For :on_idle frequency, the time (in minutes) without user activity that must pass to trigger the task, from 1 - 999."
91
+
92
+ property :random_delay, [String, Integer],
93
+ description: "Delays the task up to a given time (in seconds)."
94
+
95
+ property :execution_time_limit, [String, Integer],
96
+ description: "The maximum time (in seconds) the task will run.",
97
+ default: "PT72H" # 72 hours in ISO8601 duration format
98
+
99
+ property :minutes_duration, [String, Integer],
100
+ description: ""
101
+
102
+ property :minutes_interval, [String, Integer],
103
+ description: ""
104
+
105
+ property :priority, Integer,
106
+ description: "Use to set Priority Levels range from 0 to 10.",
107
+ default: 7, callbacks: { "should be in range of 0 to 10" => proc { |v| v >= 0 && v <= 10 } }
108
+
109
+ property :disallow_start_if_on_batteries, [TrueClass, FalseClass],
110
+ introduced: "14.4", default: false,
66
111
  description: "Disallow start of the task if the system is running on battery power."
67
- property :stop_if_going_on_batteries, [TrueClass, FalseClass], default: false,
68
- introduced: "14.4",
112
+
113
+ property :stop_if_going_on_batteries, [TrueClass, FalseClass],
114
+ introduced: "14.4", default: false,
69
115
  description: "Scheduled task option when system is switching on battery."
70
116
 
71
117
  attr_accessor :exists, :task, :command_arguments
@@ -0,0 +1,101 @@
1
+ #
2
+ # Author:: Derek Groh (<derekgroh@github.io>)
3
+ # Copyright:: 2018, Derek Groh
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+ #
17
+
18
+ require "chef/resource"
19
+ require "chef/mixin/powershell_out"
20
+
21
+ class Chef
22
+ class Resource
23
+ class WindowsWorkgroup < Chef::Resource
24
+ resource_name :windows_workgroup
25
+ provides :windows_workgroup
26
+
27
+ include Chef::Mixin::PowershellOut
28
+
29
+ description "Use the windows_workgroup resource to join or change the workgroup of a Windows host."
30
+ introduced "14.5"
31
+
32
+ property :workgroup_name, String,
33
+ description: "The name of the workgroup for the computer.",
34
+ validation_message: "The 'workgroup_name' property must not contain spaces.",
35
+ regex: /^\S*$/, # no spaces
36
+ name_property: true
37
+
38
+ property :user, String,
39
+ description: "The local administrator user to use to change the workgroup."
40
+
41
+ property :password, String,
42
+ description: "The password for the local administrator user."
43
+
44
+ property :reboot, Symbol,
45
+ equal_to: [:immediate, :delayed, :never, :request_reboot, :reboot_now],
46
+ validation_message: "The reboot property accepts :immediate (reboot as soon as the resource completes), :delayed (reboot once the Chef run completes), and :never (Don't reboot)",
47
+ description: "Controls the system reboot behavior post workgroup joining. Reboot immediately, after the Chef run completes, or never. Note that a reboot is necessary for changes to take effect.",
48
+ default: :immediate
49
+
50
+ # define this again so we can default it to true. Otherwise failures print the password
51
+ property :sensitive, [TrueClass, FalseClass],
52
+ default: true
53
+
54
+ action :join do
55
+ description "Update the workgroup."
56
+
57
+ unless workgroup_member?
58
+ cmd = ""
59
+ cmd << "$pswd = ConvertTo-SecureString \'#{new_resource.password}\' -AsPlainText -Force;" if new_resource.password
60
+ cmd << "$credential = New-Object System.Management.Automation.PSCredential (\"#{new_resource.user}\",$pswd);" if new_resource.password
61
+ cmd << "Add-Computer -WorkgroupName #{new_resource.workgroup_name}"
62
+ cmd << " -Credential $credential" if new_resource.password
63
+ cmd << " -Force"
64
+
65
+ converge_by("join workstation workgroup #{new_resource.workgroup_name}") do
66
+ ps_run = powershell_out(cmd)
67
+ raise "Failed to join the workgroup #{new_resource.workgroup_name}: #{ps_run.stderr}}" if ps_run.error?
68
+
69
+ unless new_resource.reboot == :never
70
+ reboot "Reboot to join workgroup #{new_resource.workgroup_name}" do
71
+ action clarify_reboot(new_resource.reboot)
72
+ reason "Reboot to join workgroup #{new_resource.workgroup_name}"
73
+ end
74
+ end
75
+ end
76
+ end
77
+ end
78
+
79
+ action_class do
80
+ # This resource historically took `:immediate` and `:delayed` as arguments to the reboot property but then
81
+ # tried to shove that straight to the `reboot` resource which objected strenuously
82
+ def clarify_reboot(reboot_action)
83
+ case reboot_action
84
+ when :immediate
85
+ :reboot_now
86
+ when :delayed
87
+ :request_reboot
88
+ else
89
+ reboot_action
90
+ end
91
+ end
92
+
93
+ def workgroup_member?
94
+ node_workgroup = powershell_out!("(Get-WmiObject -Class Win32_ComputerSystem).Workgroup")
95
+ raise "Failed to determine if system already a member of workgroup #{new_resource.workgroup_name}" if node_workgroup.error?
96
+ node_workgroup.stdout.downcase.strip == new_resource.workgroup_name.downcase
97
+ end
98
+ end
99
+ end
100
+ end
101
+ end
@@ -38,28 +38,38 @@ class Chef
38
38
  # its own arguments as unintended side-effects (and why functional languages that don't allow modifcations
39
39
  # of variables eliminate entire classes of bugs).
40
40
  # </lecture>
41
- property :package_name, [ String, Array ], identity: true, coerce: proc { |x| x.is_a?(Array) ? x.to_a : x }
42
- property :version, [ String, Array ], coerce: proc { |x| x.is_a?(Array) ? x.to_a : x }
43
- property :arch, [ String, Array ], coerce: proc { |x| x.is_a?(Array) ? x.to_a : x }
41
+ property :package_name, [ String, Array ],
42
+ description: "One of the following: the name of a package, the name of a package and its architecture, the name of a dependency.",
43
+ identity: true, coerce: proc { |x| x.is_a?(Array) ? x.to_a : x }
44
44
 
45
- property :flush_cache,
46
- Hash,
47
- default: { before: false, after: false },
48
- coerce: proc { |v|
49
- if v.is_a?(Hash)
50
- v
51
- elsif v.is_a?(Array)
52
- v.each_with_object({}) { |arg, obj| obj[arg] = true }
53
- elsif v.is_a?(TrueClass) || v.is_a?(FalseClass)
54
- { before: v, after: v }
55
- elsif v == :before
56
- { before: true, after: false }
57
- elsif v == :after
58
- { after: true, before: false }
59
- end
60
- }
45
+ property :version, [ String, Array ],
46
+ description: "The version of a package to be installed or upgraded. This property is ignored when using the ':upgrade' action.",
47
+ coerce: proc { |x| x.is_a?(Array) ? x.to_a : x }
61
48
 
62
- property :allow_downgrade, [ true, false ], default: false
49
+ property :arch, [ String, Array ],
50
+ description: "The architecture of the package to be installed or upgraded. This value can also be passed as part of the package name.",
51
+ coerce: proc { |x| x.is_a?(Array) ? x.to_a : x }
52
+
53
+ property :flush_cache, Hash,
54
+ description: "Flush the in-memory cache before or after a Yum operation that installs, upgrades, or removes a package. Accepts a Hash in the form: { :before => true/false, :after => true/false } or an Array in the form [ :before, :after ].\nYum automatically synchronizes remote metadata to a local cache. The chef-client creates a copy of the local cache, and then stores it in-memory during the chef-client run. The in-memory cache allows packages to be installed during the chef-client run without the need to continue synchronizing the remote metadata to the local cache while the chef-client run is in-progress.",
55
+ default: { before: false, after: false },
56
+ coerce: proc { |v|
57
+ if v.is_a?(Hash)
58
+ v
59
+ elsif v.is_a?(Array)
60
+ v.each_with_object({}) { |arg, obj| obj[arg] = true }
61
+ elsif v.is_a?(TrueClass) || v.is_a?(FalseClass)
62
+ { before: v, after: v }
63
+ elsif v == :before
64
+ { before: true, after: false }
65
+ elsif v == :after
66
+ { after: true, before: false }
67
+ end
68
+ }
69
+
70
+ property :allow_downgrade, [ true, false ],
71
+ description: "Downgrade a package to satisfy requested version requirements.",
72
+ default: false
63
73
 
64
74
  property :yum_binary, String
65
75
  end
@@ -32,54 +32,142 @@ class Chef
32
32
 
33
33
  # http://linux.die.net/man/5/yum.conf as well as
34
34
  # http://dnf.readthedocs.io/en/latest/conf_ref.html
35
- property :baseurl, [String, Array]
36
- property :clean_headers, [TrueClass, FalseClass], default: false # deprecated
37
- property :clean_metadata, [TrueClass, FalseClass], default: true
38
- property :cost, String, regex: /^\d+$/
39
- property :description, String, default: "Yum Repository"
40
- property :enabled, [TrueClass, FalseClass], default: true
41
- property :enablegroups, [TrueClass, FalseClass]
42
- property :exclude, String
43
- property :failovermethod, String, equal_to: %w{priority roundrobin}
44
- property :fastestmirror_enabled, [TrueClass, FalseClass]
45
- property :gpgcheck, [TrueClass, FalseClass], default: true
46
- property :gpgkey, [String, Array]
47
- property :http_caching, String, equal_to: %w{packages all none}
48
- property :include_config, String
49
- property :includepkgs, String
50
- property :keepalive, [TrueClass, FalseClass]
51
- property :make_cache, [TrueClass, FalseClass], default: true
52
- property :max_retries, [String, Integer]
53
- property :metadata_expire, String, regex: [/^\d+$/, /^\d+[mhd]$/, /never/]
54
- property :metalink, String
55
- property :mirror_expire, String, regex: [/^\d+$/, /^\d+[mhd]$/]
56
- property :mirrorexpire, String
57
- property :mirrorlist_expire, String, regex: [/^\d+$/, /^\d+[mhd]$/]
58
- property :mirrorlist, String
59
- property :mode, default: "0644"
60
- property :options, Hash
61
- property :password, String
62
- property :priority, String, regex: /^(\d?[1-9]|[0-9][0-9])$/
63
- property :proxy_password, String
64
- property :proxy_username, String
65
- property :proxy, String
66
- property :repo_gpgcheck, [TrueClass, FalseClass]
67
- property :report_instanceid, [TrueClass, FalseClass]
68
-
69
- property :repositoryid, String,
70
- regex: [/^[^\/]+$/],
35
+ property :baseurl, [String, Array],
36
+ description: "URL to the directory where the Yum repository's 'repodata' directory lives. Can be an http://, https:// or a ftp:// URL. You can specify multiple URLs in one baseurl statement."
37
+
38
+ property :clean_headers, [TrueClass, FalseClass],
39
+ description: "Specifies whether you want to purge the package data files that are downloaded from a Yum repository and held in a cache directory.",
40
+ deprecated: true,
41
+ default: false # deprecated
42
+
43
+ property :clean_metadata, [TrueClass, FalseClass],
44
+ description: "Specifies whether you want to purge all of the packages downloaded from a Yum repository and held in a cache directory.",
45
+ default: true
46
+
47
+ property :cost, String, regex: /^\d+$/,
48
+ description: "Relative cost of accessing this repository. Useful for weighing one repo's packages as greater/less than any other."
49
+
50
+ property :description, String,
51
+ description: "Descriptive name for the repository channel and maps to the 'name' parameter in a repository .conf.",
52
+ default: "Yum Repository"
53
+
54
+ property :enabled, [TrueClass, FalseClass],
55
+ description: "Specifies whether or not Yum should use this repository.",
56
+ default: true
57
+
58
+ property :enablegroups, [TrueClass, FalseClass],
59
+ description: "Specifies whether Yum will allow the use of package groups for this repository."
60
+
61
+ property :exclude, String,
62
+ 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."
63
+
64
+ property :failovermethod, String,
65
+ description: "Method to determine how to switch to a new server if the current one fails, which can either be ``roundrobin`` or ``priority``. ``roundrobin`` randomly selects a URL out of the list of URLs to start with and proceeds through each of them as it encounters a failure contacting the host. ``priority`` starts from the first ``baseurl`` listed and reads through them sequentially.",
66
+ equal_to: %w{priority roundrobin}
67
+
68
+ property :fastestmirror_enabled, [TrueClass, FalseClass],
69
+ description: "Specifies whether to use the fastest mirror from a repository configuration when more than one mirror is listed in that configuration."
70
+
71
+ property :gpgcheck, [TrueClass, FalseClass],
72
+ description: "Specifies whether or not Yum should perform a GPG signature check on the packages received from a repository.",
73
+ default: true
74
+
75
+ property :gpgkey, [String, Array],
76
+ description: "URL pointing to the ASCII-armored GPG key file for the repository. This is used if Yum needs a public key to verify a package and the required key hasn't been imported into the RPM database. If this option is set, Yum will automatically import the key from the specified URL. Multiple URLs may be specified in the same manner as the baseurl option. If a GPG key is required to install a package from a repository, all keys specified for that repository will be installed."
77
+
78
+ property :http_caching, String, equal_to: %w{packages all none},
79
+ description: "Determines how upstream HTTP caches are instructed to handle any HTTP downloads that Yum does. This option can take the following values: all (all HTTP downloads should be cached), packages (only RPM package downloads should be cached, but not repository metadata downloads), or none (no HTTP downloads should be cached)"
80
+
81
+ property :include_config, String,
82
+ description: "An external configuration file using the format 'url://to/some/location'."
83
+
84
+ property :includepkgs, String,
85
+ description: "Inverse of exclude property. This is a list of packages you want to use from a repository. If this option lists only one package then that is all Yum will ever see from the repository."
86
+
87
+ property :keepalive, [TrueClass, FalseClass],
88
+ description: "Determines whether or not HTTP/1.1 ``keep-alive`` should be used with this repository."
89
+
90
+ property :make_cache, [TrueClass, FalseClass],
91
+ description: "Determines whether package files downloaded by Yum stay in cache directories. By using cached data, you can carry out certain operations without a network connection.",
92
+ default: true
93
+
94
+ property :max_retries, [String, Integer],
95
+ description: "Number of times any attempt to retrieve a file should retry before returning an error. Setting this to '0' makes Yum try forever."
96
+
97
+ property :metadata_expire, String, regex: [/^\d+$/, /^\d+[mhd]$/, /never/],
98
+ description: "Time (in seconds) after which the metadata will expire. If the current metadata downloaded is less than the value specified, 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 six hours to compliment yum-updates running once per hour. It is also possible to use the word ``never``, meaning that the metadata will never expire. Note: 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."
99
+
100
+ property :metalink, String,
101
+ description: "Specifies a URL to a metalink file for the repomd.xml, a list of mirrors for the entire repository are generated by converting the mirrors for the repomd.xml file to a baseurl."
102
+
103
+ property :mirror_expire, String, regex: [/^\d+$/, /^\d+[mhd]$/],
104
+ description: "Time (in seconds) after which the mirrorlist locally cached will expire. If the current mirrorlist is less than this many seconds old then Yum will not download another copy of the mirrorlist, it has the same extra format as metadata_expire. If you find that Yum is not downloading the mirrorlists as often as you would like lower the value of this option."
105
+
106
+ property :mirrorlist_expire, String, regex: [/^\d+$/, /^\d+[mhd]$/],
107
+ description: "Specifies the time (in seconds) after which the mirrorlist locally cached will expire. If the current mirrorlist is less than the value specified, then Yum will not download another copy of the mirrorlist."
108
+
109
+ property :mirrorlist, String,
110
+ description: "URL to a file containing a list of baseurls. This can be used instead of or with the baseurl option. Substitution variables, described below, can be used with this option."
111
+
112
+ property :mode, [String, Integer],
113
+ description: "Permissions mode of .repo file on disk. This is useful for scenarios where secrets are in the repo file. If this value is set to '600', normal users will not be able to use Yum search, Yum info, etc.",
114
+ default: "0644"
115
+
116
+ property :options, Hash,
117
+ description: "Specifies the repository options."
118
+
119
+ property :password, String,
120
+ description: "Password to use with the username for basic authentication."
121
+
122
+ property :priority, String, regex: /^(\d?[1-9]|[0-9][0-9])$/,
123
+ description: "Assigns a priority to a repository where the priority value is between '1' and '99' inclusive. Priorities are used to enforce ordered protection of repositories. Packages from repositories with a lower priority (higher numerical value) will never be used to upgrade packages that were installed from a repository with a higher priority (lower numerical value). The repositories with the lowest numerical priority number have the highest priority."
124
+
125
+ property :proxy_password, String,
126
+ description: "Password for this proxy."
127
+
128
+ property :proxy_username, String,
129
+ description: "Username to use for proxy."
130
+
131
+ property :proxy, String,
132
+ description: "URL to the proxy server that Yum should use."
133
+
134
+ property :repo_gpgcheck, [TrueClass, FalseClass],
135
+ description: "Determines whether or not Yum should perform a GPG signature check on the repodata from this repository."
136
+
137
+ property :report_instanceid, [TrueClass, FalseClass],
138
+ description: "Determines whether to report the instance ID when using Amazon Linux AMIs and repositories."
139
+
140
+ property :repositoryid, String, regex: [/^[^\/]+$/],
141
+ description: "Specifies a unique name for each repository, one word. Defaults to name attribute.",
71
142
  validation_message: "repositoryid property cannot contain a forward slash '/'",
72
143
  name_property: true
73
144
 
74
- property :skip_if_unavailable, [TrueClass, FalseClass]
75
- property :source, String
76
- property :sslcacert, String
77
- property :sslclientcert, String
78
- property :sslclientkey, String
79
- property :sslverify, [TrueClass, FalseClass]
80
- property :throttle, [String, Integer]
81
- property :timeout, String, regex: /^\d+$/
82
- property :username, String
145
+ property :skip_if_unavailable, [TrueClass, FalseClass],
146
+ description: "Allow yum to continue if this repository cannot be contacted for any reason."
147
+
148
+ property :source, String,
149
+ description: "Use a custom template source instead of the default one."
150
+
151
+ property :sslcacert, String,
152
+ description: "Path to the directory containing the databases of the certificate authorities Yum should use to verify SSL certificates."
153
+
154
+ property :sslclientcert, String,
155
+ description: "Path to the SSL client certificate Yum should use to connect to repos/remote sites."
156
+
157
+ property :sslclientkey, String,
158
+ description: "Path to the SSL client key Yum should use to connect to repos/remote sites."
159
+
160
+ property :sslverify, [TrueClass, FalseClass],
161
+ description: "Determines whether Yum will verify SSL certificates/hosts."
162
+
163
+ property :throttle, [String, Integer],
164
+ description: "Enable bandwidth throttling for downloads."
165
+
166
+ property :timeout, String, regex: /^\d+$/,
167
+ description: "Number of seconds to wait for a connection before timing out. Defaults to 30 seconds. This may be too short of a time for extremely overloaded sites."
168
+
169
+ property :username, String,
170
+ description: "Username to use for basic authentication to a repository."
83
171
 
84
172
  default_action :create
85
173
  allowed_actions :create, :remove, :makecache, :add, :delete
@@ -87,6 +175,7 @@ class Chef
87
175
  # provide compatibility with the yum cookbook < 3.0 properties
88
176
  alias_method :url, :baseurl
89
177
  alias_method :keyurl, :gpgkey
178
+ alias_method :mirrorexpire, :mirror_expire
90
179
  end
91
180
  end
92
181
  end