puppet 5.3.7-universal-darwin → 5.4.0-universal-darwin

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 (454) hide show
  1. checksums.yaml +4 -4
  2. data/CONTRIBUTING.md +42 -29
  3. data/README.md +8 -6
  4. data/ext/cert_inspector +2 -2
  5. data/ext/envpuppet +1 -1
  6. data/ext/gentoo/init.d/puppetmaster +4 -4
  7. data/ext/ips/puppet-agent +11 -11
  8. data/ext/ips/puppet-master +11 -11
  9. data/ext/puppet-test +1 -2
  10. data/ext/redhat/client.init +2 -2
  11. data/ext/redhat/logrotate +1 -1
  12. data/ext/solaris/smf/puppet +11 -11
  13. data/ext/solaris/smf/svc-puppetd +5 -5
  14. data/ext/solaris/smf/svc-puppetmasterd +5 -5
  15. data/ext/windows/service/daemon.rb +1 -1
  16. data/install.rb +2 -3
  17. data/lib/puppet/agent.rb +1 -1
  18. data/lib/puppet/application/cert.rb +1 -3
  19. data/lib/puppet/application/describe.rb +0 -1
  20. data/lib/puppet/application/device.rb +12 -99
  21. data/lib/puppet/application/filebucket.rb +32 -11
  22. data/lib/puppet/application/lookup.rb +1 -11
  23. data/lib/puppet/application/script.rb +261 -0
  24. data/lib/puppet/configurer.rb +3 -4
  25. data/lib/puppet/configurer/plugin_handler.rb +26 -9
  26. data/lib/puppet/context.rb +1 -1
  27. data/lib/puppet/datatypes.rb +213 -0
  28. data/lib/puppet/datatypes/error.rb +21 -0
  29. data/lib/puppet/datatypes/impl/error.rb +40 -0
  30. data/lib/puppet/defaults.rb +51 -20
  31. data/lib/puppet/environments.rb +17 -0
  32. data/lib/puppet/error.rb +17 -0
  33. data/lib/puppet/etc.rb +2 -2
  34. data/lib/puppet/external/pson/pure/generator.rb +1 -1
  35. data/lib/puppet/external/pson/pure/parser.rb +1 -1
  36. data/lib/puppet/face/config.rb +45 -0
  37. data/lib/puppet/face/epp.rb +3 -3
  38. data/lib/puppet/face/help/action.erb +3 -0
  39. data/lib/puppet/face/module/build.rb +1 -0
  40. data/lib/puppet/face/module/generate.rb +5 -0
  41. data/lib/puppet/face/module/install.rb +1 -0
  42. data/lib/puppet/face/module/search.rb +6 -2
  43. data/lib/puppet/face/module/uninstall.rb +1 -0
  44. data/lib/puppet/face/module/upgrade.rb +1 -0
  45. data/lib/puppet/face/parser.rb +0 -1
  46. data/lib/puppet/face/plugin.rb +1 -3
  47. data/lib/puppet/feature/base.rb +1 -1
  48. data/lib/puppet/feature/bolt.rb +3 -0
  49. data/lib/puppet/file_bucket/dipper.rb +1 -2
  50. data/lib/puppet/file_serving/http_metadata.rb +1 -1
  51. data/lib/puppet/file_system/uniquefile.rb +2 -2
  52. data/lib/puppet/forge.rb +6 -0
  53. data/lib/puppet/functions.rb +70 -88
  54. data/lib/puppet/functions/all.rb +6 -2
  55. data/lib/puppet/functions/annotate.rb +1 -1
  56. data/lib/puppet/functions/any.rb +7 -3
  57. data/lib/puppet/functions/contain.rb +6 -0
  58. data/lib/puppet/functions/convert_to.rb +32 -0
  59. data/lib/puppet/functions/defined.rb +0 -3
  60. data/lib/puppet/functions/each.rb +10 -6
  61. data/lib/puppet/functions/filter.rb +16 -10
  62. data/lib/puppet/functions/find_file.rb +0 -1
  63. data/lib/puppet/functions/include.rb +6 -0
  64. data/lib/puppet/functions/map.rb +12 -9
  65. data/lib/puppet/functions/module_directory.rb +41 -0
  66. data/lib/puppet/functions/new.rb +1 -4
  67. data/lib/puppet/functions/regsubst.rb +1 -1
  68. data/lib/puppet/functions/require.rb +6 -0
  69. data/lib/puppet/generate/type.rb +1 -1
  70. data/lib/puppet/gettext/config.rb +2 -2
  71. data/lib/puppet/gettext/stubs.rb +1 -1
  72. data/lib/puppet/indirector/catalog/compiler.rb +0 -1
  73. data/lib/puppet/indirector/file_bucket_file/file.rb +6 -2
  74. data/lib/puppet/indirector/file_server.rb +1 -1
  75. data/lib/puppet/indirector/node/ldap.rb +19 -3
  76. data/lib/puppet/indirector/request.rb +10 -6
  77. data/lib/puppet/indirector/rest.rb +11 -12
  78. data/lib/puppet/info_service/class_information_service.rb +1 -1
  79. data/lib/puppet/interface/action.rb +11 -0
  80. data/lib/puppet/interface/action_builder.rb +8 -0
  81. data/lib/puppet/interface/option_manager.rb +1 -1
  82. data/lib/puppet/loaders.rb +2 -0
  83. data/lib/puppet/module.rb +6 -2
  84. data/lib/puppet/module_tool/applications/builder.rb +4 -0
  85. data/lib/puppet/module_tool/applications/installer.rb +3 -0
  86. data/lib/puppet/module_tool/applications/uninstaller.rb +3 -0
  87. data/lib/puppet/module_tool/applications/unpacker.rb +1 -1
  88. data/lib/puppet/module_tool/applications/upgrader.rb +3 -0
  89. data/lib/puppet/module_tool/installed_modules.rb +1 -1
  90. data/lib/puppet/module_tool/metadata.rb +0 -1
  91. data/lib/puppet/network/authstore.rb +1 -1
  92. data/lib/puppet/network/http/api/indirected_routes.rb +1 -1
  93. data/lib/puppet/network/http/connection.rb +1 -9
  94. data/lib/puppet/network/http/factory.rb +0 -3
  95. data/lib/puppet/network/http/webrick.rb +1 -0
  96. data/lib/puppet/network/rights.rb +1 -1
  97. data/lib/puppet/node.rb +53 -0
  98. data/lib/puppet/node/environment.rb +1 -1
  99. data/lib/puppet/parameter/boolean.rb +1 -1
  100. data/lib/puppet/parser.rb +1 -0
  101. data/lib/puppet/parser/abstract_compiler.rb +36 -0
  102. data/lib/puppet/parser/ast/branch.rb +1 -1
  103. data/lib/puppet/parser/ast/pops_bridge.rb +8 -52
  104. data/lib/puppet/parser/compiler.rb +4 -54
  105. data/lib/puppet/parser/functions.rb +0 -1
  106. data/lib/puppet/parser/functions/create_resources.rb +6 -0
  107. data/lib/puppet/parser/functions/fqdn_rand.rb +6 -2
  108. data/lib/puppet/parser/functions/inline_template.rb +6 -0
  109. data/lib/puppet/parser/functions/new.rb +47 -32
  110. data/lib/puppet/parser/functions/realize.rb +6 -0
  111. data/lib/puppet/parser/functions/return.rb +1 -22
  112. data/lib/puppet/parser/functions/reverse_each.rb +1 -1
  113. data/lib/puppet/parser/functions/scanf.rb +1 -1
  114. data/lib/puppet/parser/functions/sha256.rb +5 -0
  115. data/lib/puppet/parser/functions/tag.rb +6 -0
  116. data/lib/puppet/parser/functions/tagged.rb +6 -0
  117. data/lib/puppet/parser/functions/template.rb +5 -0
  118. data/lib/puppet/parser/scope.rb +28 -4
  119. data/lib/puppet/parser/script_compiler.rb +118 -0
  120. data/lib/puppet/parser/type_loader.rb +1 -1
  121. data/lib/puppet/pops.rb +1 -1
  122. data/lib/puppet/pops/evaluator/access_operator.rb +38 -4
  123. data/lib/puppet/pops/evaluator/closure.rb +12 -4
  124. data/lib/puppet/pops/evaluator/compare_operator.rb +4 -4
  125. data/lib/puppet/pops/evaluator/epp_evaluator.rb +13 -0
  126. data/lib/puppet/pops/evaluator/evaluator_impl.rb +38 -10
  127. data/lib/puppet/pops/evaluator/literal_evaluator.rb +1 -1
  128. data/lib/puppet/pops/evaluator/runtime3_converter.rb +1 -1
  129. data/lib/puppet/pops/evaluator/runtime3_support.rb +2 -3
  130. data/lib/puppet/pops/functions/dispatch.rb +6 -5
  131. data/lib/puppet/pops/functions/function.rb +2 -2
  132. data/lib/puppet/pops/issues.rb +34 -2
  133. data/lib/puppet/pops/loader/base_loader.rb +10 -0
  134. data/lib/puppet/pops/loader/dependency_loader.rb +7 -0
  135. data/lib/puppet/pops/loader/loader.rb +21 -2
  136. data/lib/puppet/pops/loader/loader_paths.rb +180 -30
  137. data/lib/puppet/pops/loader/module_loaders.rb +202 -33
  138. data/lib/puppet/pops/loader/puppet_plan_instantiator.rb +84 -0
  139. data/lib/puppet/pops/loader/puppet_resource_type_impl_instantiator.rb +9 -9
  140. data/lib/puppet/pops/loader/ruby_data_type_instantiator.rb +40 -0
  141. data/lib/puppet/pops/loader/runtime3_type_loader.rb +6 -1
  142. data/lib/puppet/pops/loader/static_loader.rb +23 -8
  143. data/lib/puppet/pops/loader/task_instantiator.rb +69 -0
  144. data/lib/puppet/pops/loader/type_definition_instantiator.rb +4 -0
  145. data/lib/puppet/pops/loaders.rb +122 -11
  146. data/lib/puppet/pops/lookup/data_dig_function_provider.rb +1 -1
  147. data/lib/puppet/pops/lookup/interpolation.rb +1 -1
  148. data/lib/puppet/pops/lookup/lookup_adapter.rb +0 -1
  149. data/lib/puppet/pops/model/ast.pp +3 -0
  150. data/lib/puppet/pops/model/ast.rb +34 -1
  151. data/lib/puppet/pops/model/factory.rb +30 -3
  152. data/lib/puppet/pops/model/model_label_provider.rb +1 -0
  153. data/lib/puppet/pops/model/model_tree_dumper.rb +12 -1
  154. data/lib/puppet/pops/model/tree_dumper.rb +1 -1
  155. data/lib/puppet/pops/parser/code_merger.rb +2 -2
  156. data/lib/puppet/pops/parser/egrammar.ra +44 -15
  157. data/lib/puppet/pops/parser/eparser.rb +1687 -1571
  158. data/lib/puppet/pops/parser/epp_support.rb +1 -3
  159. data/lib/puppet/pops/parser/evaluating_parser.rb +1 -1
  160. data/lib/puppet/pops/parser/interpolation_support.rb +2 -2
  161. data/lib/puppet/pops/parser/lexer2.rb +4 -4
  162. data/lib/puppet/pops/parser/lexer_support.rb +2 -2
  163. data/lib/puppet/pops/parser/locatable.rb +1 -1
  164. data/lib/puppet/pops/parser/locator.rb +7 -13
  165. data/lib/puppet/pops/parser/parser_support.rb +3 -3
  166. data/lib/puppet/pops/parser/slurp_support.rb +0 -3
  167. data/lib/puppet/pops/pcore.rb +45 -0
  168. data/lib/puppet/pops/resource/param.rb +1 -1
  169. data/lib/puppet/pops/resource/resource_type_impl.rb +1 -1
  170. data/lib/puppet/pops/serialization/abstract_reader.rb +4 -0
  171. data/lib/puppet/pops/serialization/abstract_writer.rb +6 -0
  172. data/lib/puppet/pops/serialization/extension.rb +1 -0
  173. data/lib/puppet/pops/serialization/from_data_converter.rb +64 -10
  174. data/lib/puppet/pops/serialization/json_path.rb +2 -1
  175. data/lib/puppet/pops/serialization/object.rb +3 -4
  176. data/lib/puppet/pops/serialization/serializer.rb +2 -1
  177. data/lib/puppet/pops/serialization/to_data_converter.rb +7 -3
  178. data/lib/puppet/pops/time/timespan.rb +1 -1
  179. data/lib/puppet/pops/types/iterable.rb +38 -9
  180. data/lib/puppet/pops/types/p_init_type.rb +1 -1
  181. data/lib/puppet/pops/types/p_meta_type.rb +4 -0
  182. data/lib/puppet/pops/types/p_object_type.rb +146 -14
  183. data/lib/puppet/pops/types/p_object_type_extension.rb +218 -0
  184. data/lib/puppet/pops/types/p_sem_ver_range_type.rb +0 -1
  185. data/lib/puppet/pops/types/p_sem_ver_type.rb +10 -2
  186. data/lib/puppet/pops/types/p_type_set_type.rb +0 -1
  187. data/lib/puppet/pops/types/p_uri_type.rb +190 -0
  188. data/lib/puppet/pops/types/puppet_object.rb +15 -1
  189. data/lib/puppet/pops/types/ruby_generator.rb +46 -54
  190. data/lib/puppet/pops/types/string_converter.rb +22 -1
  191. data/lib/puppet/pops/types/type_acceptor.rb +1 -1
  192. data/lib/puppet/pops/types/type_calculator.rb +13 -4
  193. data/lib/puppet/pops/types/type_factory.rb +29 -5
  194. data/lib/puppet/pops/types/type_formatter.rb +67 -4
  195. data/lib/puppet/pops/types/type_parser.rb +92 -4
  196. data/lib/puppet/pops/types/type_with_members.rb +43 -0
  197. data/lib/puppet/pops/types/types.rb +212 -80
  198. data/lib/puppet/pops/validation/checker4_0.rb +10 -6
  199. data/lib/puppet/pops/validation/tasks_checker.rb +60 -0
  200. data/lib/puppet/pops/validation/validator_factory_4_0.rb +6 -1
  201. data/lib/puppet/property.rb +1 -1
  202. data/lib/puppet/provider.rb +18 -8
  203. data/lib/puppet/provider/augeas/augeas.rb +3 -4
  204. data/lib/puppet/provider/exec.rb +0 -2
  205. data/lib/puppet/provider/group/groupadd.rb +25 -1
  206. data/lib/puppet/provider/group/windows_adsi.rb +7 -4
  207. data/lib/puppet/provider/mount.rb +25 -8
  208. data/lib/puppet/provider/nameservice.rb +9 -4
  209. data/lib/puppet/provider/nameservice/directoryservice.rb +3 -3
  210. data/lib/puppet/provider/nameservice/objectadd.rb +13 -24
  211. data/lib/puppet/provider/nameservice/pw.rb +14 -14
  212. data/lib/puppet/provider/package/appdmg.rb +0 -1
  213. data/lib/puppet/provider/package/apple.rb +0 -1
  214. data/lib/puppet/provider/package/gem.rb +2 -2
  215. data/lib/puppet/provider/package/macports.rb +2 -2
  216. data/lib/puppet/provider/package/pkg.rb +3 -0
  217. data/lib/puppet/provider/package/pkgdmg.rb +0 -1
  218. data/lib/puppet/provider/package/portage.rb +0 -1
  219. data/lib/puppet/provider/package/yum.rb +23 -8
  220. data/lib/puppet/provider/package/zypper.rb +2 -2
  221. data/lib/puppet/provider/scheduled_task/win32_taskscheduler.rb +2 -2
  222. data/lib/puppet/provider/service/init.rb +1 -0
  223. data/lib/puppet/provider/service/launchd.rb +6 -7
  224. data/lib/puppet/provider/service/redhat.rb +3 -2
  225. data/lib/puppet/provider/service/systemd.rb +2 -2
  226. data/lib/puppet/provider/ssh_authorized_key/parsed.rb +1 -1
  227. data/lib/puppet/provider/user/aix.rb +3 -2
  228. data/lib/puppet/provider/user/openbsd.rb +1 -1
  229. data/lib/puppet/provider/user/pw.rb +1 -1
  230. data/lib/puppet/provider/user/user_role_add.rb +7 -1
  231. data/lib/puppet/provider/user/useradd.rb +36 -6
  232. data/lib/puppet/provider/user/windows_adsi.rb +1 -1
  233. data/lib/puppet/provider/yumrepo/inifile.rb +2 -4
  234. data/lib/puppet/provider/zfs/zfs.rb +23 -3
  235. data/lib/puppet/provider/zpool/zpool.rb +1 -1
  236. data/lib/puppet/reference/configuration.rb +0 -2
  237. data/lib/puppet/reference/type.rb +0 -1
  238. data/lib/puppet/resource.rb +1 -2
  239. data/lib/puppet/resource/catalog.rb +1 -1
  240. data/lib/puppet/resource/status.rb +0 -1
  241. data/lib/puppet/resource/type.rb +4 -4
  242. data/lib/puppet/resource/type_collection.rb +1 -1
  243. data/lib/puppet/settings/base_setting.rb +1 -1
  244. data/lib/puppet/settings/environment_conf.rb +0 -1
  245. data/lib/puppet/settings/ini_file.rb +66 -12
  246. data/lib/puppet/ssl/certificate_authority.rb +1 -1
  247. data/lib/puppet/ssl/certificate_request.rb +2 -2
  248. data/lib/puppet/ssl/certificate_revocation_list.rb +2 -1
  249. data/lib/puppet/ssl/certificate_signer.rb +11 -0
  250. data/lib/puppet/ssl/host.rb +2 -2
  251. data/lib/puppet/syntax_checkers/base64.rb +1 -1
  252. data/lib/puppet/transaction.rb +37 -14
  253. data/lib/puppet/transaction/report.rb +3 -1
  254. data/lib/puppet/type.rb +17 -4
  255. data/lib/puppet/type/cron.rb +1 -1
  256. data/lib/puppet/type/exec.rb +5 -4
  257. data/lib/puppet/type/file.rb +3 -3
  258. data/lib/puppet/type/file/checksum.rb +7 -1
  259. data/lib/puppet/type/file/checksum_value.rb +4 -3
  260. data/lib/puppet/type/group.rb +3 -0
  261. data/lib/puppet/type/k5login.rb +101 -0
  262. data/lib/puppet/type/macauthorization.rb +1 -1
  263. data/lib/puppet/type/mount.rb +6 -2
  264. data/lib/puppet/type/tidy.rb +6 -4
  265. data/lib/puppet/type/user.rb +26 -39
  266. data/lib/puppet/type/yumrepo.rb +9 -0
  267. data/lib/puppet/type/zfs.rb +4 -0
  268. data/lib/puppet/util.rb +8 -15
  269. data/lib/puppet/util/character_encoding.rb +2 -2
  270. data/lib/puppet/util/checksums.rb +82 -1
  271. data/lib/puppet/util/errors.rb +0 -2
  272. data/lib/puppet/util/filetype.rb +2 -2
  273. data/lib/puppet/util/json_lockfile.rb +1 -1
  274. data/lib/puppet/util/log.rb +1 -1
  275. data/lib/puppet/util/log/destinations.rb +10 -1
  276. data/lib/puppet/util/monkey_patches.rb +1 -1
  277. data/lib/puppet/util/network_device/cisco/device.rb +5 -5
  278. data/lib/puppet/util/network_device/config.rb +2 -3
  279. data/lib/puppet/util/platform.rb +13 -0
  280. data/lib/puppet/util/plist.rb +4 -4
  281. data/lib/puppet/util/rdoc/generators/puppet_generator.rb +2 -2
  282. data/lib/puppet/util/rdoc/parser/puppet_parser_rdoc2.rb +1 -1
  283. data/lib/puppet/util/reference.rb +8 -1
  284. data/lib/puppet/util/windows/adsi.rb +18 -15
  285. data/lib/puppet/util/windows/principal.rb +6 -7
  286. data/lib/puppet/util/windows/process.rb +1 -1
  287. data/lib/puppet/util/windows/registry.rb +2 -2
  288. data/lib/puppet/util/windows/sid.rb +7 -62
  289. data/lib/puppet/vendor/deep_merge/README.md +2 -2
  290. data/lib/puppet/vendor/pathspec/lib/pathspec/gitignorespec.rb +18 -18
  291. data/lib/puppet/vendor/semantic_puppet/lib/semantic_puppet/version.rb +2 -2
  292. data/lib/puppet/vendor/semantic_puppet/lib/semantic_puppet/version_range.rb +5 -5
  293. data/lib/puppet/vendor/semantic_puppet/locales/config.yaml +1 -1
  294. data/lib/puppet/version.rb +1 -1
  295. data/lib/puppet_pal.rb +874 -0
  296. data/locales/ja/puppet.po +140 -163
  297. data/locales/puppet.pot +940 -597
  298. data/man/man5/puppet.conf.5 +16 -91
  299. data/man/man8/puppet-agent.8 +2 -6
  300. data/man/man8/puppet-apply.8 +2 -2
  301. data/man/man8/puppet-ca.8 +1 -1
  302. data/man/man8/puppet-catalog.8 +1 -1
  303. data/man/man8/puppet-cert.8 +1 -1
  304. data/man/man8/puppet-certificate.8 +1 -1
  305. data/man/man8/puppet-certificate_request.8 +1 -1
  306. data/man/man8/puppet-certificate_revocation_list.8 +1 -1
  307. data/man/man8/puppet-config.8 +1 -1
  308. data/man/man8/puppet-describe.8 +1 -1
  309. data/man/man8/puppet-device.8 +11 -33
  310. data/man/man8/puppet-doc.8 +1 -1
  311. data/man/man8/puppet-epp.8 +1 -1
  312. data/man/man8/puppet-facts.8 +1 -1
  313. data/man/man8/puppet-filebucket.8 +4 -22
  314. data/man/man8/puppet-generate.8 +1 -1
  315. data/man/man8/puppet-help.8 +1 -1
  316. data/man/man8/puppet-key.8 +1 -1
  317. data/man/man8/puppet-lookup.8 +1 -1
  318. data/man/man8/puppet-man.8 +1 -1
  319. data/man/man8/puppet-master.8 +1 -1
  320. data/man/man8/puppet-module.8 +2 -11
  321. data/man/man8/puppet-node.8 +1 -1
  322. data/man/man8/puppet-parser.8 +1 -1
  323. data/man/man8/puppet-plugin.8 +1 -1
  324. data/man/man8/puppet-report.8 +1 -1
  325. data/man/man8/puppet-resource.8 +1 -1
  326. data/man/man8/puppet-status.8 +1 -1
  327. data/man/man8/puppet.8 +2 -2
  328. data/spec/integration/application/lookup_spec.rb +0 -21
  329. data/spec/integration/parser/compiler_spec.rb +18 -0
  330. data/spec/integration/parser/script_compiler_spec.rb +113 -0
  331. data/spec/integration/provider/mount_spec.rb +2 -0
  332. data/spec/integration/type/file_spec.rb +11 -3
  333. data/spec/integration/util/windows/adsi_spec.rb +1 -86
  334. data/spec/integration/util/windows/principal_spec.rb +1 -10
  335. data/spec/shared_contexts/checksum.rb +4 -1
  336. data/spec/shared_contexts/digests.rb +46 -1
  337. data/spec/shared_contexts/types_setup.rb +8 -3
  338. data/spec/unit/agent_spec.rb +2 -2
  339. data/spec/unit/application/cert_spec.rb +5 -17
  340. data/spec/unit/application/device_spec.rb +2 -96
  341. data/spec/unit/application/filebucket_spec.rb +18 -4
  342. data/spec/unit/configurer/plugin_handler_spec.rb +5 -32
  343. data/spec/unit/configurer_spec.rb +3 -3
  344. data/spec/unit/datatypes_spec.rb +304 -0
  345. data/spec/unit/defaults_spec.rb +41 -20
  346. data/spec/unit/face/config_spec.rb +46 -1
  347. data/spec/unit/face/epp_face_spec.rb +7 -3
  348. data/spec/unit/face/module/search_spec.rb +11 -0
  349. data/spec/unit/face/parser_spec.rb +2 -2
  350. data/spec/unit/file_bucket/dipper_spec.rb +12 -1
  351. data/spec/unit/forge/module_release_spec.rb +70 -0
  352. data/spec/unit/functions/break_spec.rb +34 -2
  353. data/spec/unit/functions/contain_spec.rb +1 -0
  354. data/spec/unit/functions/convert_to_spec.rb +22 -0
  355. data/spec/unit/functions/epp_spec.rb +5 -0
  356. data/spec/unit/functions/include_spec.rb +15 -0
  357. data/spec/unit/functions/module_directory_spec.rb +43 -0
  358. data/spec/unit/functions/new_spec.rb +14 -14
  359. data/spec/unit/functions/require_spec.rb +2 -0
  360. data/spec/unit/functions/shared.rb +12 -0
  361. data/spec/unit/functions/step_spec.rb +1 -1
  362. data/spec/unit/functions4_spec.rb +49 -4
  363. data/spec/unit/indirector/catalog/compiler_spec.rb +3 -3
  364. data/spec/unit/indirector/file_bucket_file/file_spec.rb +148 -94
  365. data/spec/unit/indirector/node/ldap_spec.rb +15 -12
  366. data/spec/unit/indirector/rest_spec.rb +0 -43
  367. data/spec/unit/interface/action_spec.rb +33 -0
  368. data/spec/unit/module_tool/applications/builder_spec.rb +7 -0
  369. data/spec/unit/module_tool/applications/installer_spec.rb +8 -0
  370. data/spec/unit/module_tool/applications/uninstaller_spec.rb +8 -0
  371. data/spec/unit/module_tool/applications/upgrader_spec.rb +6 -0
  372. data/spec/unit/network/http/connection_spec.rb +1 -1
  373. data/spec/unit/network/http/factory_spec.rb +28 -35
  374. data/spec/unit/parser/compiler_spec.rb +0 -8
  375. data/spec/unit/parser/environment_compiler_spec.rb +36 -0
  376. data/spec/unit/parser/functions/create_resources_spec.rb +9 -0
  377. data/spec/unit/parser/functions/inline_template_spec.rb +7 -0
  378. data/spec/unit/parser/functions/realize_spec.rb +9 -0
  379. data/spec/unit/parser/functions/tag_spec.rb +7 -0
  380. data/spec/unit/parser/functions/tagged_spec.rb +25 -0
  381. data/spec/unit/parser/functions/template_spec.rb +8 -0
  382. data/spec/unit/parser/scope_spec.rb +19 -0
  383. data/spec/unit/pops/evaluator/conditionals_spec.rb +1 -1
  384. data/spec/unit/pops/loaders/loader_spec.rb +516 -0
  385. data/spec/unit/pops/loaders/loaders_spec.rb +11 -0
  386. data/spec/unit/pops/loaders/module_loaders_spec.rb +43 -0
  387. data/spec/unit/pops/loaders/static_loader_spec.rb +15 -7
  388. data/spec/unit/pops/model/model_spec.rb +5 -0
  389. data/spec/unit/pops/parser/lexer2_spec.rb +15 -0
  390. data/spec/unit/pops/parser/locator_spec.rb +20 -0
  391. data/spec/unit/pops/parser/parse_basic_expressions_spec.rb +33 -0
  392. data/spec/unit/pops/parser/parse_calls_spec.rb +28 -0
  393. data/spec/unit/pops/parser/parse_conditionals_spec.rb +12 -0
  394. data/spec/unit/pops/parser/parse_plan_spec.rb +48 -0
  395. data/spec/unit/pops/serialization/packer_spec.rb +8 -0
  396. data/spec/unit/pops/serialization/serialization_spec.rb +30 -0
  397. data/spec/unit/pops/serialization/to_from_hr_spec.rb +31 -0
  398. data/spec/unit/pops/types/error_spec.rb +207 -0
  399. data/spec/unit/pops/types/p_init_type_spec.rb +98 -0
  400. data/spec/unit/pops/types/p_object_type_spec.rb +275 -10
  401. data/spec/unit/pops/types/p_uri_type_spec.rb +191 -0
  402. data/spec/unit/pops/types/ruby_generator_spec.rb +82 -44
  403. data/spec/unit/pops/types/task_spec.rb +353 -0
  404. data/spec/unit/pops/types/type_calculator_spec.rb +76 -5
  405. data/spec/unit/pops/types/type_formatter_spec.rb +31 -13
  406. data/spec/unit/pops/types/type_parser_spec.rb +13 -1
  407. data/spec/unit/pops/types/types_spec.rb +60 -0
  408. data/spec/unit/pops/validator/validator_spec.rb +76 -0
  409. data/spec/unit/provider/group/groupadd_spec.rb +77 -1
  410. data/spec/unit/provider/group/pw_spec.rb +4 -4
  411. data/spec/unit/provider/group/windows_adsi_spec.rb +22 -79
  412. data/spec/unit/provider/mount_spec.rb +18 -5
  413. data/spec/unit/provider/nameservice_spec.rb +5 -5
  414. data/spec/unit/provider/package/dnf_spec.rb +2 -2
  415. data/spec/unit/provider/package/gem_spec.rb +1 -1
  416. data/spec/unit/provider/package/pkg_spec.rb +3 -0
  417. data/spec/unit/provider/package/yum_spec.rb +40 -0
  418. data/spec/unit/provider/service/launchd_spec.rb +2 -1
  419. data/spec/unit/provider/service/redhat_spec.rb +5 -0
  420. data/spec/unit/provider/service/systemd_spec.rb +1 -1
  421. data/spec/unit/provider/user/hpux_spec.rb +2 -2
  422. data/spec/unit/provider/user/openbsd_spec.rb +2 -2
  423. data/spec/unit/provider/user/pw_spec.rb +14 -14
  424. data/spec/unit/provider/user/user_role_add_spec.rb +19 -2
  425. data/spec/unit/provider/user/useradd_spec.rb +188 -22
  426. data/spec/unit/provider/user/windows_adsi_spec.rb +4 -4
  427. data/spec/unit/provider/zfs/zfs_spec.rb +55 -1
  428. data/spec/unit/provider_spec.rb +48 -0
  429. data/spec/unit/puppet_pal_2pec.rb +1005 -0
  430. data/spec/unit/puppet_pal_spec.rb +11 -0
  431. data/spec/unit/settings/ini_file_spec.rb +313 -2
  432. data/spec/unit/ssl/certificate_request_spec.rb +42 -1
  433. data/spec/unit/ssl/certificate_revocation_list_spec.rb +2 -1
  434. data/spec/unit/transaction/report_spec.rb +1 -0
  435. data/spec/unit/transaction_spec.rb +112 -21
  436. data/spec/unit/type/file/checksum_spec.rb +20 -0
  437. data/spec/unit/type/file_spec.rb +8 -0
  438. data/spec/unit/type/group_spec.rb +8 -0
  439. data/spec/unit/type/k5login_spec.rb +22 -1
  440. data/spec/unit/type/scheduled_task_spec.rb +15 -0
  441. data/spec/unit/type/user_spec.rb +11 -1
  442. data/spec/unit/type/yumrepo_spec.rb +5 -0
  443. data/spec/unit/util/checksums_spec.rb +3 -3
  444. data/spec/unit/util/log/destinations_spec.rb +14 -0
  445. data/spec/unit/util/network_device/cisco/device_spec.rb +1 -1
  446. data/spec/unit/util/plist_spec.rb +3 -3
  447. data/spec/unit/util/windows/adsi_spec.rb +27 -31
  448. data/spec/unit/util/windows/sid_spec.rb +15 -86
  449. data/spec/unit/util_spec.rb +17 -3
  450. data/tasks/manpages.rake +1 -1
  451. metadata +218 -180
  452. data/lib/puppet/bindings.rb +0 -148
  453. data/lib/puppet/configurer/downloader_factory.rb +0 -44
  454. data/spec/unit/configurer/downloader_factory_spec.rb +0 -129
