puppet 6.17.0 → 6.18.0

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

Potentially problematic release.


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

Files changed (189) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +6 -5
  3. data/lib/puppet/application/apply.rb +18 -20
  4. data/lib/puppet/application/lookup.rb +16 -4
  5. data/lib/puppet/configurer/downloader.rb +31 -10
  6. data/lib/puppet/confine.rb +1 -1
  7. data/lib/puppet/confine/any.rb +1 -1
  8. data/lib/puppet/defaults.rb +21 -3
  9. data/lib/puppet/feature/base.rb +1 -1
  10. data/lib/puppet/file_serving/mount/locales.rb +1 -2
  11. data/lib/puppet/file_serving/mount/pluginfacts.rb +1 -2
  12. data/lib/puppet/file_serving/mount/plugins.rb +1 -2
  13. data/lib/puppet/file_system/file_impl.rb +3 -3
  14. data/lib/puppet/functions/lstrip.rb +4 -4
  15. data/lib/puppet/functions/reverse_each.rb +1 -1
  16. data/lib/puppet/functions/rstrip.rb +4 -4
  17. data/lib/puppet/functions/step.rb +1 -1
  18. data/lib/puppet/functions/strip.rb +4 -4
  19. data/lib/puppet/gettext/config.rb +5 -5
  20. data/lib/puppet/gettext/module_translations.rb +4 -4
  21. data/lib/puppet/indirector/exec.rb +1 -1
  22. data/lib/puppet/indirector/facts/facter.rb +3 -3
  23. data/lib/puppet/indirector/file_metadata/http.rb +1 -0
  24. data/lib/puppet/indirector/hiera.rb +4 -0
  25. data/lib/puppet/indirector/indirection.rb +1 -1
  26. data/lib/puppet/indirector/report/processor.rb +2 -2
  27. data/lib/puppet/module.rb +1 -2
  28. data/lib/puppet/network/format_support.rb +2 -2
  29. data/lib/puppet/network/http/route.rb +2 -2
  30. data/lib/puppet/node/environment.rb +12 -5
  31. data/lib/puppet/pal/pal_impl.rb +27 -3
  32. data/lib/puppet/parameter.rb +1 -1
  33. data/lib/puppet/parser/functions.rb +21 -17
  34. data/lib/puppet/parser/functions/create_resources.rb +11 -7
  35. data/lib/puppet/parser/type_loader.rb +2 -2
  36. data/lib/puppet/pops/adaptable.rb +7 -13
  37. data/lib/puppet/pops/adapters.rb +8 -4
  38. data/lib/puppet/pops/loader/runtime3_type_loader.rb +4 -2
  39. data/lib/puppet/pops/loaders.rb +18 -11
  40. data/lib/puppet/pops/lookup/context.rb +1 -1
  41. data/lib/puppet/pops/lookup/hiera_config.rb +14 -1
  42. data/lib/puppet/pops/types/iterable.rb +34 -8
  43. data/lib/puppet/pops/validation/checker4_0.rb +19 -15
  44. data/lib/puppet/provider/file/windows.rb +1 -1
  45. data/lib/puppet/provider/package/apt.rb +34 -0
  46. data/lib/puppet/provider/package/gem.rb +4 -2
  47. data/lib/puppet/provider/package/puppet_gem.rb +5 -0
  48. data/lib/puppet/provider/package/zypper.rb +3 -0
  49. data/lib/puppet/provider/user/aix.rb +1 -1
  50. data/lib/puppet/provider/user/user_role_add.rb +1 -1
  51. data/lib/puppet/provider/user/windows_adsi.rb +18 -1
  52. data/lib/puppet/settings.rb +1 -1
  53. data/lib/puppet/ssl/validator/default_validator.rb +1 -1
  54. data/lib/puppet/test/test_helper.rb +10 -3
  55. data/lib/puppet/transaction.rb +2 -2
  56. data/lib/puppet/transaction/persistence.rb +1 -1
  57. data/lib/puppet/transaction/report.rb +1 -1
  58. data/lib/puppet/trusted_external.rb +2 -2
  59. data/lib/puppet/type.rb +4 -3
  60. data/lib/puppet/type/file.rb +2 -2
  61. data/lib/puppet/type/file/source.rb +27 -7
  62. data/lib/puppet/type/notify.rb +2 -2
  63. data/lib/puppet/type/service.rb +4 -0
  64. data/lib/puppet/type/user.rb +18 -3
  65. data/lib/puppet/util.rb +26 -12
  66. data/lib/puppet/util/autoload.rb +9 -7
  67. data/lib/puppet/util/character_encoding.rb +9 -5
  68. data/lib/puppet/util/execution.rb +2 -2
  69. data/lib/puppet/util/windows.rb +1 -0
  70. data/lib/puppet/util/windows/api_types.rb +15 -1
  71. data/lib/puppet/util/windows/monkey_patches/dir.rb +40 -0
  72. data/lib/puppet/util/windows/security.rb +4 -4
  73. data/lib/puppet/util/windows/user.rb +219 -0
  74. data/lib/puppet/version.rb +1 -1
  75. data/locales/puppet.pot +78 -69
  76. data/man/man5/puppet.conf.5 +22 -3
  77. data/man/man8/puppet-agent.8 +1 -1
  78. data/man/man8/puppet-apply.8 +1 -1
  79. data/man/man8/puppet-catalog.8 +1 -1
  80. data/man/man8/puppet-config.8 +1 -1
  81. data/man/man8/puppet-describe.8 +1 -1
  82. data/man/man8/puppet-device.8 +1 -1
  83. data/man/man8/puppet-doc.8 +1 -1
  84. data/man/man8/puppet-epp.8 +1 -1
  85. data/man/man8/puppet-facts.8 +1 -1
  86. data/man/man8/puppet-filebucket.8 +1 -1
  87. data/man/man8/puppet-generate.8 +1 -1
  88. data/man/man8/puppet-help.8 +1 -1
  89. data/man/man8/puppet-key.8 +1 -1
  90. data/man/man8/puppet-lookup.8 +2 -2
  91. data/man/man8/puppet-man.8 +1 -1
  92. data/man/man8/puppet-module.8 +1 -1
  93. data/man/man8/puppet-node.8 +1 -1
  94. data/man/man8/puppet-parser.8 +1 -1
  95. data/man/man8/puppet-plugin.8 +1 -1
  96. data/man/man8/puppet-report.8 +1 -1
  97. data/man/man8/puppet-resource.8 +1 -1
  98. data/man/man8/puppet-script.8 +1 -1
  99. data/man/man8/puppet-ssl.8 +1 -1
  100. data/man/man8/puppet-status.8 +1 -1
  101. data/man/man8/puppet.8 +2 -2
  102. data/spec/fixtures/integration/application/apply/environments/spec/modules/amod/lib/puppet/provider/applytest/applytest.rb +2 -0
  103. data/spec/fixtures/integration/application/apply/environments/spec/modules/amod/lib/puppet/type/applytest.rb +25 -0
  104. data/spec/fixtures/unit/forge/bacula-releases.json +128 -0
  105. data/spec/fixtures/unit/forge/bacula.tar.gz +0 -0
  106. data/spec/integration/application/agent_spec.rb +29 -37
  107. data/spec/integration/application/apply_spec.rb +149 -149
  108. data/spec/integration/application/config_spec.rb +74 -0
  109. data/spec/integration/application/doc_spec.rb +16 -6
  110. data/spec/integration/application/filebucket_spec.rb +65 -16
  111. data/spec/integration/application/help_spec.rb +42 -0
  112. data/spec/integration/application/lookup_spec.rb +13 -0
  113. data/spec/integration/application/module_spec.rb +68 -0
  114. data/spec/integration/application/plugin_spec.rb +50 -0
  115. data/spec/integration/data_binding_spec.rb +82 -0
  116. data/spec/integration/directory_environments_spec.rb +17 -17
  117. data/spec/integration/indirector/facts/facter_spec.rb +8 -6
  118. data/spec/integration/node/environment_spec.rb +1 -1
  119. data/spec/integration/util/execution_spec.rb +22 -0
  120. data/spec/integration/util/windows/monkey_patches/dir_spec.rb +11 -0
  121. data/spec/integration/util/windows/process_spec.rb +26 -32
  122. data/spec/integration/util/windows/user_spec.rb +7 -0
  123. data/spec/integration/util_spec.rb +7 -33
  124. data/spec/lib/puppet_spec/matchers.rb +0 -80
  125. data/spec/lib/puppet_spec/puppetserver.rb +8 -0
  126. data/spec/unit/application/agent_spec.rb +3 -4
  127. data/spec/unit/application/face_base_spec.rb +6 -4
  128. data/spec/unit/application/facts_spec.rb +39 -10
  129. data/spec/unit/application/man_spec.rb +52 -0
  130. data/spec/unit/application/resource_spec.rb +3 -1
  131. data/spec/unit/application/ssl_spec.rb +15 -2
  132. data/spec/unit/configurer/downloader_spec.rb +10 -0
  133. data/spec/unit/configurer_spec.rb +47 -31
  134. data/spec/unit/confine_spec.rb +2 -1
  135. data/spec/unit/face/config_spec.rb +3 -1
  136. data/spec/unit/file_serving/mount/locales_spec.rb +2 -2
  137. data/spec/unit/file_serving/mount/pluginfacts_spec.rb +2 -2
  138. data/spec/unit/file_serving/mount/plugins_spec.rb +2 -2
  139. data/spec/unit/file_system/uniquefile_spec.rb +18 -0
  140. data/spec/unit/http/client_spec.rb +0 -1
  141. data/spec/unit/http/resolver_spec.rb +0 -1
  142. data/spec/unit/http/service/ca_spec.rb +0 -1
  143. data/spec/unit/http/service/compiler_spec.rb +0 -1
  144. data/spec/unit/http/service/file_server_spec.rb +0 -1
  145. data/spec/unit/http/service/report_spec.rb +0 -1
  146. data/spec/unit/http/service_spec.rb +0 -1
  147. data/spec/unit/http/session_spec.rb +0 -1
  148. data/spec/unit/module_tool/tar/mini_spec.rb +20 -0
  149. data/spec/unit/network/format_support_spec.rb +3 -2
  150. data/spec/unit/node/environment_spec.rb +18 -1
  151. data/spec/unit/pops/loaders/loaders_spec.rb +70 -0
  152. data/spec/unit/pops/lookup/lookup_spec.rb +25 -0
  153. data/spec/unit/provider/package/apt_spec.rb +77 -0
  154. data/spec/unit/provider/package/aptitude_spec.rb +1 -0
  155. data/spec/unit/provider/package/puppet_gem_spec.rb +4 -1
  156. data/spec/unit/provider/package/zypper_spec.rb +14 -0
  157. data/spec/unit/provider/service/init_spec.rb +41 -0
  158. data/spec/unit/provider/service/systemd_spec.rb +1 -6
  159. data/spec/unit/provider/service/windows_spec.rb +28 -0
  160. data/spec/unit/provider/user/windows_adsi_spec.rb +82 -0
  161. data/spec/unit/puppet_pal_2pec.rb +40 -0
  162. data/spec/unit/reports/store_spec.rb +17 -13
  163. data/spec/unit/transaction/persistence_spec.rb +15 -0
  164. data/spec/unit/type/service_spec.rb +35 -2
  165. data/spec/unit/type/user_spec.rb +31 -2
  166. data/spec/unit/util/character_encoding_spec.rb +4 -4
  167. data/spec/unit/util/command_line_spec.rb +11 -6
  168. metadata +21 -44
  169. data/spec/integration/faces/config_spec.rb +0 -91
  170. data/spec/integration/faces/documentation_spec.rb +0 -57
  171. data/spec/integration/file_bucket/file_spec.rb +0 -50
  172. data/spec/integration/file_serving/content_spec.rb +0 -7
  173. data/spec/integration/file_serving/fileset_spec.rb +0 -12
  174. data/spec/integration/file_serving/metadata_spec.rb +0 -8
  175. data/spec/integration/file_serving/terminus_helper_spec.rb +0 -20
  176. data/spec/integration/file_system/uniquefile_spec.rb +0 -26
  177. data/spec/integration/module_tool/forge_spec.rb +0 -51
  178. data/spec/integration/module_tool/tar/mini_spec.rb +0 -28
  179. data/spec/integration/provider/service/init_spec.rb +0 -48
  180. data/spec/integration/provider/service/systemd_spec.rb +0 -25
  181. data/spec/integration/provider/service/windows_spec.rb +0 -50
  182. data/spec/integration/reference/providers_spec.rb +0 -21
  183. data/spec/integration/reports_spec.rb +0 -13
  184. data/spec/integration/ssl/certificate_request_spec.rb +0 -44
  185. data/spec/integration/ssl/host_spec.rb +0 -72
  186. data/spec/integration/ssl/key_spec.rb +0 -99
  187. data/spec/shared_behaviours/file_serving_model.rb +0 -51
  188. data/spec/unit/face/man_spec.rb +0 -25
  189. data/spec/unit/man_spec.rb +0 -31
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ce222e2720882560d874607f4b7202a5421e58f904caceac7cd481385abee714
4
- data.tar.gz: b55fadb67cb0a7427df5bcbaf0a40f2e24fd28332af599f68203806249027db4
3
+ metadata.gz: bf5ac6e28d95350f532bc1c6bcb5b869881f1b29323f1455763924b371fdef7f
4
+ data.tar.gz: 5553106013a2baec4b282f1c0c6b7084c1062fda1eb4739dff8496c8cef8231e
5
5
  SHA512:
