puppet 6.4.5-x64-mingw32 → 6.5.0-x64-mingw32

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 (329) hide show
  1. checksums.yaml +4 -4
  2. data/CODEOWNERS +10 -10
  3. data/Gemfile +6 -6
  4. data/Gemfile.lock +46 -52
  5. data/ext/build_defaults.yaml +0 -1
  6. data/ext/project_data.yaml +3 -3
  7. data/ext/regexp_nodes/regexp_nodes.rb +4 -4
  8. data/ext/solaris/smf/puppet.xml +0 -2
  9. data/ext/windows/eventlog/Rakefile +32 -0
  10. data/ext/windows/eventlog/puppetres.dll +0 -0
  11. data/ext/windows/eventlog/puppetres.mc +18 -0
  12. data/ext/windows/service/daemon.rb +8 -38
  13. data/install.rb +24 -6
  14. data/lib/puppet.rb +3 -1
  15. data/lib/puppet/application.rb +1 -1
  16. data/lib/puppet/application/agent.rb +11 -34
  17. data/lib/puppet/application/apply.rb +6 -6
  18. data/lib/puppet/application/describe.rb +9 -3
  19. data/lib/puppet/application/device.rb +4 -14
  20. data/lib/puppet/application/doc.rb +1 -1
  21. data/lib/puppet/application/lookup.rb +2 -2
  22. data/lib/puppet/application/resource.rb +4 -4
  23. data/lib/puppet/application/script.rb +2 -2
  24. data/lib/puppet/application/ssl.rb +10 -9
  25. data/lib/puppet/configurer.rb +30 -86
  26. data/lib/puppet/configurer/downloader.rb +6 -2
  27. data/lib/puppet/defaults.rb +50 -44
  28. data/lib/puppet/error.rb +14 -9
  29. data/lib/puppet/face/catalog.rb +20 -1
  30. data/lib/puppet/face/config.rb +48 -10
  31. data/lib/puppet/face/facts.rb +1 -1
  32. data/lib/puppet/face/help.rb +1 -1
  33. data/lib/puppet/face/module/list.rb +5 -5
  34. data/lib/puppet/face/module/search.rb +1 -1
  35. data/lib/puppet/face/module/uninstall.rb +1 -1
  36. data/lib/puppet/face/module/upgrade.rb +1 -1
  37. data/lib/puppet/face/parser.rb +48 -9
  38. data/lib/puppet/face/plugin.rb +2 -9
  39. data/lib/puppet/file_serving/http_metadata.rb +1 -1
  40. data/lib/puppet/file_system.rb +12 -2
  41. data/lib/puppet/file_system/file_impl.rb +6 -3
  42. data/lib/puppet/file_system/memory_file.rb +1 -1
  43. data/lib/puppet/file_system/posix.rb +2 -3
  44. data/lib/puppet/forge.rb +3 -3
  45. data/lib/puppet/functions.rb +2 -1
  46. data/lib/puppet/functions/camelcase.rb +2 -2
  47. data/lib/puppet/functions/epp.rb +4 -4
  48. data/lib/puppet/functions/find_file.rb +9 -9
  49. data/lib/puppet/functions/inline_epp.rb +5 -5
  50. data/lib/puppet/functions/regsubst.rb +6 -8
  51. data/lib/puppet/gettext/module_translations.rb +1 -1
  52. data/lib/puppet/graph/rb_tree_map.rb +2 -2
  53. data/lib/puppet/graph/simple_graph.rb +3 -4
  54. data/lib/puppet/indirector/catalog/compiler.rb +5 -11
  55. data/lib/puppet/indirector/file_bucket_file/file.rb +1 -1
  56. data/lib/puppet/indirector/hiera.rb +0 -2
  57. data/lib/puppet/indirector/resource/ral.rb +3 -1
  58. data/lib/puppet/indirector/resource/validator.rb +1 -1
  59. data/lib/puppet/interface.rb +1 -2
  60. data/lib/puppet/loaders.rb +1 -0
  61. data/lib/puppet/metatype/manager.rb +1 -1
  62. data/lib/puppet/module.rb +1 -1
  63. data/lib/puppet/module/task.rb +4 -20
  64. data/lib/puppet/module_tool/applications/installer.rb +1 -1
  65. data/lib/puppet/module_tool/applications/uninstaller.rb +3 -3
  66. data/lib/puppet/module_tool/metadata.rb +1 -1
  67. data/lib/puppet/module_tool/shared_behaviors.rb +4 -4
  68. data/lib/puppet/module_tool/tar/mini.rb +2 -12
  69. data/lib/puppet/network/http/api/indirected_routes.rb +11 -12
  70. data/lib/puppet/network/http/connection.rb +12 -10
  71. data/lib/puppet/network/http/factory.rb +11 -1
  72. data/lib/puppet/network/http/pool.rb +0 -2
  73. data/lib/puppet/network/http/site.rb +1 -1
  74. data/lib/puppet/network/resolver.rb +2 -2
  75. data/lib/puppet/node/environment.rb +2 -4
  76. data/lib/puppet/pal/pal_impl.rb +2 -2
  77. data/lib/puppet/parser/ast.rb +1 -1
  78. data/lib/puppet/parser/ast/resourceparam.rb +1 -1
  79. data/lib/puppet/parser/functions.rb +1 -1
  80. data/lib/puppet/parser/functions/epp.rb +3 -3
  81. data/lib/puppet/parser/functions/fail.rb +8 -1
  82. data/lib/puppet/parser/functions/inline_epp.rb +5 -5
  83. data/lib/puppet/parser/scope.rb +7 -8
  84. data/lib/puppet/pops/evaluator/collectors/catalog_collector.rb +1 -1
  85. data/lib/puppet/pops/evaluator/collectors/exported_collector.rb +1 -1
  86. data/lib/puppet/pops/evaluator/external_syntax_support.rb +2 -3
  87. data/lib/puppet/pops/evaluator/runtime3_support.rb +4 -4
  88. data/lib/puppet/pops/loader/null_loader.rb +60 -0
  89. data/lib/puppet/pops/loader/ruby_legacy_function_instantiator.rb +6 -4
  90. data/lib/puppet/pops/loader/task_instantiator.rb +0 -4
  91. data/lib/puppet/pops/loaders.rb +1 -1
  92. data/lib/puppet/pops/lookup/hiera_config.rb +0 -1
  93. data/lib/puppet/pops/lookup/sub_lookup.rb +1 -1
  94. data/lib/puppet/pops/merge_strategy.rb +18 -22
  95. data/lib/puppet/pops/parser/heredoc_support.rb +1 -1
  96. data/lib/puppet/pops/parser/interpolation_support.rb +4 -4
  97. data/lib/puppet/pops/parser/locator.rb +1 -1
  98. data/lib/puppet/pops/parser/pn_parser.rb +16 -17
  99. data/lib/puppet/pops/puppet_stack.rb +49 -51
  100. data/lib/puppet/pops/types/p_sensitive_type.rb +1 -1
  101. data/lib/puppet/pops/types/string_converter.rb +10 -10
  102. data/lib/puppet/pops/types/types.rb +6 -5
  103. data/lib/puppet/property.rb +1 -1
  104. data/lib/puppet/property/ensure.rb +1 -1
  105. data/lib/puppet/provider/exec.rb +2 -6
  106. data/lib/puppet/provider/file/posix.rb +0 -5
  107. data/lib/puppet/provider/nameservice.rb +3 -10
  108. data/lib/puppet/provider/nameservice/directoryservice.rb +1 -1
  109. data/lib/puppet/provider/nameservice/pw.rb +2 -2
  110. data/lib/puppet/provider/package.rb +0 -2
  111. data/lib/puppet/provider/package/apt.rb +1 -5
  112. data/lib/puppet/provider/package/dnf.rb +1 -1
  113. data/lib/puppet/provider/package/dpkg.rb +18 -34
  114. data/lib/puppet/provider/package/openbsd.rb +1 -1
  115. data/lib/puppet/provider/package/pip.rb +13 -37
  116. data/lib/puppet/provider/package/portage.rb +4 -4
  117. data/lib/puppet/provider/package/puppet_gem.rb +1 -1
  118. data/lib/puppet/provider/package/rpm.rb +18 -56
  119. data/lib/puppet/provider/package/windows/package.rb +1 -1
  120. data/lib/puppet/provider/package/yum.rb +5 -9
  121. data/lib/puppet/provider/package_targetable.rb +4 -7
  122. data/lib/puppet/provider/parsedfile.rb +1 -1
  123. data/lib/puppet/provider/service/daemontools.rb +9 -9
  124. data/lib/puppet/provider/service/launchd.rb +5 -20
  125. data/lib/puppet/provider/service/openbsd.rb +1 -1
  126. data/lib/puppet/provider/service/rcng.rb +2 -2
  127. data/lib/puppet/provider/service/runit.rb +8 -2
  128. data/lib/puppet/provider/service/systemd.rb +19 -14
  129. data/lib/puppet/provider/service/windows.rb +0 -8
  130. data/lib/puppet/provider/user/directoryservice.rb +1 -1
  131. data/lib/puppet/provider/user/hpux.rb +1 -1
  132. data/lib/puppet/provider/user/pw.rb +3 -12
  133. data/lib/puppet/provider/user/user_role_add.rb +1 -5
  134. data/lib/puppet/provider/user/useradd.rb +20 -45
  135. data/lib/puppet/provider/user/windows_adsi.rb +5 -4
  136. data/lib/puppet/reference/configuration.rb +3 -3
  137. data/lib/puppet/reference/indirection.rb +2 -2
  138. data/lib/puppet/reference/metaparameter.rb +3 -1
  139. data/lib/puppet/reference/providers.rb +3 -1
  140. data/lib/puppet/reference/type.rb +9 -3
  141. data/lib/puppet/reports.rb +1 -1
  142. data/lib/puppet/resource.rb +1 -18
  143. data/lib/puppet/resource/catalog.rb +1 -1
  144. data/lib/puppet/rest/routes.rb +30 -17
  145. data/lib/puppet/settings.rb +3 -43
  146. data/lib/puppet/settings/environment_conf.rb +0 -1
  147. data/lib/puppet/ssl/certificate_request.rb +12 -2
  148. data/lib/puppet/ssl/host.rb +2 -2
  149. data/lib/puppet/ssl/oids.rb +1 -1
  150. data/lib/puppet/ssl/ssl_provider.rb +11 -5
  151. data/lib/puppet/ssl/state_machine.rb +102 -98
  152. data/lib/puppet/test/test_helper.rb +1 -0
  153. data/lib/puppet/transaction.rb +11 -33
  154. data/lib/puppet/transaction/report.rb +1 -1
  155. data/lib/puppet/type.rb +4 -2
  156. data/lib/puppet/type/exec.rb +17 -23
  157. data/lib/puppet/type/file.rb +39 -11
  158. data/lib/puppet/type/file/data_sync.rb +1 -5
  159. data/lib/puppet/type/group.rb +2 -4
  160. data/lib/puppet/type/notify.rb +3 -4
  161. data/lib/puppet/type/package.rb +3 -20
  162. data/lib/puppet/type/schedule.rb +1 -1
  163. data/lib/puppet/type/service.rb +3 -8
  164. data/lib/puppet/type/user.rb +2 -4
  165. data/lib/puppet/util.rb +29 -39
  166. data/lib/puppet/util/command_line/trollop.rb +1 -1
  167. data/lib/puppet/util/execution.rb +3 -4
  168. data/lib/puppet/util/http_proxy.rb +19 -27
  169. data/lib/puppet/util/log.rb +2 -2
  170. data/lib/puppet/util/log/destinations.rb +2 -2
  171. data/lib/puppet/util/logging.rb +20 -32
  172. data/lib/puppet/util/metric.rb +2 -2
  173. data/lib/puppet/util/monkey_patches.rb +33 -0
  174. data/lib/puppet/util/pidlock.rb +2 -3
  175. data/lib/puppet/util/provider_features.rb +4 -2
  176. data/lib/puppet/util/rdoc.rb +1 -1
  177. data/lib/puppet/util/reference.rb +1 -1
  178. data/lib/puppet/util/resource_template.rb +1 -1
  179. data/lib/puppet/util/selinux.rb +2 -8
  180. data/lib/puppet/util/skip_tags.rb +4 -0
  181. data/lib/puppet/util/windows/adsi.rb +18 -48
  182. data/lib/puppet/util/windows/process.rb +8 -8
  183. data/lib/puppet/util/windows/registry.rb +5 -7
  184. data/lib/puppet/util/windows/security.rb +0 -2
  185. data/lib/puppet/util/windows/service.rb +4 -149
  186. data/lib/puppet/util/windows/sid.rb +0 -1
  187. data/lib/puppet/vendor.rb +1 -1
  188. data/lib/puppet/version.rb +1 -1
  189. data/lib/puppet/x509/cert_provider.rb +81 -24
  190. data/locales/puppet.pot +462 -482
  191. data/man/man5/puppet.conf.5 +43 -44
  192. data/man/man8/puppet-agent.8 +1 -1
  193. data/man/man8/puppet-apply.8 +3 -3
  194. data/man/man8/puppet-catalog.8 +31 -3
  195. data/man/man8/puppet-config.8 +1 -1
  196. data/man/man8/puppet-describe.8 +1 -1
  197. data/man/man8/puppet-device.8 +1 -1
  198. data/man/man8/puppet-doc.8 +1 -1
  199. data/man/man8/puppet-epp.8 +1 -1
  200. data/man/man8/puppet-facts.8 +1 -1
  201. data/man/man8/puppet-filebucket.8 +1 -1
  202. data/man/man8/puppet-generate.8 +1 -1
  203. data/man/man8/puppet-help.8 +1 -1
  204. data/man/man8/puppet-key.8 +1 -1
  205. data/man/man8/puppet-lookup.8 +1 -1
  206. data/man/man8/puppet-man.8 +1 -1
  207. data/man/man8/puppet-module.8 +1 -1
  208. data/man/man8/puppet-node.8 +1 -1
  209. data/man/man8/puppet-parser.8 +1 -1
  210. data/man/man8/puppet-plugin.8 +1 -1
  211. data/man/man8/puppet-report.8 +1 -1
  212. data/man/man8/puppet-resource.8 +1 -1
  213. data/man/man8/puppet-script.8 +1 -1
  214. data/man/man8/puppet-ssl.8 +1 -1
  215. data/man/man8/puppet-status.8 +1 -1
  216. data/man/man8/puppet.8 +3 -3
  217. data/spec/fixtures/ssl/127.0.0.1-key.pem +56 -56
  218. data/spec/fixtures/ssl/127.0.0.1.pem +27 -27
  219. data/spec/fixtures/ssl/bad-basic-constraints.pem +32 -32
  220. data/spec/fixtures/ssl/bad-int-basic-constraints.pem +30 -30
  221. data/spec/fixtures/ssl/ca.pem +30 -30
  222. data/spec/fixtures/ssl/crl.pem +15 -15
  223. data/spec/fixtures/ssl/ec-key.pem +18 -0
  224. data/spec/fixtures/ssl/ec.pem +40 -0
  225. data/spec/fixtures/ssl/encrypted-ec-key.pem +21 -0
  226. data/spec/fixtures/ssl/encrypted-key.pem +57 -57
  227. data/spec/fixtures/ssl/intermediate-agent-crl.pem +16 -16
  228. data/spec/fixtures/ssl/intermediate-agent.pem +33 -33
  229. data/spec/fixtures/ssl/intermediate-crl.pem +17 -17
  230. data/spec/fixtures/ssl/intermediate.pem +31 -31
  231. data/spec/fixtures/ssl/pluto-key.pem +56 -56
  232. data/spec/fixtures/ssl/pluto.pem +28 -28
  233. data/spec/fixtures/ssl/request-key.pem +56 -56
  234. data/spec/fixtures/ssl/request.pem +24 -24
  235. data/spec/fixtures/ssl/revoked-key.pem +56 -56
  236. data/spec/fixtures/ssl/revoked.pem +25 -25
  237. data/spec/fixtures/ssl/signed-key.pem +56 -56
  238. data/spec/fixtures/ssl/signed.pem +25 -25
  239. data/spec/fixtures/ssl/tampered-cert.pem +27 -27
  240. data/spec/fixtures/ssl/tampered-csr.pem +24 -24
  241. data/spec/fixtures/unit/pops/loaders/loaders/mix_4x_and_3x_functions/usee/lib/puppet/parser/functions/func_with_syntax_error.rb +9 -0
  242. data/spec/fixtures/vcr/cassettes/Puppet_Network_HTTP_Connection/when_handling_requests/_request_get/should_yield_to_the_block.yml +24 -0
  243. data/spec/fixtures/vcr/cassettes/Puppet_Network_HTTP_Connection/when_handling_requests/_request_head/should_yield_to_the_block.yml +24 -0
  244. data/spec/fixtures/vcr/cassettes/Puppet_Network_HTTP_Connection/when_handling_requests/_request_post/should_yield_to_the_block.yml +24 -0
  245. data/spec/integration/configurer_spec.rb +0 -52
  246. data/spec/integration/provider/service/init_spec.rb +1 -0
  247. data/spec/integration/provider/service/systemd_spec.rb +5 -8
  248. data/spec/integration/type/file_spec.rb +38 -28
  249. data/spec/integration/util/execution_spec.rb +0 -27
  250. data/spec/lib/puppet/certificate_factory.rb +2 -2
  251. data/spec/lib/puppet/test_ca.rb +17 -4
  252. data/spec/lib/puppet_spec/fixtures.rb +4 -0
  253. data/spec/spec_helper.rb +0 -28
  254. data/spec/unit/application/agent_spec.rb +34 -67
  255. data/spec/unit/application/device_spec.rb +1 -27
  256. data/spec/unit/application/ssl_spec.rb +60 -35
  257. data/spec/unit/configurer_spec.rb +399 -395
  258. data/spec/unit/defaults_spec.rb +4 -4
  259. data/spec/unit/face/facts_spec.rb +0 -9
  260. data/spec/unit/face/parser_spec.rb +69 -22
  261. data/spec/unit/face/plugin_spec.rb +0 -8
  262. data/spec/unit/file_system_spec.rb +30 -1
  263. data/spec/unit/forge/forge_spec.rb +3 -1
  264. data/spec/unit/forge/repository_spec.rb +3 -1
  265. data/spec/unit/indirector/catalog/compiler_spec.rb +5 -62
  266. data/spec/unit/indirector/resource/ral_spec.rb +4 -4
  267. data/spec/unit/module_tool/tar/mini_spec.rb +1 -1
  268. data/spec/unit/network/http/api/indirected_routes_spec.rb +10 -25
  269. data/spec/unit/network/http/connection_spec.rb +145 -119
  270. data/spec/unit/network/http/factory_spec.rb +5 -27
  271. data/spec/unit/parser/scope_spec.rb +0 -10
  272. data/spec/unit/pops/evaluator/evaluating_parser_spec.rb +3 -8
  273. data/spec/unit/pops/loaders/loaders_spec.rb +4 -0
  274. data/spec/unit/pops/loaders/module_loaders_spec.rb +0 -37
  275. data/spec/unit/pops/types/types_spec.rb +27 -0
  276. data/spec/unit/provider/exec_spec.rb +0 -209
  277. data/spec/unit/provider/package/aptrpm_spec.rb +1 -1
  278. data/spec/unit/provider/package/dnf_spec.rb +0 -7
  279. data/spec/unit/provider/package/dpkg_spec.rb +80 -240
  280. data/spec/unit/provider/package/pip_spec.rb +8 -61
  281. data/spec/unit/provider/package/portage_spec.rb +4 -4
  282. data/spec/unit/provider/package/rpm_spec.rb +16 -150
  283. data/spec/unit/provider/package/yum_spec.rb +0 -7
  284. data/spec/unit/provider/service/daemontools_spec.rb +0 -24
  285. data/spec/unit/provider/service/launchd_spec.rb +0 -28
  286. data/spec/unit/provider/service/runit_spec.rb +0 -24
  287. data/spec/unit/provider/service/systemd_spec.rb +25 -39
  288. data/spec/unit/provider/service/windows_spec.rb +0 -20
  289. data/spec/unit/provider/user/hpux_spec.rb +2 -2
  290. data/spec/unit/provider/user/pw_spec.rb +0 -37
  291. data/spec/unit/provider/user/useradd_spec.rb +0 -88
  292. data/spec/unit/resource_spec.rb +1 -26
  293. data/spec/unit/ssl/host_spec.rb +5 -0
  294. data/spec/unit/ssl/ssl_provider_spec.rb +36 -11
  295. data/spec/unit/ssl/state_machine_spec.rb +233 -158
  296. data/spec/unit/transaction_spec.rb +0 -64
  297. data/spec/unit/type/exec_spec.rb +12 -15
  298. data/spec/unit/type/file/content_spec.rb +3 -9
  299. data/spec/unit/type/file/source_spec.rb +4 -4
  300. data/spec/unit/type/file_spec.rb +15 -11
  301. data/spec/unit/type/package_spec.rb +0 -5
  302. data/spec/unit/type/schedule_spec.rb +1 -3
  303. data/spec/unit/type/service_spec.rb +0 -16
  304. data/spec/unit/util/execution_spec.rb +0 -16
  305. data/spec/unit/util/http_proxy_spec.rb +21 -151
  306. data/spec/unit/util/ldap/manager_spec.rb +0 -15
  307. data/spec/unit/util/log/destinations_spec.rb +3 -7
  308. data/spec/unit/util/log_spec.rb +138 -0
  309. data/spec/unit/util/logging_spec.rb +0 -200
  310. data/spec/unit/util/pidlock_spec.rb +0 -26
  311. data/spec/unit/util/skip_tags_spec.rb +14 -0
  312. data/spec/unit/util/windows/adsi_spec.rb +0 -51
  313. data/spec/unit/util/windows/service_spec.rb +0 -9
  314. data/spec/unit/util_spec.rb +10 -0
  315. data/spec/unit/x509/cert_provider_spec.rb +82 -43
  316. data/tasks/generate_cert_fixtures.rake +13 -1
  317. data/tasks/manpages.rake +0 -1
  318. metadata +28 -22
  319. data/ext/cert_inspector +0 -140
  320. data/ext/envpuppet +0 -139
  321. data/ext/envpuppet.bat +0 -14
  322. data/ext/puppet-test +0 -476
  323. data/ext/pure_ruby_dsl/dsl_test.rb +0 -7
  324. data/ext/upload_facts.rb +0 -119
  325. data/lib/puppet/provider/package/dnfmodule.rb +0 -87
  326. data/spec/fixtures/unit/provider/package/dnfmodule/dnf-module-list-installed.txt +0 -11
  327. data/spec/integration/type/notify_spec.rb +0 -46
  328. data/spec/unit/provider/package/dnfmodule_spec.rb +0 -186
  329. data/spec/unit/provider/package_targetable_spec.rb +0 -60
