puppet 6.22.1-x86-mingw32 → 6.25.1-x86-mingw32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (415) hide show
  1. checksums.yaml +4 -4
  2. data/CONTRIBUTING.md +5 -5
  3. data/Gemfile +2 -2
  4. data/Gemfile.lock +20 -20
  5. data/README.md +4 -4
  6. data/{ext → examples/enc}/regexp_nodes/classes/databases +0 -0
  7. data/{ext → examples/enc}/regexp_nodes/classes/webservers +0 -0
  8. data/{ext → examples/enc}/regexp_nodes/environment/development +0 -0
  9. data/{ext → examples/enc}/regexp_nodes/parameters/service/prod +0 -0
  10. data/{ext → examples/enc}/regexp_nodes/parameters/service/qa +0 -0
  11. data/{ext → examples/enc}/regexp_nodes/parameters/service/sandbox +0 -0
  12. data/{ext → examples/enc}/regexp_nodes/regexp_nodes.rb +0 -0
  13. data/{ext → examples}/nagios/check_puppet.rb +2 -2
  14. data/ext/README.md +13 -0
  15. data/ext/osx/puppet.plist +2 -0
  16. data/ext/project_data.yaml +1 -0
  17. data/lib/puppet/application/agent.rb +16 -5
  18. data/lib/puppet/application/apply.rb +22 -3
  19. data/lib/puppet/application/device.rb +2 -1
  20. data/lib/puppet/application/filebucket.rb +1 -0
  21. data/lib/puppet/application/resource.rb +32 -16
  22. data/lib/puppet/application/script.rb +2 -1
  23. data/lib/puppet/application/ssl.rb +1 -0
  24. data/lib/puppet/concurrent/thread_local_singleton.rb +1 -0
  25. data/lib/puppet/configurer/downloader.rb +2 -1
  26. data/lib/puppet/configurer.rb +144 -56
  27. data/lib/puppet/confine/variable.rb +1 -1
  28. data/lib/puppet/defaults.rb +47 -33
  29. data/lib/puppet/environments.rb +75 -25
  30. data/lib/puppet/face/facts.rb +1 -1
  31. data/lib/puppet/face/help/action.erb +1 -0
  32. data/lib/puppet/face/help/face.erb +1 -0
  33. data/lib/puppet/face/node/clean.rb +11 -0
  34. data/lib/puppet/facter_impl.rb +96 -0
  35. data/lib/puppet/file_serving/configuration/parser.rb +2 -0
  36. data/lib/puppet/file_serving/configuration.rb +3 -0
  37. data/lib/puppet/file_serving/fileset.rb +14 -2
  38. data/lib/puppet/file_serving/mount/file.rb +4 -4
  39. data/lib/puppet/file_serving/mount/scripts.rb +24 -0
  40. data/lib/puppet/file_system/file_impl.rb +3 -1
  41. data/lib/puppet/file_system/windows.rb +2 -2
  42. data/lib/puppet/forge.rb +4 -4
  43. data/lib/puppet/functions/all.rb +1 -1
  44. data/lib/puppet/functions/camelcase.rb +1 -1
  45. data/lib/puppet/functions/capitalize.rb +2 -2
  46. data/lib/puppet/functions/downcase.rb +2 -2
  47. data/lib/puppet/functions/empty.rb +8 -0
  48. data/lib/puppet/functions/find_template.rb +2 -2
  49. data/lib/puppet/functions/get.rb +5 -5
  50. data/lib/puppet/functions/group_by.rb +13 -5
  51. data/lib/puppet/functions/lest.rb +1 -1
  52. data/lib/puppet/functions/new.rb +100 -100
  53. data/lib/puppet/functions/partition.rb +4 -4
  54. data/lib/puppet/functions/require.rb +5 -5
  55. data/lib/puppet/functions/sort.rb +3 -3
  56. data/lib/puppet/functions/strftime.rb +1 -0
  57. data/lib/puppet/functions/tree_each.rb +7 -9
  58. data/lib/puppet/functions/type.rb +4 -4
  59. data/lib/puppet/functions/unwrap.rb +17 -2
  60. data/lib/puppet/functions/upcase.rb +2 -2
  61. data/lib/puppet/http/client.rb +1 -1
  62. data/lib/puppet/http/redirector.rb +5 -0
  63. data/lib/puppet/http/resolver/server_list.rb +15 -4
  64. data/lib/puppet/http/service/compiler.rb +75 -1
  65. data/lib/puppet/http/service/file_server.rb +2 -1
  66. data/lib/puppet/indirector/catalog/compiler.rb +25 -6
  67. data/lib/puppet/indirector/catalog/rest.rb +1 -0
  68. data/lib/puppet/indirector/facts/facter.rb +6 -6
  69. data/lib/puppet/indirector/file_metadata/rest.rb +1 -0
  70. data/lib/puppet/indirector/indirection.rb +1 -1
  71. data/lib/puppet/indirector/resource/ral.rb +6 -1
  72. data/lib/puppet/indirector/terminus.rb +4 -0
  73. data/lib/puppet/interface/documentation.rb +1 -0
  74. data/lib/puppet/module/plan.rb +0 -1
  75. data/lib/puppet/module/task.rb +1 -1
  76. data/lib/puppet/module.rb +1 -0
  77. data/lib/puppet/module_tool/applications/installer.rb +12 -4
  78. data/lib/puppet/module_tool/applications/uninstaller.rb +1 -1
  79. data/lib/puppet/module_tool/applications/upgrader.rb +1 -1
  80. data/lib/puppet/module_tool/errors/shared.rb +17 -0
  81. data/lib/puppet/network/http/api/indirected_routes.rb +1 -1
  82. data/lib/puppet/node/environment.rb +10 -11
  83. data/lib/puppet/pal/pal_impl.rb +1 -1
  84. data/lib/puppet/parser/functions/fqdn_rand.rb +14 -6
  85. data/lib/puppet/parser/resource.rb +1 -1
  86. data/lib/puppet/parser/scope.rb +1 -0
  87. data/lib/puppet/parser/templatewrapper.rb +1 -0
  88. data/lib/puppet/pops/evaluator/closure.rb +7 -5
  89. data/lib/puppet/pops/evaluator/runtime3_resource_support.rb +1 -0
  90. data/lib/puppet/pops/lookup/lookup_adapter.rb +3 -2
  91. data/lib/puppet/pops/model/ast.rb +1 -0
  92. data/lib/puppet/pops/model/factory.rb +2 -1
  93. data/lib/puppet/pops/parser/eparser.rb +201 -201
  94. data/lib/puppet/pops/parser/lexer2.rb +92 -91
  95. data/lib/puppet/pops/parser/slurp_support.rb +1 -0
  96. data/lib/puppet/pops/serialization/to_data_converter.rb +18 -6
  97. data/lib/puppet/pops/serialization/to_stringified_converter.rb +1 -1
  98. data/lib/puppet/pops/types/p_sem_ver_type.rb +8 -2
  99. data/lib/puppet/pops/types/p_sensitive_type.rb +10 -0
  100. data/lib/puppet/pops/types/type_formatter.rb +4 -3
  101. data/lib/puppet/pops/types/type_mismatch_describer.rb +1 -1
  102. data/lib/puppet/pops/types/types.rb +1 -1
  103. data/lib/puppet/provider/aix_object.rb +1 -1
  104. data/lib/puppet/provider/exec/posix.rb +16 -4
  105. data/lib/puppet/provider/group/groupadd.rb +5 -2
  106. data/lib/puppet/provider/package/nim.rb +11 -6
  107. data/lib/puppet/provider/package/pip.rb +15 -3
  108. data/lib/puppet/provider/package/pkg.rb +19 -2
  109. data/lib/puppet/provider/package/puppetserver_gem.rb +1 -1
  110. data/lib/puppet/provider/package/yum.rb +1 -1
  111. data/lib/puppet/provider/parsedfile.rb +3 -0
  112. data/lib/puppet/provider/service/base.rb +1 -1
  113. data/lib/puppet/provider/service/init.rb +5 -5
  114. data/lib/puppet/provider/service/launchd.rb +2 -2
  115. data/lib/puppet/provider/service/redhat.rb +1 -1
  116. data/lib/puppet/provider/service/smf.rb +3 -3
  117. data/lib/puppet/provider/service/systemd.rb +15 -5
  118. data/lib/puppet/provider/service/upstart.rb +5 -5
  119. data/lib/puppet/provider/service/windows.rb +38 -0
  120. data/lib/puppet/provider/user/aix.rb +44 -1
  121. data/lib/puppet/provider/user/directoryservice.rb +26 -13
  122. data/lib/puppet/provider/user/useradd.rb +72 -16
  123. data/lib/puppet/provider.rb +1 -1
  124. data/lib/puppet/reference/configuration.rb +1 -1
  125. data/lib/puppet/reference/providers.rb +2 -2
  126. data/lib/puppet/resource/catalog.rb +1 -1
  127. data/lib/puppet/resource/type_collection.rb +1 -0
  128. data/lib/puppet/resource.rb +38 -5
  129. data/lib/puppet/runtime.rb +11 -1
  130. data/lib/puppet/settings.rb +32 -9
  131. data/lib/puppet/test/test_helper.rb +4 -1
  132. data/lib/puppet/transaction/additional_resource_generator.rb +1 -1
  133. data/lib/puppet/transaction/persistence.rb +11 -1
  134. data/lib/puppet/transaction/report.rb +15 -1
  135. data/lib/puppet/type/exec.rb +35 -5
  136. data/lib/puppet/type/file/mode.rb +6 -0
  137. data/lib/puppet/type/file/selcontext.rb +1 -1
  138. data/lib/puppet/type/file.rb +25 -7
  139. data/lib/puppet/type/filebucket.rb +3 -3
  140. data/lib/puppet/type/group.rb +0 -1
  141. data/lib/puppet/type/resources.rb +1 -1
  142. data/lib/puppet/type/service.rb +26 -41
  143. data/lib/puppet/type/tidy.rb +22 -3
  144. data/lib/puppet/type/user.rb +38 -21
  145. data/lib/puppet/type.rb +1 -1
  146. data/lib/puppet/util/command_line.rb +1 -1
  147. data/lib/puppet/util/filetype.rb +2 -2
  148. data/lib/puppet/util/json.rb +3 -0
  149. data/lib/puppet/util/log.rb +1 -2
  150. data/lib/puppet/util/logging.rb +1 -25
  151. data/lib/puppet/util/pidlock.rb +1 -1
  152. data/lib/puppet/util/rdoc/parser/puppet_parser_core.rb +1 -1
  153. data/lib/puppet/util/selinux.rb +30 -4
  154. data/lib/puppet/util/suidmanager.rb +1 -2
  155. data/lib/puppet/util/symbolic_file_mode.rb +29 -17
  156. data/lib/puppet/util/tagging.rb +1 -0
  157. data/lib/puppet/util/windows/service.rb +0 -5
  158. data/lib/puppet/util/windows/sid.rb +3 -1
  159. data/lib/puppet/util/windows/user.rb +0 -2
  160. data/lib/puppet/util/windows.rb +3 -0
  161. data/lib/puppet/util.rb +4 -3
  162. data/lib/puppet/version.rb +1 -1
  163. data/lib/puppet.rb +5 -9
  164. data/locales/puppet.pot +408 -364
  165. data/man/man5/puppet.conf.5 +303 -275
  166. data/man/man8/puppet-agent.8 +4 -1
  167. data/man/man8/puppet-apply.8 +1 -1
  168. data/man/man8/puppet-catalog.8 +9 -9
  169. data/man/man8/puppet-config.8 +1 -1
  170. data/man/man8/puppet-describe.8 +1 -1
  171. data/man/man8/puppet-device.8 +1 -1
  172. data/man/man8/puppet-doc.8 +1 -1
  173. data/man/man8/puppet-epp.8 +1 -1
  174. data/man/man8/puppet-facts.8 +8 -8
  175. data/man/man8/puppet-filebucket.8 +1 -1
  176. data/man/man8/puppet-generate.8 +1 -1
  177. data/man/man8/puppet-help.8 +1 -1
  178. data/man/man8/puppet-key.8 +7 -7
  179. data/man/man8/puppet-lookup.8 +1 -1
  180. data/man/man8/puppet-man.8 +1 -1
  181. data/man/man8/puppet-module.8 +3 -3
  182. data/man/man8/puppet-node.8 +5 -5
  183. data/man/man8/puppet-parser.8 +1 -1
  184. data/man/man8/puppet-plugin.8 +1 -1
  185. data/man/man8/puppet-report.8 +5 -5
  186. data/man/man8/puppet-resource.8 +1 -1
  187. data/man/man8/puppet-script.8 +1 -1
  188. data/man/man8/puppet-ssl.8 +1 -1
  189. data/man/man8/puppet-status.8 +4 -4
  190. data/man/man8/puppet.8 +2 -2
  191. data/spec/fixtures/integration/application/agent/cached_deferred_catalog.json +2 -1
  192. data/spec/fixtures/integration/application/agent/lib/facter/agent_spec_role.rb +3 -0
  193. data/spec/fixtures/integration/l10n/envs/prod/modules/demo/Gemfile +4 -0
  194. data/spec/fixtures/integration/l10n/envs/prod/modules/demo/Rakefile +3 -0
  195. data/spec/fixtures/integration/l10n/envs/prod/modules/demo/lib/puppet/functions/l10n.rb +8 -0
  196. data/spec/fixtures/integration/l10n/envs/prod/modules/demo/locales/config.yaml +25 -0
  197. data/spec/fixtures/integration/l10n/envs/prod/modules/demo/locales/ja/puppet-l10n.po +19 -0
  198. data/spec/fixtures/integration/l10n/envs/prod/modules/demo/locales/puppet-l10n.pot +20 -0
  199. data/spec/fixtures/integration/l10n/envs/prod/modules/demo/metadata.json +8 -0
  200. data/spec/fixtures/ssl/127.0.0.1-key.pem +107 -57
  201. data/spec/fixtures/ssl/127.0.0.1.pem +52 -31
  202. data/spec/fixtures/ssl/bad-basic-constraints.pem +57 -35
  203. data/spec/fixtures/ssl/bad-int-basic-constraints.pem +57 -35
  204. data/spec/fixtures/ssl/ca.pem +57 -35
  205. data/spec/fixtures/ssl/crl.pem +28 -18
  206. data/spec/fixtures/ssl/ec-key.pem +11 -11
  207. data/spec/fixtures/ssl/ec.pem +33 -24
  208. data/spec/fixtures/ssl/encrypted-ec-key.pem +12 -12
  209. data/spec/fixtures/ssl/encrypted-key.pem +108 -58
  210. data/spec/fixtures/ssl/intermediate-agent-crl.pem +28 -19
  211. data/spec/fixtures/ssl/intermediate-agent.pem +57 -36
  212. data/spec/fixtures/ssl/intermediate-crl.pem +31 -21
  213. data/spec/fixtures/ssl/intermediate.pem +57 -36
  214. data/spec/fixtures/ssl/oid-key.pem +117 -0
  215. data/spec/fixtures/ssl/oid.pem +69 -0
  216. data/spec/fixtures/ssl/pluto-key.pem +107 -57
  217. data/spec/fixtures/ssl/pluto.pem +52 -30
  218. data/spec/fixtures/ssl/request-key.pem +107 -57
  219. data/spec/fixtures/ssl/request.pem +47 -26
  220. data/spec/fixtures/ssl/revoked-key.pem +107 -57
  221. data/spec/fixtures/ssl/revoked.pem +52 -30
  222. data/spec/fixtures/ssl/signed-key.pem +107 -57
  223. data/spec/fixtures/ssl/signed.pem +52 -30
  224. data/spec/fixtures/ssl/tampered-cert.pem +52 -30
  225. data/spec/fixtures/ssl/tampered-csr.pem +47 -26
  226. data/spec/fixtures/ssl/trusted_oid_mapping.yaml +5 -0
  227. data/spec/fixtures/ssl/unknown-127.0.0.1-key.pem +107 -57
  228. data/spec/fixtures/ssl/unknown-127.0.0.1.pem +50 -29
  229. data/spec/fixtures/ssl/unknown-ca-key.pem +107 -57
  230. data/spec/fixtures/ssl/unknown-ca.pem +55 -33
  231. data/spec/integration/application/agent_spec.rb +141 -37
  232. data/spec/integration/application/filebucket_spec.rb +16 -0
  233. data/spec/integration/application/module_spec.rb +21 -0
  234. data/spec/integration/application/resource_spec.rb +64 -0
  235. data/spec/integration/application/ssl_spec.rb +20 -0
  236. data/spec/integration/configurer_spec.rb +18 -2
  237. data/spec/integration/environments/settings_interpolation_spec.rb +0 -4
  238. data/spec/integration/indirector/facts/facter_spec.rb +93 -39
  239. data/spec/integration/l10n/compiler_spec.rb +37 -0
  240. data/spec/integration/parser/pcore_resource_spec.rb +10 -0
  241. data/spec/integration/transaction/report_spec.rb +1 -1
  242. data/spec/integration/type/exec_spec.rb +70 -45
  243. data/spec/integration/type/file_spec.rb +2 -2
  244. data/spec/integration/type/package_spec.rb +6 -6
  245. data/spec/integration/util/rdoc/parser_spec.rb +1 -1
  246. data/spec/integration/util/windows/process_spec.rb +1 -9
  247. data/spec/lib/puppet/test_ca.rb +7 -2
  248. data/spec/lib/puppet_spec/modules.rb +13 -2
  249. data/spec/lib/puppet_spec/puppetserver.rb +15 -0
  250. data/spec/lib/puppet_spec/settings.rb +1 -0
  251. data/spec/shared_behaviours/documentation_on_faces.rb +0 -2
  252. data/spec/shared_contexts/l10n.rb +27 -0
  253. data/spec/spec_helper.rb +1 -10
  254. data/spec/unit/application/agent_spec.rb +7 -2
  255. data/spec/unit/application/apply_spec.rb +76 -56
  256. data/spec/unit/application/resource_spec.rb +29 -0
  257. data/spec/unit/configurer/downloader_spec.rb +6 -0
  258. data/spec/unit/configurer_spec.rb +256 -57
  259. data/spec/unit/defaults_spec.rb +1 -0
  260. data/spec/unit/environments_spec.rb +184 -0
  261. data/spec/unit/facter_impl_spec.rb +31 -0
  262. data/spec/unit/file_bucket/dipper_spec.rb +2 -2
  263. data/spec/unit/file_serving/configuration/parser_spec.rb +23 -0
  264. data/spec/unit/file_serving/configuration_spec.rb +14 -4
  265. data/spec/unit/file_serving/fileset_spec.rb +60 -0
  266. data/spec/unit/file_serving/mount/scripts_spec.rb +69 -0
  267. data/spec/unit/file_system_spec.rb +13 -0
  268. data/spec/unit/functions/assert_type_spec.rb +1 -1
  269. data/spec/unit/functions/empty_spec.rb +10 -0
  270. data/spec/unit/functions/logging_spec.rb +1 -0
  271. data/spec/unit/functions/lookup_spec.rb +64 -0
  272. data/spec/unit/functions/unwrap_spec.rb +8 -0
  273. data/spec/unit/functions4_spec.rb +2 -2
  274. data/spec/unit/gettext/config_spec.rb +12 -0
  275. data/spec/unit/http/client_spec.rb +58 -1
  276. data/spec/unit/http/service/compiler_spec.rb +131 -0
  277. data/spec/unit/indirector/catalog/compiler_spec.rb +101 -10
  278. data/spec/unit/indirector/catalog/rest_spec.rb +8 -0
  279. data/spec/unit/indirector/indirection_spec.rb +10 -3
  280. data/spec/unit/indirector/resource/ral_spec.rb +40 -75
  281. data/spec/unit/interface/action_spec.rb +0 -9
  282. data/spec/unit/module_spec.rb +15 -1
  283. data/spec/unit/module_tool/applications/installer_spec.rb +51 -12
  284. data/spec/unit/network/authstore_spec.rb +0 -15
  285. data/spec/unit/network/formats_spec.rb +6 -0
  286. data/spec/unit/parser/functions/fqdn_rand_spec.rb +15 -1
  287. data/spec/unit/parser/templatewrapper_spec.rb +12 -2
  288. data/spec/unit/pops/parser/parse_containers_spec.rb +0 -11
  289. data/spec/unit/pops/serialization/to_from_hr_spec.rb +58 -0
  290. data/spec/unit/pops/serialization/to_stringified_spec.rb +5 -0
  291. data/spec/unit/pops/types/p_sem_ver_type_spec.rb +18 -0
  292. data/spec/unit/pops/types/p_sensitive_type_spec.rb +18 -0
  293. data/spec/unit/pops/types/type_calculator_spec.rb +6 -0
  294. data/spec/unit/provider/package/gem_spec.rb +1 -1
  295. data/spec/unit/provider/package/nim_spec.rb +42 -0
  296. data/spec/unit/provider/package/pip2_spec.rb +1 -1
  297. data/spec/unit/provider/package/pip3_spec.rb +1 -1
  298. data/spec/unit/provider/package/pip_spec.rb +38 -1
  299. data/spec/unit/provider/package/pkg_spec.rb +29 -4
  300. data/spec/unit/provider/package/puppet_gem_spec.rb +1 -1
  301. data/spec/unit/provider/package/puppetserver_gem_spec.rb +1 -1
  302. data/spec/unit/provider/parsedfile_spec.rb +10 -0
  303. data/spec/unit/provider/service/init_spec.rb +1 -0
  304. data/spec/unit/provider/service/launchd_spec.rb +11 -0
  305. data/spec/unit/provider/service/openwrt_spec.rb +3 -1
  306. data/spec/unit/provider/service/systemd_spec.rb +43 -9
  307. data/spec/unit/provider/service/windows_spec.rb +202 -0
  308. data/spec/unit/provider/user/aix_spec.rb +100 -0
  309. data/spec/unit/provider/user/directoryservice_spec.rb +68 -36
  310. data/spec/unit/provider/user/useradd_spec.rb +43 -2
  311. data/spec/unit/provider_spec.rb +4 -4
  312. data/spec/unit/puppet_spec.rb +12 -4
  313. data/spec/unit/resource/catalog_spec.rb +14 -1
  314. data/spec/unit/resource_spec.rb +58 -2
  315. data/spec/unit/settings_spec.rb +97 -56
  316. data/spec/unit/ssl/certificate_request_spec.rb +8 -14
  317. data/spec/unit/ssl/state_machine_spec.rb +19 -5
  318. data/spec/unit/transaction/additional_resource_generator_spec.rb +0 -2
  319. data/spec/unit/transaction_spec.rb +18 -20
  320. data/spec/unit/type/exec_spec.rb +76 -29
  321. data/spec/unit/type/file/selinux_spec.rb +3 -3
  322. data/spec/unit/type/file/source_spec.rb +4 -4
  323. data/spec/unit/type/service_spec.rb +86 -188
  324. data/spec/unit/type/tidy_spec.rb +24 -7
  325. data/spec/unit/type/user_spec.rb +45 -0
  326. data/spec/unit/type_spec.rb +2 -2
  327. data/spec/unit/util/logging_spec.rb +2 -0
  328. data/spec/unit/util/selinux_spec.rb +87 -16
  329. data/spec/unit/util/windows/sid_spec.rb +39 -4
  330. data/tasks/generate_cert_fixtures.rake +12 -3
  331. data/tasks/parallel.rake +3 -3
  332. metadata +49 -95
  333. data/ext/README.environment +0 -8
  334. data/ext/dbfix.sql +0 -132
  335. data/ext/debian/README.Debian +0 -8
  336. data/ext/debian/README.source +0 -2
  337. data/ext/debian/TODO.Debian +0 -1
  338. data/ext/debian/changelog.erb +0 -1122
  339. data/ext/debian/compat +0 -1
  340. data/ext/debian/control +0 -144
  341. data/ext/debian/copyright +0 -339
  342. data/ext/debian/docs +0 -1
  343. data/ext/debian/fileserver.conf +0 -41
  344. data/ext/debian/puppet-common.dirs +0 -13
  345. data/ext/debian/puppet-common.install +0 -3
  346. data/ext/debian/puppet-common.lintian-overrides +0 -5
  347. data/ext/debian/puppet-common.manpages +0 -28
  348. data/ext/debian/puppet-common.postinst +0 -35
  349. data/ext/debian/puppet-common.postrm +0 -33
  350. data/ext/debian/puppet-el.dirs +0 -1
  351. data/ext/debian/puppet-el.emacsen-install +0 -25
  352. data/ext/debian/puppet-el.emacsen-remove +0 -11
  353. data/ext/debian/puppet-el.emacsen-startup +0 -9
  354. data/ext/debian/puppet-el.install +0 -1
  355. data/ext/debian/puppet-testsuite.install +0 -2
  356. data/ext/debian/puppet-testsuite.lintian-overrides +0 -4
  357. data/ext/debian/puppet.lintian-overrides +0 -3
  358. data/ext/debian/puppet.logrotate +0 -20
  359. data/ext/debian/puppet.postinst +0 -20
  360. data/ext/debian/puppet.postrm +0 -20
  361. data/ext/debian/puppet.preinst +0 -20
  362. data/ext/debian/puppetmaster-common.install +0 -2
  363. data/ext/debian/puppetmaster-common.manpages +0 -2
  364. data/ext/debian/puppetmaster-common.postinst +0 -6
  365. data/ext/debian/puppetmaster-passenger.dirs +0 -4
  366. data/ext/debian/puppetmaster-passenger.postinst +0 -162
  367. data/ext/debian/puppetmaster-passenger.postrm +0 -61
  368. data/ext/debian/puppetmaster.README.debian +0 -17
  369. data/ext/debian/puppetmaster.default +0 -14
  370. data/ext/debian/puppetmaster.init +0 -137
  371. data/ext/debian/puppetmaster.lintian-overrides +0 -3
  372. data/ext/debian/puppetmaster.postinst +0 -20
  373. data/ext/debian/puppetmaster.postrm +0 -5
  374. data/ext/debian/puppetmaster.preinst +0 -22
  375. data/ext/debian/rules +0 -132
  376. data/ext/debian/source/format +0 -1
  377. data/ext/debian/source/options +0 -1
  378. data/ext/debian/vim-puppet.README.Debian +0 -13
  379. data/ext/debian/vim-puppet.dirs +0 -5
  380. data/ext/debian/vim-puppet.yaml +0 -7
  381. data/ext/debian/watch +0 -2
  382. data/ext/freebsd/puppetd +0 -26
  383. data/ext/freebsd/puppetmasterd +0 -26
  384. data/ext/gentoo/conf.d/puppet +0 -5
  385. data/ext/gentoo/conf.d/puppetmaster +0 -12
  386. data/ext/gentoo/init.d/puppet +0 -38
  387. data/ext/gentoo/init.d/puppetmaster +0 -51
  388. data/ext/gentoo/puppet/fileserver.conf +0 -41
  389. data/ext/ips/puppet-agent +0 -44
  390. data/ext/ips/puppet-master +0 -44
  391. data/ext/ips/puppet.p5m.erb +0 -12
  392. data/ext/ips/puppetagent.xml +0 -42
  393. data/ext/ips/puppetmaster.xml +0 -42
  394. data/ext/ips/rules +0 -19
  395. data/ext/ips/transforms +0 -34
  396. data/ext/ldap/puppet.schema +0 -24
  397. data/ext/logcheck/puppet +0 -23
  398. data/ext/osx/file_mapping.yaml +0 -33
  399. data/ext/osx/postflight.erb +0 -109
  400. data/ext/osx/preflight.erb +0 -52
  401. data/ext/osx/prototype.plist.erb +0 -38
  402. data/ext/redhat/fileserver.conf +0 -41
  403. data/ext/redhat/logrotate +0 -21
  404. data/ext/redhat/puppet.spec.erb +0 -842
  405. data/ext/redhat/server.init +0 -128
  406. data/ext/redhat/server.sysconfig +0 -13
  407. data/ext/solaris/pkginfo +0 -6
  408. data/ext/solaris/smf/puppetd.xml +0 -77
  409. data/ext/solaris/smf/puppetmasterd.xml +0 -77
  410. data/ext/solaris/smf/svc-puppetd +0 -71
  411. data/ext/solaris/smf/svc-puppetmasterd +0 -67
  412. data/ext/suse/puppet.spec +0 -310
  413. data/ext/suse/server.init +0 -173
  414. data/ext/yaml_nodes.rb +0 -105
  415. data/spec/unit/indirector/store_configs_spec.rb +0 -7