@@ -8,7 +8,6 @@ require 'securerandom'
8
8
  class Puppet::Configurer
9
9
  require 'puppet/configurer/fact_handler'
10
10
  require 'puppet/configurer/plugin_handler'
11
- require 'puppet/configurer/downloader_factory'
12
11
 
13
12
  include Puppet::Configurer::FactHandler
14
13
 
@@ -56,7 +55,7 @@ class Puppet::Configurer
56
55
  end
57
56
  end
58
57
 
59
- def initialize(factory = Puppet::Configurer::DownloaderFactory.new, transaction_uuid = nil, job_id = nil)
58
+ def initialize(transaction_uuid = nil, job_id = nil)
60
59
  @running = false
61
60
  @splayed = false
62
61
  @cached_catalog_status = 'not_used'
@@ -65,7 +64,7 @@ class Puppet::Configurer
65
64
  @job_id = job_id
66
65
  @static_catalog = true
67
66
  @checksum_type = Puppet[:supported_checksum_types]
68
- @handler = Puppet::Configurer::PluginHandler.new(factory)
67
+ @handler = Puppet::Configurer::PluginHandler.new()
69
68
  end
70
69
 
71
70
  # Get the remote catalog, yo. Returns nil if no catalog can be found.
@@ -380,7 +379,7 @@ class Puppet::Configurer
380
379
  :transaction_uuid => @transaction_uuid,