6
- metadata.gz: 300b054c35d6681fd46b0dc5873df43a93d2f3839750a92bcd49b178387c844b858cfa8b7785593632c4c487c59e50137ee07658b3122d949173659695674717
7
- data.tar.gz: a17a857745b31fa04083bbf7476d399f9196b23288d83fff831f79aa06df630c282e9ebb85b9419d7930d816b94f3d8474a12628fceb039ca6f7f4e8dc599f10
6
+ metadata.gz: 1dae5ece034ab7274128c2455a169a83cbd15bc6d05b0b8c3ed93006272f2866ac74fc11016ceb5076ac0dec609cfbd0a465a44f4acdd9c4e95c190309ca6f2d
7
+ data.tar.gz: 48eb831d0b9731520b0e33d88f6e46ec3ec2bbc4536240e6866a0b84f6f284b43d06c8588dbc281f7eb6c993620d197aec22111eda64455cabf5f4d9559c2b31
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- puppet (6.17.0)
4
+ puppet (6.18.0)
5
5
  CFPropertyList (~> 2.2)
6
6
  concurrent-ruby (~> 1.0)
7
7
  deep_merge (~> 1.0)
@@ -22,14 +22,14 @@ GEM
22
22
  artifactory (2.8.2)
23
23
  ast (2.4.1)