@@ -50,6 +50,22 @@ Puppet::Type.newtype(:tidy) do
50
50
  end
51
51
  end
52
52
 
53
+ newparam(:max_files) do
54
+ desc "In case the resource is a directory and the recursion is enabled, puppet will
55
+ generate a new resource for each file file found, possible leading to
56
+ an excessive number of resources generated without any control.
57
+
58
+ Setting `max_files` will check the number of file resources that
59
+ will eventually be created and will raise a resource argument error if the
60
+ limit will be exceeded.
61
+
62
+ Use value `0` to disable the check. In this case, a warning is logged if
63
+ the number of files exceeds 1000."
64
+
65
+ defaultto 0
66
+ newvalues(/^[0-9]+$/)
67
+ end
68
+
53
69
  newparam(:matches) do
54
70
  desc <<-'EOT'
55
71
  One or more (shell type) file glob patterns, which restrict
@@ -128,7 +144,7 @@ Puppet::Type.newtype(:tidy) do
128
144
 
129
145
  def tidy?(path, stat)
130
146
  # If the file's older than we allow, we should get rid of it.
131
- (Time.now.to_i - stat.send(resource[:type]).to_i) > value
147
+ (Time.now.to_i - stat.send(resource[:type]).to_i) >= value
132
148
  end