381
380
  :fail_on_404 => false)
382
381
  found = true
383
- rescue Exception => e
382
+ rescue
384
383
  # Nothing to see here
385
384
  end
386
385
  end
@@ -3,28 +3,45 @@
3
3
  # easier to test.
4
4
  require 'puppet/configurer'
5
5
 
6
-
7
6
  class Puppet::Configurer::PluginHandler
8
7
  SUPPORTED_LOCALES_MOUNT_AGENT_VERSION = Gem::Version.new("5.3.4")
9
8
 
10
- def initialize(factory)
11
- @factory = factory
12
- end
13
-
14
- # Retrieve facts from the central server.
15
9
  def download_plugins(environment)
16
- plugin_downloader = @factory.create_plugin_downloader(environment)
17
- plugin_fact_downloader = @factory.create_plugin_facts_downloader(environment)
10
+ source_permissions = Puppet.features.microsoft_windows? ? :ignore : :use
11
+
12
+ plugin_downloader = Puppet::Configurer::Downloader.new(
13
+ "plugin",
14
+ Puppet[:plugindest],
15
+ Puppet[:pluginsource],
16
+ Puppet[:pluginsignore],
17
+ environment
18
+ )
19
+ plugin_fact_downloader = Puppet::Configurer::Downloader.new(
20
+ "pluginfacts",
21
+ Puppet[:pluginfactdest],
22
+ Puppet[:pluginfactsource],
23
+ Puppet[:pluginsignore],
24
+ environment,
25
+ source_permissions
26
+ )
27
+
18
28
  result = []