@@ -55,8 +55,12 @@ class Puppet::Configurer::Downloader
55
55
  :noop => false
56
56
  }
57
57
  if !Puppet::Util::Platform.windows?
58
- defargs[:owner] = Process.uid
59
- defargs[:group] = Process.gid
58
+ defargs.merge!(
59
+ {
60
+ :owner => Process.uid,
61
+ :group => Process.gid
62
+ }
63
+ )
60
64
  end
61
65
  return defargs
62
66
  end
@@ -35,7 +35,7 @@ module Puppet
35
35
  def self.default_basemodulepath
36
36
  if Puppet::Util::Platform.windows?
37
37
  path = ['$codedir/modules']
38
- installdir = ENV["FACTER_env_windows_installdir"]
38
+ installdir = Facter.value(:env_windows_installdir)
39
39
  if installdir
40
40
  path << "#{installdir}/puppet/modules"
41
41
  end
@@ -47,7 +47,7 @@ module Puppet
47
47
 
48
48
  def self.default_vendormoduledir
49
49
  if Puppet::Util::Platform.windows?
50
- installdir = ENV["FACTER_env_windows_installdir"]
50
+ installdir = Facter.value(:env_windows_installdir)
51
51
  if installdir
52
52
  "#{installdir}\\puppet\\vendor_modules"