133
149
 
134
150
  munge do |age|
@@ -256,9 +272,12 @@ Puppet::Type.newtype(:tidy) do
256
272
 
257
273
  case self[:recurse]
258
274
  when Integer, /^\d+$/
259
- parameter = { :recurse => true, :recurselimit => self[:recurse] }
275
+ parameter = { :max_files => self[:max_files],
276
+ :recurse => true,
277
+ :recurselimit => self[:recurse] }
260
278
  when true, :true, :inf
261
- parameter = { :recurse => true }
279
+ parameter = { :max_files => self[:max_files],
280
+ :recurse => true }
262
281
  end
263
282
 
264
283
  if parameter
@@ -1,5 +1,4 @@
1
1
  require 'etc'
2
- require 'facter'
3
2
  require 'puppet/parameter/boolean'
4
3
  require 'puppet/property/list'
5
4
  require 'puppet/property/ordered_list'
@@ -67,6 +66,7 @@ module Puppet
67
66
  newproperty(:ensure, :parent => Puppet::Property::Ensure) do
68
67
  newvalue(:present, :event => :user_created) do
69
68
  provider.create
69
+ @resource.generate
70
70
  end
71
71
 
72
72
  newvalue(:absent, :event => :user_removed) do
@@ -695,6 +695,7 @@ module Puppet
695
695
 