19
29
  result += plugin_fact_downloader.evaluate
20
30
  result += plugin_downloader.evaluate
21
31
 
22
32
  server_agent_version = Puppet.lookup(:server_agent_version) { "0.0" }
23
33
  if Gem::Version.new(server_agent_version) >= SUPPORTED_LOCALES_MOUNT_AGENT_VERSION
24
- locales_downloader = @factory.create_locales_downloader(environment)
34
+ locales_downloader = Puppet::Configurer::Downloader.new(
35
+ "locales",
36
+ Puppet[:localedest],
37
+ Puppet[:localesource],
38
+ Puppet[:pluginsignore] + " *.pot config.yaml",
39
+ environment
40
+ )
25
41
  result += locales_downloader.evaluate
26
42
  end
27
43
 
44
+
28
45
  Puppet::Util::Autoload.reload_changed
29
46
 
30
47
  result
@@ -52,7 +52,7 @@ class Puppet::Context
52
52
  elsif block
53
53
  block.call
54
54
  else
55
- raise UndefinedBindingError, _("Unable to lookup '%{name}'") % { name: name }
55
+ raise UndefinedBindingError, _("no '%{name}' in %{table} at top of %{stack}") % { name: name, table: @table.inspect, stack: @stack.inspect }
56
56
  end