24
24
  coderay (1.1.3)
25
- concurrent-ruby (1.1.6)
25
+ concurrent-ruby (1.1.7)
26
26
  crack (0.4.3)
27
27
  safe_yaml (~> 1.0.0)
28
28
  csv (3.1.5)
29
29
  deep_merge (1.2.1)
30
30
  diff-lcs (1.4.4)
31
31
  docopt (0.6.1)
32
- facter (4.0.29)
32
+ facter (4.0.35)
33
33
  hocon (~> 1.3)
34
34
  thor (>= 1.0.1, < 2.0)
35
35
  fast_gettext (1.1.2)
@@ -59,8 +59,9 @@ GEM
59
59
  multi_json (1.15.0)
60
60
  mustache (1.1.1)
61
61
  optimist (3.0.1)
62
- packaging (0.99.66)
62
+ packaging (0.99.68)
63
63
  artifactory (~> 2)
64
+ csv (= 3.1.5)
64
65
  rake (>= 12.3)
65
66
  release-metrics
66
67
  parallel (1.19.2)
@@ -79,7 +80,7 @@ GEM
79
80
  rainbow (2.2.2)
80
81
  rake
81
82
  rake (12.3.3)
82
- rdiscount (2.2.0.1)
83
+ rdiscount (2.2.0.2)
83
84
  rdoc (6.2.1)
