bolt 0.23.0 → 0.24.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of bolt might be problematic. Click here for more details.

Files changed (192) hide show
  1. checksums.yaml +4 -4
  2. data/bolt-modules/boltlib/lib/puppet/functions/apply_prep.rb +5 -2
  3. data/bolt-modules/boltlib/lib/puppet/functions/puppetdb_query.rb +5 -1
  4. data/bolt-modules/boltlib/lib/puppet/functions/run_task.rb +5 -8
  5. data/lib/bolt/applicator.rb +11 -8
  6. data/lib/bolt/boltdir.rb +13 -5
  7. data/lib/bolt/catalog.rb +22 -47
  8. data/lib/bolt/config.rb +1 -26
  9. data/lib/bolt/executor.rb +1 -1
  10. data/lib/bolt/outputter.rb +0 -9
  11. data/lib/bolt/outputter/human.rb +29 -14
  12. data/lib/bolt/outputter/json.rb +12 -1
  13. data/lib/bolt/pal.rb +12 -10
  14. data/lib/bolt/target.rb +0 -6
  15. data/lib/bolt/task.rb +53 -10
  16. data/lib/bolt/transport/base.rb +1 -6
  17. data/lib/bolt/transport/local.rb +11 -13
  18. data/lib/bolt/transport/local/shell.rb +2 -2
  19. data/lib/bolt/transport/ssh.rb +16 -11
  20. data/lib/bolt/transport/winrm.rb +8 -11
  21. data/lib/bolt/version.rb +1 -1
  22. data/lib/bolt_ext/schemas/task.json +12 -5
  23. data/libexec/apply_catalog.rb +3 -1
  24. data/libexec/bolt_catalog +4 -0
  25. data/vendored/puppet/lib/puppet.rb +2 -1
  26. data/vendored/puppet/lib/puppet/application/agent.rb +2 -6
  27. data/vendored/puppet/lib/puppet/application/apply.rb +100 -60
  28. data/vendored/puppet/lib/puppet/application/cert.rb +26 -291
  29. data/vendored/puppet/lib/puppet/application/device.rb +0 -5
  30. data/vendored/puppet/lib/puppet/application/lookup.rb +1 -1
  31. data/vendored/puppet/lib/puppet/application/ssl.rb +133 -0
  32. data/vendored/puppet/lib/puppet/application_support.rb +1 -2
  33. data/vendored/puppet/lib/puppet/configurer.rb +34 -50
  34. data/vendored/puppet/lib/puppet/configurer/downloader.rb +1 -1
  35. data/vendored/puppet/lib/puppet/configurer/plugin_handler.rb +1 -1
  36. data/vendored/puppet/lib/puppet/daemon.rb +1 -1
  37. data/vendored/puppet/lib/puppet/defaults.rb +40 -117
  38. data/vendored/puppet/lib/puppet/face/epp.rb +2 -2
  39. data/vendored/puppet/lib/puppet/face/help.rb +21 -7
  40. data/vendored/puppet/lib/puppet/face/node/clean.rb +14 -10
  41. data/vendored/puppet/lib/puppet/feature/base.rb +7 -23
  42. data/vendored/puppet/lib/puppet/feature/eventlog.rb +1 -1
  43. data/vendored/puppet/lib/puppet/file_serving/base.rb +2 -2
  44. data/vendored/puppet/lib/puppet/file_serving/fileset.rb +1 -1
  45. data/vendored/puppet/lib/puppet/file_serving/metadata.rb +2 -2
  46. data/vendored/puppet/lib/puppet/functions.rb +133 -0
  47. data/vendored/puppet/lib/puppet/functions/eyaml_lookup_key.rb +4 -5
  48. data/vendored/puppet/lib/puppet/functions/filter.rb +7 -6
  49. data/vendored/puppet/lib/puppet/functions/new.rb +37 -53
  50. data/vendored/puppet/lib/puppet/functions/warning.rb +1 -1
  51. data/vendored/puppet/lib/puppet/functions/yaml_data.rb +4 -5
  52. data/vendored/puppet/lib/puppet/gettext/config.rb +1 -1
  53. data/vendored/puppet/lib/puppet/graph.rb +0 -2
  54. data/vendored/puppet/lib/puppet/indirector/catalog/json.rb +14 -3
  55. data/vendored/puppet/lib/puppet/indirector/catalog/yaml.rb +0 -16
  56. data/vendored/puppet/lib/puppet/indirector/certificate/file.rb +0 -1
  57. data/vendored/puppet/lib/puppet/indirector/facts/yaml.rb +4 -2
  58. data/vendored/puppet/lib/puppet/indirector/key/file.rb +1 -6
  59. data/vendored/puppet/lib/puppet/indirector/node/exec.rb +1 -3
  60. data/vendored/puppet/lib/puppet/indirector/node/yaml.rb +0 -6
  61. data/vendored/puppet/lib/puppet/indirector/request.rb +1 -1
  62. data/vendored/puppet/lib/puppet/indirector/ssl_file.rb +3 -44
  63. data/vendored/puppet/lib/puppet/indirector/yaml.rb +4 -4
  64. data/vendored/puppet/lib/puppet/info_service/task_information_service.rb +7 -3
  65. data/vendored/puppet/lib/puppet/loaders.rb +1 -0
  66. data/vendored/puppet/lib/puppet/module/task.rb +198 -29
  67. data/vendored/puppet/lib/puppet/module_tool/applications/unpacker.rb +1 -1
  68. data/vendored/puppet/lib/puppet/network/format_support.rb +13 -8
  69. data/vendored/puppet/lib/puppet/network/formats.rb +93 -2
  70. data/vendored/puppet/lib/puppet/network/http/api/indirected_routes.rb +10 -3
  71. data/vendored/puppet/lib/puppet/node/facts.rb +11 -1
  72. data/vendored/puppet/lib/puppet/parser/catalog_compiler.rb +56 -0
  73. data/vendored/puppet/lib/puppet/parser/compiler.rb +3 -1
  74. data/vendored/puppet/lib/puppet/parser/functions.rb +3 -1
  75. data/vendored/puppet/lib/puppet/parser/functions/filter.rb +1 -1
  76. data/vendored/puppet/lib/puppet/parser/functions/generate.rb +1 -1
  77. data/vendored/puppet/lib/puppet/parser/functions/sprintf.rb +12 -1
  78. data/vendored/puppet/lib/puppet/parser/functions/tagged.rb +1 -4
  79. data/vendored/puppet/lib/puppet/parser/scope.rb +1 -1
  80. data/vendored/puppet/lib/puppet/parser/script_compiler.rb +7 -2
  81. data/vendored/puppet/lib/puppet/pops/evaluator/deferred_resolver.rb +5 -3
  82. data/vendored/puppet/lib/puppet/pops/evaluator/runtime3_converter.rb +23 -4
  83. data/vendored/puppet/lib/puppet/pops/evaluator/runtime3_support.rb +3 -4
  84. data/vendored/puppet/lib/puppet/pops/functions/dispatch.rb +4 -0
  85. data/vendored/puppet/lib/puppet/pops/issues.rb +8 -0
  86. data/vendored/puppet/lib/puppet/pops/loader/loader.rb +2 -2
  87. data/vendored/puppet/lib/puppet/pops/loader/loader_paths.rb +3 -1
  88. data/vendored/puppet/lib/puppet/pops/loader/module_loaders.rb +30 -9
  89. data/vendored/puppet/lib/puppet/pops/loader/ruby_legacy_function_instantiator.rb +62 -0
  90. data/vendored/puppet/lib/puppet/pops/loader/static_loader.rb +0 -1
  91. data/vendored/puppet/lib/puppet/pops/loader/task_instantiator.rb +13 -70
  92. data/vendored/puppet/lib/puppet/pops/loaders.rb +19 -29
  93. data/vendored/puppet/lib/puppet/pops/lookup/hiera_config.rb +1 -1
  94. data/vendored/puppet/lib/puppet/pops/model/model_label_provider.rb +4 -1
  95. data/vendored/puppet/lib/puppet/pops/pcore.rb +10 -33
  96. data/vendored/puppet/lib/puppet/pops/serialization.rb +2 -0
  97. data/vendored/puppet/lib/puppet/pops/serialization/from_data_converter.rb +2 -1
  98. data/vendored/puppet/lib/puppet/pops/serialization/to_data_converter.rb +11 -3
  99. data/vendored/puppet/lib/puppet/pops/serialization/to_stringified_converter.rb +226 -0
  100. data/vendored/puppet/lib/puppet/pops/types/p_object_type.rb +3 -0
  101. data/vendored/puppet/lib/puppet/pops/validation/checker4_0.rb +97 -47
  102. data/vendored/puppet/lib/puppet/pops/validation/validator_factory_4_0.rb +7 -8
  103. data/vendored/puppet/lib/puppet/property/keyvalue.rb +70 -8
  104. data/vendored/puppet/lib/puppet/provider/aix_object.rb +483 -0
  105. data/vendored/puppet/lib/puppet/provider/file/windows.rb +1 -1
  106. data/vendored/puppet/lib/puppet/provider/group/aix.rb +51 -112
  107. data/vendored/puppet/lib/puppet/provider/package/gem.rb +1 -1
  108. data/vendored/puppet/lib/puppet/provider/package/pip.rb +1 -1
  109. data/vendored/puppet/lib/puppet/provider/package/puppet_gem.rb +1 -1
  110. data/vendored/puppet/lib/puppet/provider/package/rpm.rb +1 -1
  111. data/vendored/puppet/lib/puppet/provider/package/windows/package.rb +1 -1
  112. data/vendored/puppet/lib/puppet/provider/package/zypper.rb +1 -1
  113. data/vendored/puppet/lib/puppet/provider/service/systemd.rb +1 -1
  114. data/vendored/puppet/lib/puppet/provider/service/windows.rb +37 -40
  115. data/vendored/puppet/lib/puppet/provider/user/aix.rb +142 -254
  116. data/vendored/puppet/lib/puppet/resource.rb +20 -3
  117. data/vendored/puppet/lib/puppet/resource/catalog.rb +2 -12
  118. data/vendored/puppet/lib/puppet/rest/routes.rb +97 -34
  119. data/vendored/puppet/lib/puppet/settings.rb +1 -1
  120. data/vendored/puppet/lib/puppet/settings/file_setting.rb +1 -1
  121. data/vendored/puppet/lib/puppet/ssl/base.rb +1 -9
  122. data/vendored/puppet/lib/puppet/ssl/certificate_request.rb +1 -13
  123. data/vendored/puppet/lib/puppet/ssl/certificate_request_attributes.rb +1 -1
  124. data/vendored/puppet/lib/puppet/ssl/host.rb +114 -232
  125. data/vendored/puppet/lib/puppet/ssl/key.rb +1 -5
  126. data/vendored/puppet/lib/puppet/ssl/oids.rb +1 -1
  127. data/vendored/puppet/lib/puppet/test/test_helper.rb +0 -4
  128. data/vendored/puppet/lib/puppet/transaction/event.rb +3 -7
  129. data/vendored/puppet/lib/puppet/transaction/persistence.rb +1 -1
  130. data/vendored/puppet/lib/puppet/type/exec.rb +18 -16
  131. data/vendored/puppet/lib/puppet/type/file.rb +3 -3
  132. data/vendored/puppet/lib/puppet/type/file/source.rb +20 -7
  133. data/vendored/puppet/lib/puppet/type/group.rb +3 -5
  134. data/vendored/puppet/lib/puppet/type/notify.rb +1 -1
  135. data/vendored/puppet/lib/puppet/type/package.rb +2 -5
  136. data/vendored/puppet/lib/puppet/type/schedule.rb +1 -1
  137. data/vendored/puppet/lib/puppet/type/service.rb +3 -6
  138. data/vendored/puppet/lib/puppet/type/tidy.rb +1 -1
  139. data/vendored/puppet/lib/puppet/type/user.rb +13 -20
  140. data/vendored/puppet/lib/puppet/util.rb +8 -9
  141. data/vendored/puppet/lib/puppet/util/execution.rb +3 -3
  142. data/vendored/puppet/lib/puppet/util/feature.rb +61 -39
  143. data/vendored/puppet/lib/puppet/util/log/destinations.rb +1 -1
  144. data/vendored/puppet/lib/puppet/util/rdoc.rb +1 -1
  145. data/vendored/puppet/lib/puppet/util/run_mode.rb +1 -1
  146. data/vendored/puppet/lib/puppet/util/storage.rb +1 -1
  147. data/vendored/puppet/lib/puppet/util/suidmanager.rb +7 -5
  148. data/vendored/puppet/lib/puppet/util/tag_set.rb +1 -1
  149. data/vendored/puppet/lib/puppet/util/tagging.rb +1 -1
  150. data/vendored/puppet/lib/puppet/util/windows.rb +18 -2
  151. data/vendored/puppet/lib/puppet/util/windows/adsi.rb +154 -205
  152. data/vendored/puppet/lib/puppet/util/windows/service.rb +770 -0
  153. data/vendored/puppet/lib/puppet/util/yaml.rb +41 -5
  154. data/vendored/puppet/lib/puppet/version.rb +1 -1
  155. data/vendored/puppet/lib/puppet_pal.rb +280 -24
  156. metadata +8 -38
  157. data/lib/bolt/catalog/compiler.rb +0 -48
  158. data/lib/bolt/catalog/loaders.rb +0 -19
  159. data/vendored/puppet/lib/puppet/application/ca.rb +0 -11
  160. data/vendored/puppet/lib/puppet/application/certificate.rb +0 -17
  161. data/vendored/puppet/lib/puppet/application/certificate_request.rb +0 -7
  162. data/vendored/puppet/lib/puppet/application/certificate_revocation_list.rb +0 -7
  163. data/vendored/puppet/lib/puppet/face/ca.rb +0 -266
  164. data/vendored/puppet/lib/puppet/face/certificate.rb +0 -167
  165. data/vendored/puppet/lib/puppet/face/certificate_request.rb +0 -56
  166. data/vendored/puppet/lib/puppet/face/certificate_revocation_list.rb +0 -56
  167. data/vendored/puppet/lib/puppet/graph/random_prioritizer.rb +0 -16
  168. data/vendored/puppet/lib/puppet/graph/title_hash_prioritizer.rb +0 -16
  169. data/vendored/puppet/lib/puppet/indirector/certificate/ca.rb +0 -9
  170. data/vendored/puppet/lib/puppet/indirector/certificate/disabled_ca.rb +0 -22
  171. data/vendored/puppet/lib/puppet/indirector/certificate_request/ca.rb +0 -22
  172. data/vendored/puppet/lib/puppet/indirector/certificate_request/disabled_ca.rb +0 -22
  173. data/vendored/puppet/lib/puppet/indirector/certificate_revocation_list/ca.rb +0 -8
  174. data/vendored/puppet/lib/puppet/indirector/certificate_revocation_list/disabled_ca.rb +0 -22
  175. data/vendored/puppet/lib/puppet/indirector/certificate_revocation_list/file.rb +0 -8
  176. data/vendored/puppet/lib/puppet/indirector/certificate_revocation_list/rest.rb +0 -11
  177. data/vendored/puppet/lib/puppet/indirector/certificate_status.rb +0 -4
  178. data/vendored/puppet/lib/puppet/indirector/certificate_status/file.rb +0 -91
  179. data/vendored/puppet/lib/puppet/indirector/certificate_status/rest.rb +0 -11
  180. data/vendored/puppet/lib/puppet/indirector/key/ca.rb +0 -16
  181. data/vendored/puppet/lib/puppet/indirector/key/disabled_ca.rb +0 -22
  182. data/vendored/puppet/lib/puppet/indirector/ldap.rb +0 -86
  183. data/vendored/puppet/lib/puppet/indirector/node/ldap.rb +0 -275
  184. data/vendored/puppet/lib/puppet/provider/aixobject.rb +0 -392
  185. data/vendored/puppet/lib/puppet/provider/cron/crontab.rb +0 -297
  186. data/vendored/puppet/lib/puppet/ssl/certificate_authority.rb +0 -475
  187. data/vendored/puppet/lib/puppet/ssl/certificate_authority/autosign_command.rb +0 -45
  188. data/vendored/puppet/lib/puppet/ssl/certificate_authority/interface.rb +0 -324
  189. data/vendored/puppet/lib/puppet/ssl/certificate_factory.rb +0 -219
  190. data/vendored/puppet/lib/puppet/ssl/certificate_revocation_list.rb +0 -111
  191. data/vendored/puppet/lib/puppet/ssl/inventory.rb +0 -55
  192. data/vendored/puppet/lib/puppet/type/cron.rb +0 -480