57
57
  end
58
58
 
@@ -0,0 +1,213 @@
1
+ # Data types in the Puppet Language can have implementations written in Ruby
2
+ # and distributed in puppet modules. A data type can be declared together with
3
+ # its implementation by creating a file in 'lib/puppet/functions/<modulename>'.
4
+ # The name of the file must be the downcased name of the data type followed by
5
+ # the extension '.rb'.
6
+ #
7
+ # A data type is created by calling {Puppet::DataTypes.create_type(<type name>)}
8
+ # and passing it a block that defines the data type interface and implementation.
9
+ #
10
+ # Data types are namespaced inside the modules that contains them. The name of the
11
+ # data type is prefixed with the name of the module. As with all type names, each
12
+ # segment of the name must start with an uppercase letter.
13
+ #
14
+ # @example A simple data type
15
+ # Puppet::DataTypes.create_type('Auth::User') do
16
+ # interface <<-PUPPET
17
+ # attributes => {
18
+ # name => String,
19
+ # email => String
20
+ # }
21
+ # PUPPET
22
+ # end
23
+ #
24
+ # The above example does not declare an implementation which makes it equivalent
25
+ # to adding the following contents in a file named 'user.pp' under the 'types' directory
26
+ # of the module root.
27
+ #
28
+ # type Auth::User = Object[
29
+ # attributes => {
30
+ # name => String,
31
+ # email => String
32
+ # }]
33
+ #
34
+ # Both declarations are valid and will be found by the module loader.
35
+ #
36
+ # Structure of a data type
37
+ # ---
38
+ #
39
+ # A Data Type consists of an interface and an implementation. Unless a registered implementation
40
+ # is found, the type system will automatically generate one. An automatically generated
41
+ # implementation is all that is needed when the interface fully defines the behaviour (for
42
+ # example in the common case when the data type has no other behaviour than having attributes).
43
+ #
44
+ # When the automatically generated implementation is not sufficient, one must be implemented and
45
+ # registered. The implementation can either be done next to the interface definition by passing
46
+ # a block to `implementation`, or map to an existing implementation class by passing the class
47
+ # as an argument to `implementation_class`. An implementation class does not have to be special
48
+ # in other respects than that it must implemented the type's interface. This makes it possible
49
+ # to use existing Ruby data types as data types in the puppet language.
50
+ #
51
+ # Note that when using `implementation_class` there can only be one such implementation across
52
+ # all environments managed by one puppet server and you must handle and install these
53
+ # implementations as if they are part of the puppet platform. In contrast; the type
54
+ # implementations that are done inside of the type's definition are safe to use in different
55
+ # versions in different environments (given that they do not need additional external logic to
56
+ # be loaded).
57
+ #
58
+ # When using an `implementation_class` it is sometimes desirable to load this class from the
59
+ # 'lib' directory of the module. The method `load_file` is provided to facilitate such a load.
60
+ # The `load_file` will use the `Puppet::Util::Autoload` to search for the given file in the 'lib'
61
+ # directory of the current environment and the 'lib' directory in each included module.
62
+ #
63
+ # @example Adding implementation on top of the generated type using `implementation`
64
+ # Puppet::DataTypes.create_type('Auth::User') do
65
+ # interface <<-PUPPET
66
+ # attributes => {
67
+ # name => String,
68
+ # email => String,
69
+ # year_of_birth => Integer,
70
+ # age => { type => Integer, kind => derived }
71
+ # }
72
+ # PUPPET
73
+ #
74
+ # implementation do
75
+ # def age
76
+ # DateTime.now.year - @year_of_birth
77
+ # end
78
+ # end
79
+ # end
80
+ #
81
+ # @example Appointing an already existing implementation class
82
+ #
83
+ # Assumes the following class is declared under 'lib/puppetx/auth' in the module:
84
+ #
85
+ # class PuppetX::Auth::User
86
+ # attr_reader :name, :year_of_birth
87
+ # def initialize(name, year_of_birth)
88
+ # @name = name
89
+ # @year_of_birth = year_of_birth
90
+ # end
91
+ #
92
+ # def age
93
+ # DateTime.now.year - @year_of_birth
94
+ # end
95
+ #
96
+ # def send_text(sender, text)
97
+ # sender.send_text_from(@name, text)
98
+ # end
99
+ # end
100
+ #
101
+ # Then the type declaration can look like this:
102
+ #
103
+ # Puppet::DataTypes.create_type('Auth::User') do
104
+ # interface <<-PUPPET
105
+ # attributes => {
106
+ # name => String,
107
+ # email => String,
108
+ # year_of_birth => Integer,
109
+ # age => { type => Integer, kind => derived }
110
+ # },
111
+ # functions => {
112
+ # send_text => Callable[Sender, String[1]]
113
+ # }
114
+ # PUPPET
115
+ #
116
+ # # This load_file is optional and only needed in case
117
+ # # the implementation is not loaded by other means.
118
+ # load_file 'puppetx/auth/user'
119
+ #
120
+ # implementation_class PuppetX::Auth::User
121
+ # end
122
+ #
123
+ module Puppet::DataTypes
124
+ def self.create_type(type_name, &block)
125
+ # Ruby < 2.1.0 does not have method on Binding, can only do eval
126
+ # and it will fail unless protected with an if defined? if the local
127
+ # variable does not exist in the block's binder.
128
+ #
129
+ begin
130
+ loader = block.binding.eval('loader_injected_arg if defined?(loader_injected_arg)')
131
+ create_loaded_type(type_name, loader, &block)
132
+ rescue StandardError => e
133
+ raise ArgumentError, _("Data Type Load Error for type '%{type_name}': %{message}") % {type_name: type_name, message: e.message}
134
+ end
135
+
136
+ end
137
+
138
+ def self.create_loaded_type(type_name, loader, &block)
139
+ builder = TypeBuilder.new(type_name.to_s)
140
+ api = TypeBuilderAPI.new(builder).freeze
141
+ api.instance_eval(&block)
142
+ builder.create_type(loader)
143
+ end
144
+
145
+ # @api private
146
+ class TypeBuilder
147
+ attr_accessor :interface, :implementation, :implementation_class
148
+
149
+ def initialize(type_name)
150
+ @type_name = type_name
151
+ @implementation = nil
152
+ @implementation_class = nil
153
+ end
154
+
155
+ def create_type(loader)
156
+ raise ArgumentError, _('a data type must have an interface') unless @interface.is_a?(String)
157
+ created_type = Puppet::Pops::Types::PObjectType.new(
158
+ @type_name,
159
+ Puppet::Pops::Parser::EvaluatingParser.new.parse_string("{ #{@interface} }").body)
160
+
161
+ if !@implementation_class.nil?
162
+ if @implementation_class < Puppet::Pops::Types::PuppetObject
163
+ @implementation_class.instance_eval do
164
+ include Puppet::Pops::Types::PuppetObject
165
+ @_pcore_type = created_type
166
+
167
+ def self._pcore_type
168
+ @_pcore_type
169
+ end
170
+ end
171
+ else
172
+ Puppet::Pops::Loaders.implementation_registry.register_implementation(created_type, @implementation_class, loader)
173
+ end
174
+ created_type.implementation_class = @implementation_class
175
+ elsif !@implementation.nil?
176
+ created_type.implementation_override = @implementation
177
+ end
178
+ created_type
179
+ end
180
+
181
+ def has_implementation?
182
+ !(@implementation_class.nil? && @implementation.nil?)
183
+ end
184
+ end
185
+
186
+ # The TypeBuilderAPI class exposes only those methods that the builder API provides
187
+ # @api public
188
+ class TypeBuilderAPI
189
+ # @api private
190
+ def initialize(type_builder)
191
+ @type_builder = type_builder
192
+ end
193
+
194
+ def interface(type_string)
195
+ raise ArgumentError, _('a data type can only have one interface') unless @type_builder.interface.nil?
196
+ @type_builder.interface = type_string
197
+ end
198
+
199
+ def implementation(&block)
200
+ raise ArgumentError, _('a data type can only have one implementation') if @type_builder.has_implementation?
201
+ @type_builder.implementation = block
202
+ end
203
+
204
+ def implementation_class(ruby_class)
205
+ raise ArgumentError, _('a data type can only have one implementation') if @type_builder.has_implementation?
206
+ @type_builder.implementation_class = ruby_class
207
+ end
208
+
209
+ def load_file(file_name)
210
+ Puppet::Util::Autoload.load_file(file_name, nil)
211
+ end
212
+ end
213
+ end
@@ -0,0 +1,21 @@
1
+ Puppet::DataTypes.create_type('Error') do
2
+ interface <<-PUPPET
3
+ type_parameters => {
4
+ kind => Optional[Variant[String,Regexp,Type[Enum],Type[Pattern],Type[NotUndef],Type[Undef]]],
5
+ issue_code => Optional[Variant[String,Regexp,Type[Enum],Type[Pattern],Type[NotUndef],Type[Undef]]]
6
+ },
7
+ attributes => {
8
+ msg => String[1],
9
+ kind => { type => Optional[String[1]], value => undef },
10
+ details => { type => Optional[Hash[String[1],Data]], value => undef },
11
+ issue_code => { type => Optional[String[1]], value => undef },
12
+ },
13
+ functions => {
14
+ message => Callable[[], String[1]]
15
+ }
16
+ PUPPET
17
+
18
+ require 'puppet/datatypes/impl/error'
19
+
20
+ implementation_class Puppet::DataTypes::Error
21
+ end
@@ -0,0 +1,40 @@
1
+ class Puppet::DataTypes::Error
2
+ attr_reader :msg, :kind, :issue_code, :details
3
+ alias message msg
4
+
5
+ def self.from_asserted_hash(hash)
6
+ new(hash['msg'], hash['kind'], hash['details'], hash['issue_code'])
7
+ end
8
+
9
+ def _pcore_init_hash
10
+ result = { 'msg' => @msg }
11
+ result['kind'] = @kind unless @kind.nil?
12
+ result['details'] = @details unless @details.nil?
13
+ result['issue_code'] = @issue_code unless @issue_code.nil?
14
+ result
15
+ end
16
+
17
+ def initialize(msg, kind = nil, details = nil, issue_code = nil)
18
+ @msg = msg
19
+ @kind = kind
20
+ @details = details
21
+ @issue_code = issue_code
22
+ end
23
+
24
+ def eql?(o)
25
+ self.class.equal?(o.class) &&
26
+ @msg == o.msg &&
27
+ @kind == o.kind &&
28
+ @issue_code == o.issue_code &&
29
+ @details == o.details
30
+ end
31
+ alias == eql?
32
+
33
+ def hash
34
+ @msg.hash ^ @kind.hash ^ @issue_code.hash
35
+ end
36
+
37
+ def to_s
38
+ Puppet::Pops::Types::StringConverter.singleton.convert(self)
39
+ end
40
+ end
@@ -1,3 +1,5 @@
1
+ require 'puppet/util/platform'
2
+
1
3
  module Puppet