696
696
  def generate
697
697
  if !self[:purge_ssh_keys].empty?
698
+ return [] if self[:ensure] == :present && !provider.exists?
698
699
  if Puppet::Type.type(:ssh_authorized_key).nil?
699
700
  warning _("Ssh_authorized_key type is not available. Cannot purge SSH keys.")
700
701
  else
@@ -743,25 +744,6 @@ module Puppet
743
744
  end
744
745
  raise ArgumentError, _("purge_ssh_keys must be true, false, or an array of file names, not %{value}") % { value: value.inspect }
745
746
  end
746
-
747
- munge do |value|
748
- # Resolve string, boolean and symbol forms of true and false to a
749
- # single representation.
750
- test_sym = value.to_s.intern
751
- value = test_sym if [:true, :false].include? test_sym
752
-
753
- return [] if value == :false
754
- home = resource[:home] || Dir.home(resource[:name])
755
-
756
- return [ "#{home}/.ssh/authorized_keys" ] if value == :true
757
- # value is an array - munge each value
758
- [ value ].flatten.map do |entry|
759
- # make sure frozen value is duplicated by using a gsub, second mutating gsub! is then ok
760
- entry = entry.gsub(/^~\//, "#{home}/")
761
- entry.gsub!(/^%h\//, "#{home}/")
762
- entry
763
- end
764
- end
765
747
  end
766
748
 
767
749
  newproperty(:loginclass, :required_features => :manages_loginclass) do
@@ -783,7 +765,7 @@ module Puppet
783
765
  # @see generate
784
766
  # @api private
785
767
  def find_unmanaged_keys
786
- self[:purge_ssh_keys].
768
+ munged_unmanaged_keys.
787
769
  select { |f| File.readable?(f) }.
788
770
  map { |f| unknown_keys_in_file(f) }.
789
771
  flatten.each do |res|
@@ -795,6 +777,41 @@ module Puppet
795
777
  end
796
778
  end
797
779
 
780
+ def munged_unmanaged_keys
781
+ value = self[:purge_ssh_keys]
782
+
783
+ # Resolve string, boolean and symbol forms of true and false to a
784
+ # single representation.
785
+ test_sym = value.to_s.intern
786
+ value = test_sym if [:true, :false].include? test_sym
787
+
788
+ return [] if value == :false
789
+
790
+ home = self[:home]
791
+ begin
792
+ home ||= provider.home
793
+ rescue
794
+ Puppet.debug("User '#{self[:name]}' does not exist")
795
+ end
796
+
797
+ if home.to_s.empty? || !Dir.exist?(home.to_s)
798
+ if value == :true || [ value ].flatten.any? { |v| v.start_with?('~/', '%h/') }
799
+ Puppet.debug("User '#{self[:name]}' has no home directory set to purge ssh keys from.")
800
+ return []
801
+ end
802
+ end
803
+
804
+ return [ "#{home}/.ssh/authorized_keys" ] if value == :true
805
+
806
+ # value is an array - munge each value
807
+ [ value ].flatten.map do |entry|
808
+ # make sure frozen value is duplicated by using a gsub, second mutating gsub! is then ok
809
+ entry = entry.gsub(/^~\//, "#{home}/")
810
+ entry.gsub!(/^%h\//, "#{home}/")
811
+ entry
812
+ end
813
+ end
814
+
798
815
  # Parse an ssh authorized keys file superficially, extract the comments
799
816
  # on the keys. These are considered names of possible ssh_authorized_keys
800
817
  # resources. Keys that are managed by the present catalog are ignored.
data/lib/puppet/type.rb CHANGED
@@ -1295,7 +1295,7 @@ class Type
1295
1295
  like it does when running normally. However, if a resource attribute is not in
1296
1296
  the desired state (as declared in the catalog), Puppet will take no
1297
1297
  action, and will instead report the changes it _would_ have made. These
1298
- simulated changes will appear in the report sent to the puppet master, or
1298
+ simulated changes will appear in the report sent to the primary Puppet server, or
1299
1299
  be shown on the console if running puppet agent or puppet apply in the
1300
1300
  foreground. The simulated changes will not send refresh events to any
1301
1301
  subscribing or notified resources, although Puppet will log that a refresh
@@ -135,7 +135,7 @@ module Puppet
135
135
 
136
136
  # Puppet requires Facter, which initializes its lookup paths. Reset Facter to
137
137
  # pickup the new $LOAD_PATH.
138
- Facter.reset
138
+ Puppet.runtime[:facter].reset
139
139
  end
140
140
  end
141
141
 
@@ -215,7 +215,7 @@ class Puppet::Util::FileType
215
215
  # Remove a specific @path's cron tab.
216
216
  def remove
217
217
  cmd = "#{cmdbase} -r"
218
- if %w{Darwin FreeBSD DragonFly}.include?(Facter.value("operatingsystem"))
218
+ if %w{Darwin FreeBSD DragonFly}.include?(Puppet.runtime[:facter].value("operatingsystem"))
219
219
  cmd = "/bin/echo yes | #{cmd}"
220
220
  end
221
221
 
@@ -244,7 +244,7 @@ class Puppet::Util::FileType
244
244
  # Only add the -u flag when the @path is different. Fedora apparently
245
245
  # does not think I should be allowed to set the @path to my own user name
246
246
  def cmdbase
247
- if @uid == Puppet::Util::SUIDManager.uid || Facter.value(:operatingsystem) == "HP-UX"
247
+ if @uid == Puppet::Util::SUIDManager.uid || Puppet.runtime[:facter].value(:operatingsystem) == "HP-UX"
248
248
  return "crontab"
249
249
  else
250
250
  return "crontab -u #{@path}"
@@ -60,6 +60,9 @@ module Puppet::Util
60
60
  def self.dump(object, options = {})
61
61
  if defined? MultiJson
62
62
  MultiJson.dump(object, options)
63
+ elsif options.is_a?(JSON::State)
64
+ # we're being called recursively
65
+ object.to_json(options)
63
66
  else
64
67
  options.merge!(::JSON::PRETTY_STATE_PROTOTYPE.to_h) if options.delete(:pretty)
65
68
  object.to_json(options)
@@ -2,7 +2,6 @@ require 'puppet/util/tagging'
2
2
  require 'puppet/util/classgen'
3
3
  require 'puppet/util/psych_support'
4
4
  require 'puppet/network/format_support'
5
- require 'facter'
6
5
 
7
6
  # Pass feedback to the user. Log levels are modeled after syslog's, and it is
8
7
  # expected that that will be the most common log destination. Supports
@@ -111,7 +110,7 @@ class Puppet::Util::Log
111
110
  @loglevel = @levels.index(level)
112
111
 
113
112
  # Enable or disable Facter debugging
114
- Facter.debugging(level == :debug) if Facter.respond_to? :debugging
113
+ Puppet.runtime[:facter].debugging(level == :debug)
115
114
  end
116
115
 
117
116
  def Log.levels
@@ -2,8 +2,6 @@
2
2
  require 'puppet/util/log'
3
3
  require 'puppet/error'
4
4
 
5
- require 'facter'
6
-
7
5
  module Puppet::Util
8
6
  module Logging
9
7
 
@@ -254,29 +252,7 @@ module Logging
254
252
  # Sets up Facter logging.
255
253
  # This method causes Facter output to be forwarded to Puppet.
256
254
  def self.setup_facter_logging!
257
- # Only recent versions of Facter support this feature
258
- return false unless Facter.respond_to? :on_message
259
-
260
- # The current Facter log levels are: :trace, :debug, :info, :warn, :error, and :fatal.
261
- # Convert to the corresponding levels in Puppet
262
- Facter.on_message do |level, message|
263
- case level
264
- when :trace, :debug
265
- level = :debug
266
- when :info
267
- # Same as Puppet
268
- when :warn
269
- level = :warning
270
- when :error
271
- level = :err
272
- when :fatal
273
- level = :crit
274
- else
275
- next
276
- end
277
- Puppet::Util::Log.create({:level => level, :source => 'Facter', :message => message})
278
- nil
279
- end
255
+ Puppet.runtime[:facter]
280
256
  true
281
257
  end
282
258
 
@@ -46,7 +46,7 @@ class Puppet::Util::Pidlock
46
46
  private
47
47
 
48
48
  def ps_argument_for_current_kernel
49
- case Facter.value(:kernel)
49
+ case Puppet.runtime[:facter].value(:kernel)
50
50
  when "Linux"
51
51
  "-eq"
52
52
  when "AIX"
@@ -154,7 +154,7 @@ module RDoc::PuppetParserCore
154
154
  # fetch comments
155
155
  if line =~ /^[ \t]*# ?(.*)$/
156
156
  comments += $1 + "\n"
157
- elsif line =~ /^[ \t]*Facter.add\(['"](.*?)['"]\)/
157
+ elsif line =~ /^[ \t]*(Facter.add|Puppet\.runtime\[:facter\].add)\(['"](.*?)['"]\)/
158
158
  current_fact = RDoc::Fact.new($1,{})
159
159
  look_for_directives_in(container, comments) unless comments.empty?
160
160
  current_fact.comment = comments
@@ -13,6 +13,10 @@ require 'pathname'
13
13
 
14
14
  module Puppet::Util::SELinux
15
15
 
16
+ S_IFREG = 0100000
17
+ S_IFDIR = 0040000
18
+ S_IFLNK = 0120000
19
+
16
20
  def self.selinux_support?
17
21
  return false unless defined?(Selinux)
18
22
  if Selinux.is_selinux_enabled == 1
@@ -38,7 +42,7 @@ module Puppet::Util::SELinux
38
42
 
39
43
  # Retrieve and return the default context of the file. If we don't have
40
44
  # SELinux support or if the SELinux call fails to file a default then return nil.
41
- def get_selinux_default_context(file)
45
+ def get_selinux_default_context(file, resource_ensure=nil)
42
46
  return nil unless selinux_support?
43
47
  # If the filesystem has no support for SELinux labels, return a default of nil
44
48
  # instead of what matchpathcon would return
@@ -48,8 +52,14 @@ module Puppet::Util::SELinux
48
52
  begin
49
53
  filestat = file_lstat(file)
50
54
  mode = filestat.mode
51
- rescue Errno::EACCES, Errno::ENOENT
55
+ rescue Errno::EACCES
52
56
  mode = 0
57
+ rescue Errno::ENOENT
58
+ if resource_ensure
59
+ mode = get_create_mode(resource_ensure)
60
+ else
61
+ mode = 0
62
+ end
53
63
  end
54
64
 
55
65
  retval = Selinux.matchpathcon(file, mode)
@@ -136,8 +146,8 @@ module Puppet::Util::SELinux
136
146
  # Puppet uses. This will set the file's SELinux context to the policy's
137
147
  # default context (if any) if it differs from the context currently on
138
148
  # the file.
139
- def set_selinux_default_context(file)
140
- new_context = get_selinux_default_context(file)
149
+ def set_selinux_default_context(file, resource_ensure=nil)
150
+ new_context = get_selinux_default_context(file, resource_ensure)
141
151
  return nil unless new_context
142
152
  cur_context = get_selinux_current_context(file)
143
153
  if new_context != cur_context
@@ -198,6 +208,22 @@ module Puppet::Util::SELinux
198
208
  filesystems.include?(fstype)
199
209
  end
200
210
 
211
+ # Get mode file type bits set based on ensure on
212
+ # the file resource. This helps SELinux determine
213
+ # what context a new resource being created should have.
214
+ def get_create_mode(resource_ensure)
215
+ mode = 0
216
+ case resource_ensure
217
+ when :present, :file
218
+ mode |= S_IFREG
219
+ when :directory
220
+ mode |= S_IFDIR
221
+ when :link
222
+ mode |= S_IFLNK
223
+ end
224
+ mode
225
+ end
226
+
201
227
  # Internal helper function to read and parse /proc/mounts
202
228
  def read_mounts
203
229
  mounts = ""
@@ -1,4 +1,3 @@
1
- require 'facter'
2
1
  require 'puppet/util/warnings'
3
2
  require 'forwardable'
4
3
  require 'etc'
@@ -18,7 +17,7 @@ module Puppet::Util::SUIDManager
18
17
 
19
18
  def osx_maj_ver
20
19
  return @osx_maj_ver unless @osx_maj_ver.nil?
21
- @osx_maj_ver = Facter.value('macosx_productversion_major') || false
20
+ @osx_maj_ver = Puppet.runtime[:facter].value('macosx_productversion_major') || false
22
21
  end
23
22
  module_function :osx_maj_ver
24
23
 
@@ -19,25 +19,37 @@ module SymbolicFileMode
19
19
  return false
20
20
  end
21
21
 
22
+ def display_mode(value)
23
+ if value =~ /^0?[0-7]{1,4}$/
24
+ value.rjust(4, "0")
25
+ else
26
+ value
27
+ end
28
+ end
29
+
22
30
  def normalize_symbolic_mode(value)
23
31
  return nil if value.nil?
24
32
 
25
33
  # We need to treat integers as octal numbers.
26
- if value.is_a? Numeric then
27
- return value.to_s(8)
28
- elsif value =~ /^0?[0-7]{1,4}$/ then
29
- return value.to_i(8).to_s(8)
34
+ #
35
+ # "A numeric mode is from one to four octal digits (0-7), derived by adding
36
+ # up the bits with values 4, 2, and 1. Omitted digits are assumed to be
37
+ # leading zeros."
38
+ if value.is_a? Numeric
39
+ value.to_s(8)
40
+ elsif value =~ /^0?[0-7]{1,4}$/
41
+ value.to_i(8).to_s(8) # strip leading 0's
30
42
  else
31
- return value
43
+ value
32
44
  end
33
45
  end
34
46
 
35
47
  def symbolic_mode_to_int(modification, to_mode = 0, is_a_directory = false)
36
- if modification.nil? or modification == '' then
48
+ if modification.nil? or modification == ''
37
49
  raise Puppet::Error, _("An empty mode string is illegal")
38
- end
39
- if modification =~ /^[0-7]+$/ then return modification.to_i(8) end
40
- if modification =~ /^\d+$/ then
50
+ elsif modification =~ /^[0-7]+$/
51
+ return modification.to_i(8)
52
+ elsif modification =~ /^\d+$/
41
53
  raise Puppet::Error, _("Numeric modes must be in octal, not decimal!")
42
54
  end
43
55
 
@@ -84,31 +96,31 @@ module SymbolicFileMode
84
96
 
85
97
  dsl.split('').each do |op|
86
98
  case op
87
- when /[-+=]/ then
99
+ when /[-+=]/
88
100
  action = op
89
101
  # Clear all bits, if this is assignment
90
102
  value = 0 if op == '='
91
103
 
92
- when /[ugo]/ then
104
+ when /[ugo]/
93
105
  value = actions[action].call(value, snapshot_mode[op])
94
106
 
95
- when /[rwx]/ then
107
+ when /[rwx]/
96
108
  value = actions[action].call(value, SymbolicMode[op])
97
109
 
98
- when 'X' then
110
+ when 'X'
99
111
  # Only meaningful in combination with "set" actions.
100
- if action != '+' then
112
+ if action != '+'
101
113
  raise Puppet::Error, _("X only works with the '+' operator")
102
114
  end
103
115
 
104
116
  # As per the BSD manual page, set if this is a directory, or if
105
117
  # any execute bit is set on the original (unmodified) mode.
106
118
  # Ignored otherwise; it is "add if", not "add or clear".
107
- if is_a_directory or original_mode['any x?'] then
119
+ if is_a_directory or original_mode['any x?']
108
120
  value = actions[action].call(value, ExecBit)
109
121
  end
110
122
 
111
- when /[st]/ then
123
+ when /[st]/
112
124
  bit = SymbolicSpecialToBit[op][who] or fail _("internal error")
113
125
  final_mode['s'] = actions[action].call(final_mode['s'], bit)
114
126
 
@@ -122,7 +134,7 @@ module SymbolicFileMode
122
134
  end
123
135
 
124
136
  rescue Puppet::Error => e
125
- if part.inspect != modification.inspect then
137
+ if part.inspect != modification.inspect
126
138
  rest = " at #{part.inspect}"
127
139
  else
128
140
  rest = ''
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'puppet/util/tag_set'
2
3
 
3
4
  module Puppet::Util::Tagging
@@ -13,11 +13,6 @@ module Puppet::Util::Windows
13
13
 
14
14
  FILE = Puppet::Util::Windows::File
15
15
 
16
- # integer value of the floor for timeouts when waiting for service pending states.
17
- # puppet will wait the length of dwWaitHint if it is longer than this value, but
18
- # no shorter
19
- DEFAULT_TIMEOUT = 30
20
-
21
16
  # Service error codes
22
17
  # https://docs.microsoft.com/en-us/windows/desktop/debug/system-error-codes--1000-1299-
23
18
  ERROR_SERVICE_DOES_NOT_EXIST = 0x00000424
@@ -75,7 +75,9 @@ module Puppet::Util::Windows
75
75
  raw_sid_bytes = sid_ptr.read_array_of_uchar(get_length_sid(sid_ptr))
76
76
  end
77
77
  rescue => e
78
- Puppet.debug("Could not retrieve raw SID bytes from '#{name}': #{e.message}")
78
+ # Avoid debug logs pollution with valid account names
79
+ # https://docs.microsoft.com/en-us/windows/win32/api/sddl/nf-sddl-convertstringsidtosidw#return-value
80
+ Puppet.debug("Could not retrieve raw SID bytes from '#{name}': #{e.message}") unless e.code == ERROR_INVALID_SID_STRUCTURE
79
81
  end
80
82
 
81
83
  raw_sid_bytes ? Principal.lookup_account_sid(raw_sid_bytes) : Principal.lookup_account_name(name)
@@ -1,6 +1,4 @@
1
1
  require 'puppet/util/windows'
2
-
3
- require 'facter'
4
2
  require 'ffi'
5
3
 
6
4
  module Puppet::Util::Windows::User
@@ -9,6 +9,9 @@ module Puppet::Util::Windows
9
9
  module File; end
10
10
  module Registry
11
11
  end
12
+ module Service
13
+ DEFAULT_TIMEOUT = 30
14
+ end
12
15
  module SID
13
16
  class Principal; end
14
17
  end
data/lib/puppet/util.rb CHANGED
@@ -763,12 +763,13 @@ module Util
763
763
  # Executes a block of code, wrapped around Facter.load_external(false) and
764
764
  # Facter.load_external(true) which will cause Facter to not evaluate external facts.
765
765
  def skip_external_facts
766
- return yield unless Facter.respond_to? :load_external
766
+ return yield unless Puppet.runtime[:facter].load_external?
767
+
767
768
  begin
768
- Facter.load_external(false)
769
+ Puppet.runtime[:facter].load_external(false)
769
770
  yield
770
771
  ensure
771
- Facter.load_external(true)
772
+ Puppet.runtime[:facter].load_external(true)
772
773
  end
773
774
  end
774
775
  module_function :skip_external_facts
@@ -6,7 +6,7 @@
6
6
  # Raketasks and such to set the version based on the output of `git describe`
7
7
 
8
8
  module Puppet
9
- PUPPETVERSION = '6.22.1'
9
+ PUPPETVERSION = '6.25.1'
10
10
 
11
11
  ##
12
12
  # version is a public API method intended to always provide a fast and
data/lib/puppet.rb CHANGED
@@ -12,7 +12,6 @@ $LOAD_PATH.extend(Puppet::Concurrent::Synchronized)
12
12
  # see the bottom of the file for further inclusions
13
13
  # Also see the new Vendor support - towards the end
14
14
  #
15
- require 'facter'
16
15
  require 'puppet/error'
17
16
  require 'puppet/util'
18
17
  require 'puppet/util/autoload'
@@ -88,9 +87,6 @@ module Puppet
88
87
  require 'puppet/util/logging'
89
88
  extend Puppet::Util::Logging
90
89
 
91
- # Setup facter's logging
92
- Puppet::Util::Logging.setup_facter_logging!
93
-
94
90
  # The feature collection
95
91
  @features = Puppet::Util::Feature.new('puppet/feature')
96
92
 
@@ -199,15 +195,15 @@ module Puppet
199
195
  def self.initialize_facts
200
196
  # Add the puppetversion fact; this is done before generating the hash so it is
201
197
  # accessible to custom facts.
202
- Facter.add(:puppetversion) do
198
+ Puppet.runtime[:facter].add(:puppetversion) do
203
199
  setcode { Puppet.version.to_s }
204
200
  end
205
201
 
206
- Facter.add(:agent_specified_environment) do
202
+ Puppet.runtime[:facter].add(:agent_specified_environment) do
207
203
  setcode do
208
- if Puppet.settings.set_by_config?(:environment)
209
- Puppet[:environment]
210
- end
204
+ Puppet.settings.set_by_cli(:environment) ||
205
+ Puppet.settings.set_in_section(:environment, :agent) ||
206
+ Puppet.settings.set_in_section(:environment, :main)
211
207
  end
212
208
  end
213
209
  end