@@ -28,11 +28,7 @@ DOC
28
28
  def initialize(name)
29
29
  super
30
30
 
31
- if ca?
32
- @password_file = Puppet[:capass]
33
- else
34
- @password_file = Puppet[:passfile]
35
- end
31
+ @password_file = Puppet[:passfile]
36
32
  end
37
33
 
38
34
  def password
@@ -104,7 +104,7 @@ module Puppet::SSL::Oids
104
104
  if File.exists?(custom_oid_file) && File.readable?(custom_oid_file)
105
105
  mapping = nil
106
106
  begin
107
- mapping = YAML.load_file(custom_oid_file)
107
+ mapping = Puppet::Util::Yaml.safe_load_file(custom_oid_file, [Symbol])
108
108
  rescue => err
109
109
  raise Puppet::Error, _("Error loading ssl custom OIDs mapping file from '%{custom_oid_file}': %{err}") % { custom_oid_file: custom_oid_file, err: err }, err.backtrace
110
110
  end
@@ -144,7 +144,6 @@ module Puppet::Test
144
144
  Puppet::Util::Profiler.clear
145
145
 
146
146
  Puppet::SSL::Host.reset
147
- Puppet::SSL::Host.ca_location = :none
148
147
 
149
148
  Puppet.clear_deprecation_warnings