2
4
 
3
5
  def self.default_diffargs
@@ -8,6 +10,28 @@ module Puppet
8
10
  end
9
11
  end
10
12
 
13
+ def self.default_digest_algorithm
14
+ Puppet::Util::Platform.fips_enabled? ? 'sha256' : 'md5'
15
+ end
16
+
17
+ def self.valid_digest_algorithms
18
+ Puppet::Util::Platform.fips_enabled? ?
19
+ %w[sha256 sha384 sha512 sha224] :
20
+ %w[md5 sha256 sha384 sha512 sha224]
21
+ end
22
+
23
+ def self.default_file_checksum_types
24
+ Puppet::Util::Platform.fips_enabled? ?
25
+ %w[sha256 sha384 sha512 sha224] :
26
+ %w[md5 sha256 sha384 sha512 sha224]
27
+ end
28
+
29
+ def self.valid_file_checksum_types
30
+ Puppet::Util::Platform.fips_enabled? ?
31
+ %w[sha256 sha256lite sha384 sha512 sha224 sha1 sha1lite mtime ctime] :
32
+ %w[md5 md5lite sha256 sha256lite sha384 sha512 sha224 sha1 sha1lite mtime ctime]
33
+ end
34
+
11
35
  ############################################################################################
12
36
  # NOTE: For information about the available values for the ":type" property of settings,