53
53
  else
@@ -154,19 +154,6 @@ module Puppet
154
154
  end
155
155
  end
156
156
  },
157
- :merge_dependency_warnings => {
158
- :default => false,
159
- :type => :boolean,
160
- :desc => "Whether to merge class-level dependency failure warnings.
161
-
162
- When a class has a failed dependency, every resource in the class
163
- generates a notice level message about the dependency failure,
164
- and a warning level message about skipping the resource.
165
-
166
- If true, all messages caused by a class dependency failure are merged
167
- into one message associated with the class.
168
- ",
169
- },
170
157
  :strict => {
171
158
  :default => :warning,
172
159
  :type => :symbolic_enum,
@@ -219,19 +206,12 @@ module Puppet
219
206
  :trace => {
220
207
  :default => false,
221
208
  :type => :boolean,
222
- :desc => "Whether to print stack traces on some errors. Will print
223
- internal Ruby stack trace interleaved with Puppet function frames.",
209
+ :desc => "Whether to print stack traces on some errors",
224
210
  :hook => proc do |value|
225
211
  # Enable or disable Facter's trace option too
226
212
  Facter.trace(value) if Facter.respond_to? :trace
227
213
  end
228
214
  },
229
- :puppet_trace => {
230
- :default => false,
231
- :type => :boolean,
232
- :desc => "Whether to print the Puppet stack trace on some errors.
233
- This is a noop if `trace` is also set.",
234
- },
235
215
  :profile => {
236
216
  :default => false,
237
217
  :type => :boolean,
@@ -566,10 +546,9 @@ module Puppet
566
546
  },
567
547
  :http_proxy_host => {
568
548
  :default => "none",
569
- :desc => "The HTTP proxy host to use for outgoing connections. The proxy will be bypassed if
570
- the server's hostname matches the NO_PROXY environment variable or `no_proxy` setting. Note: You
549
+ :desc => "The HTTP proxy host to use for outgoing connections. Note: You
571
550
  may need to use a FQDN for the server hostname when using a proxy. Environment variable
572
- http_proxy or HTTP_PROXY will override this value. ",
551
+ http_proxy or HTTP_PROXY will override this value",
573
552
  },
574
553
  :http_proxy_port => {
575
554
  :default => 3128,
@@ -593,10 +572,6 @@ module Puppet
593
572
  contains any characters with special meanings in URLs (as specified by RFC 3986
594
573
  section 2.2), they must be URL-encoded. (For example, `#` would become `%23`.)",
595
574
  },
596
- :no_proxy => {
597
- :default => "localhost, 127.0.0.1",
598
- :desc => "List of host or domain names that should not go through `http_proxy_host`. Environment variable no_proxy or NO_PROXY will override this value. Names can be specified as an FQDN `host.example.com`, wildcard `*.example.com`, dotted domain `.example.com`, or suffix `example.com`.",
599
- },
600
575
  :http_keepalive_timeout => {
601
576
  :default => "4s",
602
577
  :type => :duration,
@@ -851,6 +826,11 @@ EOT
851
826
  :group => "service",
852
827
  :desc => "Where SSL certificates are kept."
853
828
  },
829
+ :ssl_lockfile => {
830
+ :default => "$ssldir/ssl.lock",
831
+ :type => :string,
832
+ :desc => "A lock file to indicate that the ssl bootstrap process is currently in progress.",
833
+ },
854
834
  :publickeydir => {
855
835
  :default => "$ssldir/public_keys",
856
836
  :type => :directory,
@@ -986,6 +966,19 @@ EOT
986
966
  certificate revocation checking and does not attempt to download the CRL.
987
967
  EOT
988
968
  },
969
+ :key_type => {
970
+ :default => 'rsa',
971
+ :type => :enum,
972
+ :values => %w[rsa ec],
973
+ :desc => "The type of private key. Valid values are `rsa` and `ec`. Default is `rsa`."
974
+ },
975
+ :named_curve => {
976
+ :default => 'prime256v1',
977
+ :type => :string,
978
+ :desc => "The short name for the EC curve used to generate the EC private key. Valid
979
+ values must be one of the curves in `OpenSSL::PKey::EC.builtin_curves`.
980
+ Default is `prime256v1`."
981
+ },
989
982
  :digest_algorithm => {
990
983
  :default => lambda { default_digest_algorithm },
991
984
  :type => :enum,
@@ -1110,6 +1103,23 @@ EOT
1110
1103
  :desc => "The default TTL for new certificates.
1111
1104
  #{AS_DURATION}",
1112
1105
  },
1106
+ :crl_refresh_interval => {
1107
+ :type => :duration,
1108
+ :desc => "How often the Puppet agent refreshes its local CRL. By
1109
+ default the CRL is only downloaded once, and never refreshed. If a
1110
+ duration is specified, then the agent will refresh its CRL whenever it
1111
+ next runs and the elapsed time since the CRL was last refreshed exceeds
1112
+ the duration.
1113
+
1114
+ In general, the duration should be greater than the `runinterval`.
1115
+ Setting it to an equal or lesser value will cause the CRL to be
1116
+ refreshed on every run.
1117
+
1118
+ If the agent downloads a new CRL, the agent will use it for subsequent
1119
+ network requests. If the refresh request fails or if the CRL is
1120
+ unchanged on the server, then the agent run will continue using the
1121
+ local CRL it already has.#{AS_DURATION}",
1122
+ },
1113
1123
  :keylength => {
1114
1124
  :default => 4096,
1115
1125
  :desc => "The bit length of keys.",
@@ -1498,14 +1508,6 @@ EOT
1498
1508
  apply. You can see man pages by running `puppet <SUBCOMMAND> --help`,
1499
1509
  or read them online at https://puppet.com/docs/puppet/latest/man/."
1500
1510
  },
1501
- :deviceconfdir => {
1502
- :default => "$confdir/devices",
1503
- :type => :directory,
1504
- :mode => "0750",
1505
- :owner => "service",
1506
- :group => "service",
1507
- :desc => "The root directory of devices' $confdir.",
1508
- },
1509
1511
  :server => {
1510
1512
  :default => "puppet",
1511
1513
  :desc => "The puppet master server to which the puppet agent should connect.",
@@ -1681,11 +1683,6 @@ EOT
1681
1683
  :type => :boolean,
1682
1684
  :desc => "Whether to send reports after every transaction.",
1683
1685
  },
1684
- :resubmit_facts => {
1685
- :default => false,
1686
- :type => :boolean,
1687
- :desc => "Whether to send updated facts after every transaction.",
1688
- },
1689
1686
  :lastrunfile => {
1690
1687
  :default => "$statedir/last_run_summary.yaml",
1691
1688
  :type => :file,
@@ -1736,9 +1733,18 @@ EOT
1736
1733
  Puppet agent cannot apply configurations until its approved certificate is
1737
1734
  available. Since the certificate may or may not be available immediately,
1738
1735
  puppet agent will repeatedly try to fetch it at this interval. You can
1739
- turn off waiting for certificates by specifying a time of 0, in which case
1736
+ turn off waiting for certificates by specifying a time of 0, or a maximum
1737
+ amount of time to wait in the `maxwaitforcert` setting, in which case
1740
1738
  puppet agent will exit if it cannot get a cert.
1741
1739
  #{AS_DURATION}",
1740
+ },
1741
+ :maxwaitforcert => {
1742
+ :default => "unlimited",
1743
+ :type => :ttl,
1744
+ :desc => "The maximum amount of time the Puppet agent should wait for its
1745
+ certificate request to be signed. A value of `unlimited` will cause puppet agent
1746
+ to ask for a signed certificate indefinitely.
1747
+ #{AS_DURATION}",
1742
1748
  }
1743
1749
  )