150
149
  end
@@ -224,9 +223,6 @@ module Puppet::Test
224
223
  # Initialize "app defaults" settings to a good set of test values
225
224
  Puppet.settings.initialize_app_defaults(app_defaults_for_tests)
226
225
 
227
- # Avoid opening ports to the outside world
228
- Puppet.settings[:bindaddress] = "127.0.0.1"
229
-
230
226
  # We don't want to depend upon the reported domain name of the
231
227
  # machine running the tests, nor upon the DNS setup of that
232
228
  # domain.
@@ -98,13 +98,9 @@ class Puppet::Transaction::Event
98
98
  'redacted' => @redacted,
99
99
  'corrective_change' => @corrective_change,
100
100
  }
101
- Puppet::Pops::Serialization::ToDataConverter.convert(hash, {
102
- :rich_data => true,
103
- :symbol_as_string => true,
104
- :local_reference => false,
105
- :type_by_reference => true,
106
- :message_prefix => 'Event'
107
- })
101
+ # Use the stringifying converter since rich data is not possible downstream.
102
+ # (This will destroy some data type information, but this is expected).
103
+ Puppet::Pops::Serialization::ToStringifiedConverter.convert(hash, :message_prefix => 'Event')
108
104
  end
109
105
 
110
106
  def property=(prop)