13
37
  # see the docs for Settings.define_settings
@@ -177,7 +201,9 @@ module Puppet
177
201
  :static_catalogs => {
178
202
  :default => true,
179
203
  :type => :boolean,
180
- :desc => "Whether to compile a static catalog."
204
+ :desc => "Whether to compile a [static catalog](https://docs.puppet.com/puppet/latest/static_catalogs.html#enabling-or-disabling-static-catalogs),
205
+ which occurs only on a Puppet Server master when the `code-id-command` and
206
+ `code-content-command` settings are configured in its `puppetserver.conf` file.",
181
207
  },
182
208
  :strict_environment_mode => {
183
209
  :default => false,
@@ -919,25 +945,28 @@ attempt to download the CRL.
919
945
  EOT
920
946
  },
921
947
  :digest_algorithm => {
922
- :default => 'md5',
948
+ :default => lambda { default_digest_algorithm },
923
949
  :type => :enum,
924
- :values => ["md5", "sha256"],
925
- :desc => 'Which digest algorithm to use for file resources and the filebucket.
926
- Valid values are md5, sha256. Default is md5.',
950
+ :values => valid_digest_algorithms,
951
+ :desc => "Which digest algorithm to use for file resources and the filebucket.
952
+ Valid values are #{valid_digest_algorithms.join(', ')}. Default is
953
+ #{default_digest_algorithm}.",
927
954
  },