1744
1750
 
@@ -12,7 +12,7 @@ module Puppet
12
12
  # This module implements logging with a filename and line number. Use this
13
13
  # for errors that need to report a location in a non-ruby file that we
14
14
  # parse.
15
- attr_accessor :line, :file, :pos, :puppetstack
15
+ attr_accessor :line, :file, :pos
16
16
 
17
17
  # May be called with 3 arguments for message, file, line, and exception, or
18
18
  # 4 args including the position on the line.
@@ -22,18 +22,10 @@ module Puppet
22
22
  original = pos
23
23
  pos = nil
24
24
  end
25
-
26
25
  super(message, original)
27
-
28
26
  @file = file unless (file.is_a?(String) && file.empty?)
29
27
  @line = line
30
28
  @pos = pos
31
-
32
- if original && original.respond_to?(:puppetstack)
33
- @puppetstack = original.puppetstack
34
- else
35
- @puppetstack = Puppet::Pops::PuppetStack.stacktrace()
36
- end
37
29
  end
38
30
 
39
31
  def to_s
@@ -79,6 +71,19 @@ module Puppet
79
71
  msg
80
72
  end
81
73
 
74
+ def to_h
75
+ {
76
+ :issue_code => issue_code,
77
+ :message => basic_message,
78
+ :full_message => to_s,
79
+ :file => file,
80
+ :line => line,
81
+ :pos => pos,
82
+ :environment => environment.to_s,
83
+ :node => node.to_s,
84
+ }
85
+ end
86
+
82
87
  def self.from_issue_and_stack(issue, args = {})