84
85
  release-metrics (1.1.0)
85
86
  csv
@@ -190,7 +190,7 @@ Copyright (c) 2011 Puppet Inc., LLC Licensed under the Apache 2.0 License
190
190
  text = Puppet::FileSystem.read(options[:catalog], :encoding => 'utf-8')
191
191
  end
192
192
  env = Puppet.lookup(:environments).get(Puppet[:environment])
193
- Puppet.override(:current_environment => env, :loaders => Puppet::Pops::Loaders.new(env)) do
193
+ Puppet.override(:current_environment => env, :loaders => create_loaders(env)) do
194
194
  catalog = read_catalog(text)
195
195
  apply_catalog(catalog)
196
196
  end
@@ -204,7 +204,7 @@ Copyright (c) 2011 Puppet Inc., LLC Licensed under the Apache 2.0 License
204
204
  apply_environment = get_configured_environment(node, manifest)
205
205
 
206
206
  # TRANSLATORS "puppet apply" is a program command and should not be translated
207
- Puppet.override({:current_environment => apply_environment}, _("For puppet apply")) do
207
+ Puppet.override({:current_environment => apply_environment, :loaders => create_loaders(apply_environment)}, _("For puppet apply")) do
208
208
  configure_node_facts(node, facts)
209
209
 