928
955
  :supported_checksum_types => {
929
- :default => ['md5', 'sha256'],
956
+ :default => lambda { default_file_checksum_types },
930
957
  :type => :array,
931
- :desc => 'Checksum types supported by this agent for use in file resources of a
932
- static catalog. Values must be comma-separated. Valid types are md5,
933
- md5lite, sha256, sha256lite, sha1, sha1lite, mtime, ctime.',
958
+ :desc => "Checksum types supported by this agent for use in file resources of a
959
+ static catalog. Values must be comma-separated. Valid types are
960
+ #{valid_file_checksum_types.join(', ')}. Default is
961
+ #{default_file_checksum_types.join(', ')}.",
934
962
  :hook => proc do |value|
935
963
  values = munge(value)
936
- valid = ['md5', 'md5lite', 'sha256', 'sha256lite', 'sha1', 'sha1lite', 'mtime', 'ctime']
937
- invalid = values.reject {|alg| valid.include?(alg)}
964
+
965
+ invalid = values - Puppet.valid_file_checksum_types
938
966
  if not invalid.empty?
939
- raise ArgumentError, _("Unrecognized checksum types %{invalid} are not supported.") % { invalid: invalid } +
940
- ' ' + _("Valid values are %{values}.") % { values: valid }
967
+ raise ArgumentError, _("Invalid value '%{value}' for parameter %{name}. Allowed values are '%{allowed_values}'") % {
968
+ value: invalid.first, name: @name, allowed_values: Puppet.valid_file_checksum_types.join("', '")
969
+ }
941
970
  end
942
971
  end
943
972
  }
@@ -1257,13 +1286,7 @@ EOT
1257
1286
  :desc => "File that provides mapping between custom SSL oids and user-friendly names"
1258
1287
  },
1259
1288
  :basemodulepath => {
1260
- :default => lambda do
1261
- if Puppet::Util::Platform.windows?
1262
- '$codedir/modules'
1263
- else
1264
- '$codedir/modules:/opt/puppetlabs/puppet/modules'
1265
- end
1266
- end,
1289
+ :default => "$codedir/modules#{File::PATH_SEPARATOR}/opt/puppetlabs/puppet/modules",
1267
1290
  :type => :path,
1268
1291
  :desc => "The search path for **global** modules. Should be specified as a
1269
1292
  list of directories separated by the system path separator character. (The
@@ -2008,6 +2031,14 @@ EOT
2008
2031
  Causes an evaluation error when referencing unknown variables. (This does not affect
2009
2032
  referencing variables that are explicitly set to undef).
2010
2033
  EOT
2034
+ },
2035
+ :tasks => {
2036
+ :default => false,
2037
+ :type => :boolean,
2038
+ :desc => <<-'EOT'
2039
+ Turns on experimental support for tasks and plans in the puppet language. This is for internal API use only.
2040
+ Do not change this setting.
2041
+ EOT
2011
2042
  }
2012
2043
  )
2013
2044
  define_settings(:puppetdoc,