83
88
  filename, line = Puppet::Pops::PuppetStack.top_of_stack
84
89
 
@@ -24,7 +24,7 @@ Puppet::Indirector::Face.define(:catalog, '0.0.1') do
24
24
  deactivate_action(:destroy)
25
25
  deactivate_action(:search)
26
26
  find = get_action(:find)
27
- find.summary "Retrieve the catalog for a node."
27
+ find.summary "Retrieve the catalog for the node from which the command is run."
28
28
  find.arguments "<certname>"
29
29
  find.returns <<-'EOT'
30
30
  A serialized catalog. When used from the Ruby API, returns a
@@ -83,6 +83,25 @@ Puppet::Indirector::Face.define(:catalog, '0.0.1') do
83
83
  end
84
84
  end
85
85
 
86
+ action(:compile) do
87
+ summary _("Compile a catalog.")
88
+ description <<-'EOT'
89
+ Compiles a catalog locally for a node, requiring access to modules, node classifier, etc.
90
+ EOT
91
+ examples <<-'EOT'
92
+ Compile catalog for node 'mynode':
93
+
94
+ $ puppet catalog compile mynode --codedir ...
95
+ EOT
96
+ returns <<-'EOT'
97
+ A serialized catalog.
98
+ EOT
99
+ when_invoked do |*args|
100
+ Puppet.settings.preferred_run_mode = :master
101
+ Puppet::Face[:catalog, :current].find(*args)
102
+ end
103
+ end
104
+
86
105
  action(:download) do