210
210
  # Allow users to load the classes that puppet agent creates.
@@ -235,30 +235,23 @@ Copyright (c) 2011 Puppet Inc., LLC Licensed under the Apache 2.0 License
235
235
  exit(1)
236
236
  end
237
237
 
238
- # Loaders are required when resolving deferred values and at the end
239
- # when apply_catalog is called - it is therefore used around all of the
240
- # required steps as it is expensive to set up loaders twice (once for
241
- # resolution and once for the apply).
242
- #
243
- exit_status = Puppet.override(:loaders => Puppet::Pops::Loaders.new(apply_environment)) do
238
+ # Resolve all deferred values and replace them / mutate the catalog
239
+ Puppet::Pops::Evaluator::DeferredResolver.resolve_and_replace(node.facts, catalog)
244
240
 
245
- # Resolve all deferred values and replace them / mutate the catalog
246
- Puppet::Pops::Evaluator::DeferredResolver.resolve_and_replace(node.facts, catalog)
241
+ # Translate it to a RAL catalog
242
+ catalog = catalog.to_ral
247
243
 
248
- # Translate it to a RAL catalog
249
- catalog = catalog.to_ral
244
+ catalog.finalize
250
245
 
251
- catalog.finalize
246
+ catalog.retrieval_duration = Time.now - starttime
252
247
 
253
- catalog.retrieval_duration = Time.now - starttime
248
+ if options[:write_catalog_summary]
249
+ catalog.write_class_file
250
+ catalog.write_resource_file
251
+ end
254
252
 
255
- if options[:write_catalog_summary]
256
- catalog.write_class_file
257
- catalog.write_resource_file
258
- end
253
+ exit_status = apply_catalog(catalog)
259
254
 
260
- apply_catalog(catalog)
261
- end
262
255
  if not exit_status
263
256
  exit(1)
264
257
  elsif options[:detailed_exitcodes] then
@@ -313,6 +306,11 @@ Copyright (c) 2011 Puppet Inc., LLC Licensed under the Apache 2.0 License
313
306
 
314
307
  private
315
308
 
309
+ def create_loaders(env)
310
+ # Ignore both 'cached_puppet_lib' and pcore resource type loaders
311
+ Puppet::Pops::Loaders.new(env, false, false)
312
+ end
313
+
316
314
  def read_catalog(text)
317
315
  facts = get_facts()
318
316
  node = get_node()
@@ -90,8 +90,14 @@ class Puppet::Application::Lookup < Puppet::Application
90
90
 
91
91
  exit(Puppet.settings.print_configs ? 0 : 1) if Puppet.settings.print_configs?
92
92
 
93
- Puppet.settings.use :main, :master, :ssl, :metrics
94
-
93
+ if options[:node]
94
+ Puppet::Util.skip_external_facts do
95
+ Puppet.settings.use :main, :master, :ssl, :metrics
96
+ end
97
+ else
98
+ Puppet.settings.use :main, :master, :ssl, :metrics
99
+ end
100
+
95
101
  setup_terminuses
96
102
  end
97
103
 
@@ -102,7 +108,7 @@ class Puppet::Application::Lookup < Puppet::Application
102
108
  def help
103
109
  <<-HELP
104
110
 
105
- puppet lookup(8) -- #{summary}
111
+ puppet-lookup(8) -- #{summary}
106
112
  ========
107
113
 
108
114
  SYNOPSIS
@@ -364,6 +370,12 @@ Copyright (c) 2015 Puppet Inc., LLC Licensed under the Apache 2.0 License
364
370
 
365
371
  Puppet[:code] = 'undef' unless options[:compile]
366
372
  compiler = Puppet::Parser::Compiler.new(node)
367
- compiler.compile { |catalog| yield(compiler.topscope); catalog }
373
+ if options[:node]
374
+ Puppet::Util.skip_external_facts do
375
+ compiler.compile { |catalog| yield(compiler.topscope); catalog }
376
+ end
377
+ else
378
+ compiler.compile { |catalog| yield(compiler.topscope); catalog }
379
+ end
368
380
  end
369
381
  end
@@ -11,32 +11,53 @@ class Puppet::Configurer::Downloader
11
11
  files = []
12
12
  begin
13
13
  catalog.apply do |trans|