@@ -62,7 +62,7 @@ class Puppet::Transaction::Persistence
62
62
  result = nil
63
63
  Puppet::Util.benchmark(:debug, _("Loaded transaction store file in %{seconds} seconds")) do
64
64
  begin
65
- result = Puppet::Util::Yaml.load_file(filename, false, true)
65
+ result = Puppet::Util::Yaml.safe_load_file(filename, [Symbol])
66
66
  rescue Puppet::Util::Yaml::YamlLoadError => detail
67
67
  Puppet.log_exception(detail, _("Transaction store file %{filename} is corrupt (%{detail}); replacing") % { filename: filename, detail: detail }, { :level => :warning })
68
68
 
@@ -78,8 +78,8 @@ module Puppet
78
78
 
79
79
  attr_reader :output
80
80
  desc "The expected exit code(s). An error will be returned if the
81
- executed command has some other exit code. Defaults to 0. Can be
82
- specified as an array of acceptable exit codes or a single value.
81
+ executed command has some other exit code. Can be specified as an array
82
+ of acceptable exit codes or a single value.
83
83
 
84
84
  On POSIX systems, exit codes are always integers between 0 and 255.
85
85
 
@@ -197,17 +197,20 @@ module Puppet
197
197
  end
198
198
 
199
199
  newparam(:user) do