87
106
  summary "Download this node's catalog from the puppet master server."
88
107
  description <<-'EOT'
@@ -66,18 +66,41 @@ Puppet::Face.define(:config, '0.0.1') do
66
66
  @default_section = true
67
67
  end
68
68
 
69
- if Puppet::Util::Log.sendlevel?(:info)
70
- warn_default_section(options[:section]) if @default_section
71
- report_section_and_environment(options[:section], Puppet.settings[:environment])
72
- end
69
+ render_all_settings = args.empty? || args == ['all']
73
70
 
74
- names = if args.empty? || args == ['all']
75
- :all
76
- else
77
- args
78
- end
71
+ args = Puppet.settings.to_a.collect(&:first) if render_all_settings
72
+
73
+ values_from_the_selected_section =
74
+ Puppet.settings.values(nil, options[:section].to_sym)
75
+
76
+ loader_settings = {
77
+ :environmentpath => values_from_the_selected_section.interpolate(:environmentpath),
78
+ :basemodulepath => values_from_the_selected_section.interpolate(:basemodulepath),
79
+ }
80
+
81
+ to_be_rendered = nil
82
+ Puppet.override(Puppet.base_context(loader_settings),
83
+ _("New environment loaders generated from the requested section.")) do
84
+ # And now we can lookup values that include those from environments configured from
85
+ # the requested section
86
+ values = Puppet.settings.values(Puppet[:environment].to_sym, options[:section].to_sym)
87
+
88
+ if Puppet::Util::Log.sendlevel?(:info)
89
+ warn_default_section(options[:section]) if @default_section
90
+ report_section_and_environment(options[:section], Puppet.settings[:environment])
91
+ end
79
92
 