14
+ unless Puppet[:ignore_plugin_errors]
15
+ # Propagate the first failure associated with the transaction. The any_failed?
16
+ # method returns the first resource status that failed or nil, not a boolean.
17
+ first_failure = trans.any_failed?
18
+ if first_failure
19
+ event = (first_failure.events || []).first
20
+ detail = event ? event.message : 'unknown'
21
+ raise Puppet::Error.new(_("Failed to retrieve %{name}: %{detail}") % { name: name, detail: detail })
22
+ end
23
+ end
24
+
14
25
  trans.changed?.each do |resource|
15
26
  yield resource if block_given?
16
27
  files << resource[:path]
17
28
  end
18
29
  end
19
30
  rescue Puppet::Error => detail
20
- Puppet.log_exception(detail, _("Could not retrieve %{name}: %{detail}") % { name: name, detail: detail })
31
+ if Puppet[:ignore_plugin_errors]
32
+ Puppet.log_exception(detail, _("Could not retrieve %{name}: %{detail}") % { name: name, detail: detail })
33
+ else
34
+ raise detail
35
+ end
21
36
  end
22
37
  files
23
38
  end
24
39
 
25
40
  def initialize(name, path, source, ignore = nil, environment = nil, source_permissions = :ignore)
26
41
  @name, @path, @source, @ignore, @environment, @source_permissions = name, path, source, ignore, environment, source_permissions
27
- end
28
42
 
29
- def catalog
30
- catalog = Puppet::Resource::Catalog.new("PluginSync", @environment)
31
- catalog.host_config = false
32
- catalog.add_resource(file)
33
- catalog
34
43
  end
35
44
 
36
45
  def file
37
- args = default_arguments.merge(:path => path, :source => source)
38
- args[:ignore] = ignore.split if ignore
39
- Puppet::Type.type(:file).new(args)
46
+ unless @file
47
+ args = default_arguments.merge(:path => path, :source => source)
48
+ args[:ignore] = ignore.split if ignore
49
+ @file = Puppet::Type.type(:file).new(args)
50
+ end
51
+ @file
52
+ end
53
+
54
+ def catalog
55
+ unless @catalog
56
+ @catalog = Puppet::Resource::Catalog.new("PluginSync", @environment)
57
+ @catalog.host_config = false
58
+ @catalog.add_resource(file)
59
+ end
60
+ @catalog
40
61
  end
41
62
 
42
63
  private
@@ -67,7 +67,7 @@ class Puppet::Confine
67
67
  def valid?
68
68
  values.each do |value|
69
69
  unless pass?(value)
70
- Puppet.debug(label + ": " + message(value))
70
+ Puppet.debug { label + ": " + message(value) }
71
71
  return false
72
72
  end
73
73
  end
@@ -19,7 +19,7 @@ class Puppet::Confine::Any < Puppet::Confine
19
19
  if @values.any? { |value| pass?(value) }
20
20
  true
21
21
  else
22
- Puppet.debug("#{label}: #{message(@values)}")
22
+ Puppet.debug { "#{label}: #{message(@values)}" }
23
23
  false
24
24
  end
25
25
  end
@@ -822,7 +822,9 @@ API to expire the cache as needed
822
822
  only use lowercase letters, numbers, periods, underscores, and dashes. (That is,
823
823
  it should match `/\A[a-z0-9._-]+\Z/`.)
824
824
  * The special value `ca` is reserved, and can't be used as the certname
825
- for a normal node.
825
+ for a normal node.
826
+
827
+ **Note:** You must set the certname in the main section of the puppet.conf file. Setting it in a different section causes errors.
826
828
 
827
829
  Defaults to the node's fully qualified domain name.",
828
830
  :hook => proc { |value| raise(ArgumentError, _("Certificate names must be lower case")) unless value == value.downcase }},
@@ -1701,8 +1703,7 @@ EOT
1701
1703
  :type => :duration,
1702
1704
  :desc => "How often puppet agent applies the catalog.
1703
1705
  Note that a runinterval of 0 means \"run continuously\" rather than
1704
- \"never run.\" If you want puppet agent to never run, you should start
1705
- it with the `--no-client` option. #{AS_DURATION}",
1706
+ \"never run.\" #{AS_DURATION}",
1706
1707
  },
1707
1708
  :runtimeout => {
1708
1709
  :default => "1h",
@@ -1958,9 +1959,26 @@ EOT
1958
1959
  is used for retrieval, so anything that is a valid file source can
1959
1960
  be used here.",
1960
1961
  },