200
- desc "The user to run the command as. Note that if you
201
- use this then any error output is not currently captured. This
202
- is because of a bug within Ruby. If you are using Puppet to
203
- create this user, the exec will automatically require the user,
204
- as long as it is specified by name.
200
+ desc "The user to run the command as.
201
+
202
+ > **Note:** Puppet cannot execute commands as other users on Windows.
205
203
 
206
- Please note that the $HOME environment variable is not automatically set
207
- when using this attribute."
204
+ Note that if you use this attribute, any error output is not captured
205
+ due to a bug within Ruby. If you use Puppet to create this user, the
206
+ exec automatically requires the user, as long as it is specified by
207
+ name.
208
+
209
+ The $HOME environment variable is not automatically set when using
210
+ this attribute."
208
211
 
209
212
  validate do |user|
210
- if Puppet.features.microsoft_windows?
213
+ if Puppet::Util::Platform.windows?
211
214
  self.fail _("Unable to execute commands as other users on Windows")
212
215
  elsif !Puppet.features.root? && resource.current_username() != user
213
216
  self.fail _("Only root can execute commands as other users")
@@ -230,7 +233,7 @@ module Puppet
230
233
 
231
234
  newparam(:logoutput) do
232
235
  desc "Whether to log command output in addition to logging the
233
- exit code. Defaults to `on_failure`, which only logs the output
236
+ exit code. Defaults to `on_failure`, which only logs the output
234
237
  when the command has an exit code that does not match any value
235
238
  specified by the `returns` attribute. As with any resource type,
236
239
  the log level can be controlled with the `loglevel` metaparameter."
@@ -305,10 +308,9 @@ module Puppet
305
308
 
306
309
  newparam(:tries) do
307
310
  desc "The number of times execution of the command should be tried.
308
- Defaults to '1'. This many attempts will be made to execute
309
- the command until an acceptable return code is returned.
310
- Note that the timeout parameter applies to each try rather than
311
- to the complete set of tries."
311
+ This many attempts will be made to execute the command until an
312
+ acceptable return code is returned. Note that the timeout parameter
313
+ applies to each try rather than to the complete set of tries."
312
314
 
313
315
  munge do |value|
314
316
  if value.is_a?(String)
@@ -527,7 +529,7 @@ module Puppet
527
529
  # Stick the cwd in there if we have it
528
530
  reqs << self[:cwd] if self[:cwd]
529
531
 
530
- file_regex = Puppet.features.microsoft_windows? ? %r{^([a-zA-Z]:[\\/]\S+)} : %r{^(/\S+)}
532
+ file_regex = Puppet::Util::Platform.windows? ? %r{^([a-zA-Z]:[\\/]\S+)} : %r{^(/\S+)}
531
533
 