80
- Puppet.settings.stringify_settings(options[:section], names)
93
+ to_be_rendered = {}
94
+ args.sort.each do |setting_name|
95
+ to_be_rendered[setting_name] = values.print(setting_name.to_sym)
96
+ end
97
+ end
98
+
99
+ # convert symbols to strings before formatting output
100
+ if render_all_settings
101
+ to_be_rendered = stringifyhash(to_be_rendered)
102
+ end
103
+ to_be_rendered
81
104
  end
82
105
 
83
106
  when_rendering :console do |to_be_rendered|
@@ -94,6 +117,21 @@ Puppet::Face.define(:config, '0.0.1') do
94
117
  end
95
118
  end
96
119
 
120
+ def stringifyhash(hash)
121
+ newhash = {}
122
+ hash.each do |key, val|
123
+ key = key.to_s
124
+ if val.is_a? Hash
125
+ newhash[key] = stringifyhash(val)
126
+ elsif val.is_a? Symbol
127
+ newhash[key] = val.to_s
128
+ else
129
+ newhash[key] = val
130
+ end
131
+ end
132
+ newhash
133
+ end
134
+
97
135
  def warn_default_section(section_name)
98
136
  messages = []
99
137
  messages << _("No section specified; defaulting to '%{section_name}'.") %
@@ -81,7 +81,7 @@ Puppet::Indirector::Face.define(:facts, '0.0.1') do
81
81
  node: Puppet[:node_name_value],
82
82
  server: server})
83
83
 
84
- Puppet::Node::Facts.indirection.save(facts, nil, :environment => Puppet.lookup(:current_environment))
84
+ Puppet::Node::Facts.indirection.save(facts)
85
85
  end
86
86
  end
87
87
  end
@@ -195,7 +195,7 @@ Puppet::Face.define(:help, '0.0.1') do
195
195
  #private :horribly_extract_summary_from
196
196
 
197
197
  def exclude_from_docs?(appname)
198
- %w{face_base indirection_base cert key man report status}.include? appname
198
+ %w{face_base indirection_base cert key man plugin report status}.include? appname
199
199
  end
200
200
  # This should absolutely be a private method, but for some reason it appears
201
201
  # that you can't use the 'private' keyword inside of a Face definition.
@@ -123,10 +123,10 @@ Puppet::Face.define(:module, '1.0.0') do
123
123
  unmet_grouped.each do |type, deps|
124
124
  unless deps.empty?
125
125
  unmet_grouped[type].sort_by { |dep| dep[:name] }.each do |dep|
126
- dep_name = dep[:name].tr('/', '-')
126
+ dep_name = dep[:name].gsub('/', '-')
127
127
  installed_version = dep[:mod_details][:installed_version]
128
128
  version_constraint = dep[:version_constraint]
129
- parent_name = dep[:parent][:name].tr('/', '-')
129
+ parent_name = dep[:parent][:name].gsub('/', '-')
130
130
  parent_version = dep[:parent][:version]
131
131
 
132
132
  msg = _("'%{parent_name}' (%{parent_version}) requires '%{dependency_name}' (%{dependency_version})") % { parent_name: parent_name, parent_version: parent_version, dependency_name: dep_name, dependency_version: version_constraint }
@@ -146,7 +146,7 @@ Puppet::Face.define(:module, '1.0.0') do
146
146
  error_display_order.each do |type|
147
147
  unless @unmet_deps[type].empty?
148
148
  @unmet_deps[type].keys.sort.each do |dep|
149
- name = dep.tr('/', '-')
149
+ name = dep.gsub('/', '-')
150
150
  errors = @unmet_deps[type][dep][:errors]
151
151
  version = @unmet_deps[type][dep][:version]
152
152
 
@@ -214,7 +214,7 @@ Puppet::Face.define(:module, '1.0.0') do
214
214
  dep[:reason] == :missing
215
215
  end
216
216
  missing_deps.map do |mis_mod|
217
- str = "#{colorize(:bg_red, _('UNMET DEPENDENCY'))} #{mis_mod[:name].tr('/', '-')} "
217
+ str = "#{colorize(:bg_red, _('UNMET DEPENDENCY'))} #{mis_mod[:name].gsub('/', '-')} "
218
218
  str << "(#{colorize(:cyan, mis_mod[:version_constraint])})"
219
219
  node[:dependencies] << { :text => str }
220
220
  end
@@ -239,7 +239,7 @@ Puppet::Face.define(:module, '1.0.0') do
239
239
  #
240
240
  def list_build_node(mod, parent, params)
241
241
  str = ''
242
- str << (mod.forge_name ? mod.forge_name.tr('/', '-') : mod.name)
242
+ str << (mod.forge_name ? mod.forge_name.gsub('/', '-') : mod.name)
243
243
  str << ' (' + colorize(:cyan, mod.version ? "v#{mod.version}" : '???') + ')'
244
244
 