1962
+ :pluginsync => {
1963
+ :default => true,
1964
+ :type => :boolean,
1965
+ :desc => "Whether plugins should be synced with the central server. This setting is
1966
+ deprecated.",
1967
+ :hook => proc { |value|
1968
+ #TRANSLATORS 'pluginsync' is a setting and should not be translated
1969
+ Puppet.deprecation_warning(_("Setting 'pluginsync' is deprecated."))
1970
+ }
1971
+ },
1961
1972
  :pluginsignore => {
1962
1973
  :default => ".svn CVS .git .hg",
1963
1974
  :desc => "What files to ignore when pulling down plugins.",
1975
+ },
1976
+ :ignore_plugin_errors => {
1977
+ :default => true,
1978
+ :type => :boolean,
1979
+ :desc => "Whether the puppet run should ignore errors during pluginsync. If the setting
1980
+ is false and there are errors during pluginsync, then the agent will abort the run and
1981
+ submit a report containing information about the failed run."
1964
1982
  }
1965
1983
  )
1966
1984
 
@@ -63,7 +63,7 @@ Puppet.features.add(:manages_symlinks) do
63
63
 
64
64
  true
65
65
  rescue LoadError
66
- Puppet.debug("CreateSymbolicLink is not available")
66
+ Puppet.debug { "CreateSymbolicLink is not available" }
67
67
  false
68
68
  end
69
69
  end
@@ -17,14 +17,13 @@ class Puppet::FileServing::Mount::Locales < Puppet::FileServing::Mount
17
17
  def search(relative_path, request)
18
18
  # We currently only support one kind of search on locales - return
19
19
  # them all.
20
- Puppet.debug("Warning: calling Locales.search with empty module path.") if request.environment.modules.empty?
21
20
  paths = request.environment.modules.find_all { |mod| mod.locales? }.collect { |mod| mod.locale_directory }
22
21
  if paths.empty?
23
22
  # If the modulepath is valid then we still need to return a valid root
24
23
  # directory for the search, but make sure nothing inside it is
25
24
  # returned.
26
25
  request.options[:recurse] = false
27
- request.environment.modulepath.empty? ? nil : request.environment.modulepath
26
+ request.environment.modulepath.empty? ? [Puppet[:codedir]] : request.environment.modulepath
28
27
  else
29
28
  paths
30
29
  end
@@ -17,14 +17,13 @@ class Puppet::FileServing::Mount::PluginFacts < Puppet::FileServing::Mount
17
17
  def search(relative_path, request)
18
18
  # We currently only support one kind of search on plugins - return
19
19
  # them all.
20
- Puppet.debug("Warning: calling Plugins.search with empty module path.") if request.environment.modules.empty?
21
20
  paths = request.environment.modules.find_all { |mod| mod.pluginfacts? }.collect { |mod| mod.plugin_fact_directory }
22
21
  if paths.empty?
23
22
  # If the modulepath is valid then we still need to return a valid root
24
23
  # directory for the search, but make sure nothing inside it is
25
24
  # returned.
26
25
  request.options[:recurse] = false
27
- request.environment.modulepath.empty? ? nil : request.environment.modulepath
26
+ request.environment.modulepath.empty? ? [Puppet[:codedir]] : request.environment.modulepath
28
27
  else
29
28
  paths
30
29
  end
@@ -17,14 +17,13 @@ class Puppet::FileServing::Mount::Plugins < Puppet::FileServing::Mount
17
17
  def search(relative_path, request)
18
18
  # We currently only support one kind of search on plugins - return
19
19
  # them all.
20
- Puppet.debug("Warning: calling Plugins.search with empty module path.") if request.environment.modules.empty?
21
20
  paths = request.environment.modules.find_all { |mod| mod.plugins? }.collect { |mod| mod.plugin_directory }
22
21
  if paths.empty?
23
22
  # If the modulepath is valid then we still need to return a valid root
24
23
  # directory for the search, but make sure nothing inside it is
25
24
  # returned.
26
25
  request.options[:recurse] = false
27
- request.environment.modulepath.empty? ? nil : request.environment.modulepath
26
+ request.environment.modulepath.empty? ? [Puppet[:codedir]] : request.environment.modulepath
28
27
  else
29
28
  paths
30
29
  end
@@ -54,12 +54,12 @@ class Puppet::FileSystem::FileImpl
54
54
  while !written