532
534
  self[:command].scan(file_regex) { |str|
533
535
  reqs << str
@@ -207,7 +207,7 @@ Puppet::Type.newtype(:file) do
207
207
  whose content doesn't match what the `source` or `content` attribute
208
208
  specifies. Setting this to false allows file resources to initialize files
209
209
  without overwriting future changes. Note that this only affects content;
210
- Puppet will still manage ownership and permissions. Defaults to `true`."
210
+ Puppet will still manage ownership and permissions."
211
211
  defaultto :true
212
212
  end
213
213
 
@@ -320,7 +320,7 @@ Puppet::Type.newtype(:file) do
320
320
 
321
321
  newparam(:validate_replacement) do
322
322
  desc "The replacement string in a `validate_cmd` that will be replaced
323
- with an input file name. Defaults to: `%`"
323
+ with an input file name."
324
324
 
325
325
  defaultto '%'
326
326
  end
@@ -749,7 +749,7 @@ Puppet::Type.newtype(:file) do
749
749
  # This check is done in retrieve to ensure it happens before we try to use
750
750
  # metadata in `copy_source_values`, but so it only fails the resource and not
751
751
  # catalog validation (because that would be a breaking change from Puppet 4).
752
- if Puppet.features.microsoft_windows? && parameter(:source) &&
752
+ if Puppet::Util::Platform.windows? && parameter(:source) &&
753
753
  [:use, :use_when_creating].include?(self[:source_permissions])
754
754
  #TRANSLATORS "source_permissions => ignore" should not be translated
755
755
  err_msg = _("Copying owner/mode/group from the source file on Windows is not supported; use source_permissions => ignore.")
@@ -31,7 +31,7 @@ module Puppet
31
31
  * Fully qualified paths to locally available files (including files on NFS
32
32
  shares or Windows mapped drives).
33
33
  * `file:` URIs, which behave the same as local file paths.
34
- * `http:` URIs, which point to files served by common web servers
34
+ * `http:` URIs, which point to files served by common web servers.
35
35
 
36
36
  The normal form of a `puppet:` URI is:
37
37
 
@@ -47,10 +47,14 @@ module Puppet
47
47
  a source directory contains symlinks, use the `links` attribute to
48
48
  specify whether to recreate links or follow them.
49
49
 
50
- *HTTP* URIs cannot be used to recursively synchronize whole directory
51
- trees. It is also not possible to use `source_permissions` values other
52
- than `ignore`. That's because HTTP servers do not transfer any metadata
53
- that translates to ownership or permission details.
50
+ _HTTP_ URIs cannot be used to recursively synchronize whole directory
51
+ trees. You cannot use `source_permissions` values other than `ignore`
52
+ because HTTP servers do not transfer any metadata that translates to
53
+ ownership or permission details.
54
+
55
+ The `http` source uses the server `Content-MD5` header as a checksum to
56
+ determine if the remote file has changed. If the server response does not
57
+ include that header, Puppet defaults to using the `Last-Modified` header.
54
58
 
55
59
  Multiple `source` values can be specified as an array, and Puppet will
56
60
  use the first source that exists. This can be used to serve different
@@ -152,7 +156,7 @@ module Puppet
152
156
  next if metadata_method == :group and !Puppet.features.root?
153
157
 
154
158
  case resource[:source_permissions]
155
- when :ignore
159
+ when :ignore, nil
156
160
  next
157
161
  when :use_when_creating
158
162
  next if Puppet::FileSystem.exist?(resource[:path])
@@ -254,7 +258,7 @@ module Puppet
254
258
  def copy_source_value(metadata_method)
255
259
  param_name = (metadata_method == :checksum) ? :content : metadata_method
256
260
  if resource[param_name].nil? or resource[param_name] == :absent
257
- if Puppet.features.microsoft_windows? && [:owner, :group, :mode].include?(metadata_method)
261
+ if Puppet::Util::Platform.windows? && [:owner, :group, :mode].include?(metadata_method)
258
262
  devfail "Should not have tried to use source owner/mode/group on Windows"
259
263
  end
260
264
 
@@ -352,5 +356,14 @@ module Puppet
352
356
 
353
357
  defaultto :ignore
354
358
  newvalues(:use, :use_when_creating, :ignore)
359
+ munge do |value|
360
+ value = value ? value.to_sym : :ignore
361
+ if @resource.file && @resource.line && value != :ignore
362
+ #TRANSLATORS "source_permissions" is a parameter name and should not be translated
363
+ Puppet.puppet_deprecation_warning(_("The `source_permissions` parameter is deprecated. Explicitly set `owner`, `group`, and `mode`."), file: @resource.file, line: @resource.line)
364
+ end
365
+
366
+ value
367
+ end
355
368
  end
356
369
  end
@@ -141,7 +141,7 @@ module Puppet
141
141
  end
142
142
 
143
143
  newparam(:allowdupe, :boolean => true, :parent => Puppet::Parameter::Boolean) do
144
- desc "Whether to allow duplicate GIDs. Defaults to `false`."
144
+ desc "Whether to allow duplicate GIDs."
145
145
 
146
146
  defaultto false
147
147
  end
@@ -154,6 +154,8 @@ module Puppet
154
154
  desc "Specify group AIX attributes, as an array of `'key=value'` strings. This
155
155
  parameter's behavior can be configured with `attribute_membership`."
156
156
 
157
+ self.log_only_changed_or_new_keys = true
158
+
157
159
  def membership
158
160
  :attribute_membership
159
161
  end
@@ -161,10 +163,6 @@ module Puppet
161
163
  def delimiter
162
164
  " "
163
165
  end
164
-
165
- validate do |value|
166
- raise ArgumentError, _("Attributes value pairs must be separated by an =") unless value.include?("=")
167
- end
168
166
  end
169
167
 
170
168
  newparam(:attribute_membership) do
@@ -32,7 +32,7 @@ module Puppet
32
32
  end
33
33
 
34
34
  newparam(:withpath) do
35
- desc "Whether to show the full object path. Defaults to false."
35
+ desc "Whether to show the full object path."
36
36
  defaultto :false
37
37
 
38
38
  newvalues(:true, :false)
@@ -411,8 +411,7 @@ module Puppet
411
411
 
412
412
  newparam(:configfiles) do
413
413
  desc "Whether to keep or replace modified config files when installing or
414
- upgrading a package. This only affects the `apt` and `dpkg` providers.
415
- Defaults to `keep`."
414
+ upgrading a package. This only affects the `apt` and `dpkg` providers."
416
415
 
417
416
  defaultto :keep
418
417
 
@@ -547,9 +546,7 @@ module Puppet
547
546
 
548
547
  If you use this, be careful of notifying classes when you want to restart
549
548
  services. If the class also contains a refreshable package, doing so could
550
- cause unnecessary re-installs.
551
-
552
- Defaults to `false`."
549
+ cause unnecessary re-installs."
553
550
  newvalues(:true, :false)
554
551
 
555
552
  defaultto :false
@@ -261,7 +261,7 @@ module Puppet
261
261
 
262
262
  newparam(:repeat) do
263
263
  desc "How often a given resource may be applied in this schedule's `period`.
264
- Defaults to 1; must be an integer."
264
+ Must be an integer."
265
265
 
266
266
  defaultto 1
267
267
 
@@ -85,7 +85,7 @@ module Puppet
85
85
  end
86
86
 
87
87
  validate do |value|
88
- if value == :manual and !Puppet.features.microsoft_windows?
88
+ if value == :manual && !Puppet::Util::Platform.windows?
89
89
  raise Puppet::Error.new(_("Setting enable to manual is only supported on Microsoft Windows."))
90
90
  end
91
91
  end
@@ -135,8 +135,7 @@ module Puppet
135
135
 
136
136
  newparam(:hasstatus) do
137
137
  desc "Declare whether the service's init script has a functional status
138
- command; defaults to `true`. This attribute's default value changed in
139
- Puppet 2.7.0.
138
+ command. This attribute's default value changed in Puppet 2.7.0.
140
139
 
141
140
  The init script's status command must return 0 if the service is
142
141
  running and a nonzero value otherwise. Ideally, these exit codes
@@ -230,9 +229,7 @@ module Puppet
230
229
  newparam :hasrestart do
231
230
  desc "Specify that an init script has a `restart` command. If this is
232
231
  false and you do not specify a command in the `restart` attribute,
233
- the init script's `stop` and `start` commands will be used.
234
-
235
- Defaults to false."
232
+ the init script's `stop` and `start` commands will be used."
236
233
  newvalues(:true, :false)
237
234
  end
238
235
 
@@ -188,7 +188,7 @@ Puppet::Type.newtype(:tidy) do
188
188
  end
189
189
 
190
190
  newparam(:type) do
191
- desc "Set the mechanism for determining age. Default: atime."
191
+ desc "Set the mechanism for determining age."
192
192
 
193
193
  newvalues(:atime, :mtime, :ctime)
194
194
 
@@ -378,9 +378,7 @@ module Puppet
378
378
  that the user is a part of.
379
379
 
380
380
  If `inclusive` is specified, Puppet will ensure that the user is a
381
- member of **only** specified groups.
382
-
383
- Defaults to `minimum`."
381
+ member of **only** specified groups."
384
382
 
385
383
  newvalues(:inclusive, :minimum)
386
384
 
@@ -391,13 +389,13 @@ module Puppet
391
389
  desc "Whether the user is a system user, according to the OS's criteria;
392
390
  on most platforms, a UID less than or equal to 500 indicates a system
393
391
  user. This parameter is only used when the resource is created and will
394
- not affect the UID when the user is present. Defaults to `false`."
392
+ not affect the UID when the user is present."
395
393
 
396
394
  defaultto false
397
395
  end
398
396
 
399
397
  newparam(:allowdupe, :boolean => true, :parent => Puppet::Parameter::Boolean) do
400
- desc "Whether to allow duplicate UIDs. Defaults to `false`."
398
+ desc "Whether to allow duplicate UIDs."
401
399
 
402
400
  defaultto false
403
401
  end
@@ -405,7 +403,7 @@ module Puppet
405
403
  newparam(:managehome, :boolean => true, :parent => Puppet::Parameter::Boolean) do
406
404
  desc "Whether to manage the home directory when Puppet creates or removes the user.
407
405
  This creates the home directory if Puppet also creates the user account, and deletes the
408
- home directory if Puppet also removes the user account. Defaults to `false`.
406
+ home directory if Puppet also removes the user account.
409
407
 
410
408
  This parameter has no effect unless Puppet is also creating or removing the user in the
411
409
  resource at the same time. For instance, Puppet creates a home directory for a managed
@@ -531,7 +529,7 @@ module Puppet
531
529
  newparam(:role_membership) do
532
530
  desc "Whether specified roles should be considered the **complete list**
533
531
  (`inclusive`) or the **minimum list** (`minimum`) of roles the user
534
- has. Defaults to `minimum`."
532
+ has."
535
533
 
536
534
  newvalues(:inclusive, :minimum)
537
535
 
@@ -557,7 +555,7 @@ module Puppet
557
555
  newparam(:auth_membership) do
558
556
  desc "Whether specified auths should be considered the **complete list**
559
557
  (`inclusive`) or the **minimum list** (`minimum`) of auths the user
560
- has. Defaults to `minimum`."
558
+ has."
561
559
 
562
560
  newvalues(:inclusive, :minimum)
563
561
 
@@ -583,7 +581,7 @@ module Puppet
583
581
  newparam(:profile_membership) do
584
582
  desc "Whether specified roles should be treated as the **complete list**
585
583
  (`inclusive`) or the **minimum list** (`minimum`) of roles
586
- of which the user is a member. Defaults to `minimum`."
584
+ of which the user is a member."
587
585
 
588
586
  newvalues(:inclusive, :minimum)
589
587
 
@@ -596,16 +594,12 @@ module Puppet
596
594
  def membership
597
595
  :key_membership
598
596
  end
599
-
600
- validate do |value|
601
- raise ArgumentError, _("Key/value pairs must be separated by an =") unless value.include?("=")
602
- end
603
597
  end
604
598
 
605
599
  newparam(:key_membership) do
606
600
  desc "Whether specified key/value pairs should be considered the
607
601
  **complete list** (`inclusive`) or the **minimum list** (`minimum`) of
608
- the user's attributes. Defaults to `minimum`."
602
+ the user's attributes."
609
603
 
610
604
  newvalues(:inclusive, :minimum)
611
605
 
@@ -623,6 +617,8 @@ module Puppet
623
617
  newproperty(:attributes, :parent => Puppet::Property::KeyValue, :required_features => :manages_aix_lam) do
624
618
  desc "Specify AIX attributes for the user in an array of attribute = value pairs."
625
619
 
620
+ self.log_only_changed_or_new_keys = true
621
+
626
622
  def membership
627
623
  :attribute_membership
628
624
  end
@@ -630,16 +626,12 @@ module Puppet
630
626
  def delimiter
631
627
  " "
632
628
  end
633
-
634
- validate do |value|
635
- raise ArgumentError, _("Attributes value pairs must be separated by an =") unless value.include?("=")
636
- end
637
629
  end
638
630
 
639
631
  newparam(:attribute_membership) do
640
632
  desc "Whether specified attribute value pairs should be treated as the
641
633
  **complete list** (`inclusive`) or the **minimum list** (`minimum`) of
642
- attribute/value pairs for the user. Defaults to `minimum`."
634
+ attribute/value pairs for the user."
643
635
 
644
636
  newvalues(:inclusive, :minimum)
645
637
 
@@ -743,7 +735,8 @@ module Puppet
743
735
  if entry =~ /^~|^%h/ and not home
744
736
  raise ArgumentError, _("purge_ssh_keys value '%{value}' meta character ~ or %{home_placeholder} only allowed for users with a defined home directory") % { value: value, home_placeholder: '%h' }
745
737
  end
746
- entry.gsub!(/^~\//, "#{home}/")
738
+ # make sure frozen value is duplicated by using a gsub, second mutating gsub! is then ok
739
+ entry = entry.gsub(/^~\//, "#{home}/")
747
740
  entry.gsub!(/^%h\//, "#{home}/")
748
741
  entry
749
742
  end