245
245
  unless File.dirname(mod.path) == params[:path]
@@ -81,7 +81,7 @@ Puppet::Face.define(:module, '1.0.0') do
81
81
 
82
82
  highlight = proc do |s|
83
83
  s = s.gsub(term, colorize(:green, term))
84
- s = s.gsub(term.tr('/', '-'), colorize(:green, term.tr('/', '-'))) if term =~ /\//
84
+ s = s.gsub(term.gsub('/', '-'), colorize(:green, term.gsub('/', '-'))) if term =~ /\//
85
85
  s = s.gsub(' DEPRECATED', colorize(:red, ' DEPRECATED'))
86
86
  s
87
87
  end
@@ -57,7 +57,7 @@ Puppet::Face.define(:module, '1.0.0') do
57
57
  end
58
58
 
59
59
  when_invoked do |name, options|
60
- name = name.tr('/', '-')
60
+ name = name.gsub('/', '-')
61
61
 
62
62
  Puppet::ModuleTool.set_option_defaults options
63
63
  message = if options[:version]
@@ -63,7 +63,7 @@ Puppet::Face.define(:module, '1.0.0') do
63
63
  end
64
64
 
65
65
  when_invoked do |name, options|
66
- name = name.tr('/', '-')
66
+ name = name.gsub('/', '-')
67
67
  Puppet.notice _("Preparing to upgrade '%{name}' ...") % { name: name }
68
68
  Puppet::ModuleTool.set_option_defaults options
69
69
  Puppet::ModuleTool::Applications::Upgrader.new(name, options).run
@@ -11,6 +11,7 @@ Puppet::Face.define(:parser, '0.0.1') do
11
11
  summary _("Validate the syntax of one or more Puppet manifests.")
12
12
  arguments _("[<manifest>] [<manifest> ...]")
13
13
  returns _("Nothing, or the first syntax error encountered.")
14
+
14
15
  description <<-'EOT'
15
16
  This action validates Puppet DSL syntax without compiling a catalog or
16
17
  syncing any resources. If no manifest files are provided, it will
@@ -34,30 +35,66 @@ Puppet::Face.define(:parser, '0.0.1') do
34
35
  $ cat init.pp | puppet parser validate
35
36
  EOT
36
37
  when_invoked do |*args|
37
- args.pop
38
- files = args
38
+ files = args.slice(0..-2)
39
+
40
+ parse_errors = {}
41
+
39
42
  if files.empty?
40
43
  if not STDIN.tty?
41
44
  Puppet[:code] = STDIN.read
42
- validate_manifest
45
+ parse_errors['STDIN'] = validate_manifest(nil)
43
46
  else
44
47
  manifest = Puppet.lookup(:current_environment).manifest
45
48
  files << manifest
46
49
  Puppet.notice _("No manifest specified. Validating the default manifest %{manifest}") % { manifest: manifest }
47
50
  end
48
51
  end
52
+
49
53
  missing_files = []
54
+
50
55
  files.each do |file|
51
56
  if Puppet::FileSystem.exist?(file)
52
- validate_manifest(file)
57
+ error = validate_manifest(file)
58
+ parse_errors[file] = error if error
53
59
  else
54
60
  missing_files << file
55
61
  end
56
62
  end
63
+
57
64
  unless missing_files.empty?
58
65
  raise Puppet::Error, _("One or more file(s) specified did not exist:\n%{files}") % { files: missing_files.collect {|f| " " * 3 + f + "\n"} }
59
66
  end
60
- nil
67
+
68
+ parse_errors
69
+ end
70
+
71
+ when_rendering :console do |errors|
72
+ unless errors.empty?
73
+ errors.each { |_, error| Puppet.log_exception(error) }
74
+
75
+ exit(1)
76
+ end
77
+
78
+ # Prevent face_base renderer from outputting "null"
79
+ exit(0)
80
+ end
81
+
82
+ when_rendering :json do |errors|
83
+ unless errors.empty?
84
+ ignore_error_keys = [ :arguments, :environment, :node ]
85
+
86
+ data = errors.map do |file, error|
87
+ file_errors = error.to_h.reject { |k, _| ignore_error_keys.include?(k) }
88
+ [file, file_errors]
89
+ end.to_h
90
+
91
+ puts Puppet::Util::Json.dump(Puppet::Pops::Serialization::ToDataConverter.convert(data, rich_data: false), :pretty => true)
92
+
93
+ exit(1)
94
+ end
95
+
96
+ # Prevent face_base renderer from outputting "null"
97
+ exit(0)
61
98
  end
62
99
  end
63
100
 
@@ -75,7 +112,7 @@ Puppet::Face.define(:parser, '0.0.1') do
75
112
  * 'pn' is the Puppet Extended S-Expression Notation.
76
113
  * 'json' outputs the same graph as 'pn' but with JSON syntax.
77
114
 
78
- The output will be "pretty printed" when the option --pretty is given together with --format 'pn' or 'json'.
115
+ The output will be "pretty printed" when the option --pretty is given together with --format 'pn' or 'json'.
79
116
  This option has no effect on the 'old' format.
80
117
 
81
118
  The command accepts one or more manifests (.pp) files, or an -e followed by the puppet
@@ -173,15 +210,17 @@ Puppet::Face.define(:parser, '0.0.1') do
173
210
  def validate_manifest(manifest = nil)
174
211
  env = Puppet.lookup(:current_environment)
175
212
  loaders = Puppet::Pops::Loaders.new(env)
213
+
176
214
  Puppet.override( {:loaders => loaders } , _('For puppet parser validate')) do
177
215
  begin
178
216
  validation_environment = manifest ? env.override_with(:manifest => manifest) : env
179
217
  validation_environment.check_for_reparse
180
218
  validation_environment.known_resource_types.clear
181
- rescue => detail
182
- Puppet.log_exception(detail)
183
- exit(1)
219
+ rescue Puppet::ParseError => parse_error
220
+ return parse_error
184
221
  end
185
222
  end
223
+
224
+ nil
186
225
  end
187
226
  end