55
55
  ::File.open(path, options, mode) do |rf|
56
56
  if rf.flock(::File::LOCK_EX|::File::LOCK_NB)
57
- Puppet.debug(_("Locked '%{path}'") % { path: path })
57
+ Puppet.debug{ _("Locked '%{path}'") % { path: path } }
58
58
  yield rf
59
59
  written = true
60
- Puppet.debug(_("Unlocked '%{path}'") % { path: path })
60
+ Puppet.debug{ _("Unlocked '%{path}'") % { path: path } }
61
61
  else
62
- Puppet.debug("Failed to lock '%s' retrying in %.2f milliseconds" % [path, wait * 1000])
62
+ Puppet.debug{ "Failed to lock '%s' retrying in %.2f milliseconds" % [path, wait * 1000] }
63
63
  sleep wait
64
64
  timeout -= wait
65
65
  wait *= 2
@@ -12,15 +12,15 @@
12
12
  #
13
13
  # @example Removing leading space from a String
14
14
  # ```puppet
15
- # "\n\thello".lstrip()
16
- # camelcase("\n\thello")
15
+ # "\n\thello ".lstrip()
16
+ # lstrip("\n\thello ")
17
17
  # ```
18
18
  # Would both result in `"hello"`
19
19
  #
20
20
  # @example Removing leading space from strings in an Array
21
21
  # ```puppet
22
- # ["\n\thello", "\n\thi"].lstrip()
23
- # lstrip(["\n\thello", "\n\thi"])
22
+ # ["\n\thello ", "\n\thi "].lstrip()
23
+ # lstrip(["\n\thello ", "\n\thi "])
24
24
  # ```
25
25
  # Would both result in `['hello', 'hi']`
26
26
  #
@@ -84,7 +84,7 @@ Puppet::Functions.create_function(:reverse_each) do
84
84
 
85
85
  def reverse_each(iterable)
86
86
  # produces an Iterable
87
- Puppet::Pops::Types::Iterable.asserted_iterable(self, iterable).reverse_each
87
+ Puppet::Pops::Types::Iterable.asserted_iterable(self, iterable, true).reverse_each
88
88
  end
89
89
 
90
90
  def reverse_each_block(iterable, &block)
@@ -12,15 +12,15 @@
12
12
  #
13
13
  # @example Removing trailing space from a String
14
14
  # ```puppet
15
- # "hello\n\t".lstrip()
16
- # camelcase("hello\n\t")
15
+ # " hello\n\t".rstrip()
16
+ # rstrip(" hello\n\t")
17
17
  # ```
18
18
  # Would both result in `"hello"`
19
19
  #
20
20
  # @example Removing trailing space from strings in an Array
21
21
  # ```puppet
22
- # ["hello\n\t", "hi\n\t"].lstrip()
23
- # lstrip(["hello\n\t", "hi\n\t"])
22
+ # [" hello\n\t", " hi\n\t"].rstrip()
23
+ # rstrip([" hello\n\t", " hi\n\t"])
24
24
  # ```
25
25
  # Would both result in `['hello', 'hi']`
26
26
  #
@@ -88,7 +88,7 @@ Puppet::Functions.create_function(:step) do
88
88
 
89
89
  def step(iterable, step)
90
90
  # produces an Iterable
91
- Puppet::Pops::Types::Iterable.asserted_iterable(self, iterable).step(step)
91
+ Puppet::Pops::Types::Iterable.asserted_iterable(self, iterable, true).step(step)
92
92
  end
93
93
 
94
94
  def step_block(iterable, step, &block)
@@ -12,15 +12,15 @@
12
12
  #
13
13
  # @example Removing leading and trailing space from a String
14
14
  # ```puppet
15
- # " hello\n\t".lstrip()
16
- # camelcase(" hello\n\t")
15
+ # " hello\n\t".strip()
16
+ # strip(" hello\n\t")
17
17
  # ```
18
18
  # Would both result in `"hello"`
19
19
  #
20
20
  # @example Removing trailing space from strings in an Array
21
21
  # ```puppet
22
- # [" hello\n\t", " hi\n\t"].lstrip()
23
- # lstrip([" hello\n\t", " hi\n\t"])
22
+ # [" hello\n\t", " hi\n\t"].strip()
23
+ # strip([" hello\n\t", " hi\n\t"])
24
24
  # ```
25
25
  # Would both result in `['hello', 'hi']`
26
26
  #