openvox 9.0.0.pre.alpha2 → 9.0.0.pre.beta2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (278) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +114 -1
  3. data/CODE_OF_CONDUCT.md +1 -1
  4. data/Gemfile +5 -5
  5. data/README.md +6 -6
  6. data/Rakefile +3 -3
  7. data/conf/environment.conf +2 -2
  8. data/conf/fileserver.conf +3 -3
  9. data/conf/puppet.conf +4 -4
  10. data/examples/enc/regexp_nodes/regexp_nodes.rb +2 -2
  11. data/examples/hiera/README.md +1 -1
  12. data/examples/nagios/check_puppet.rb +1 -1
  13. data/ext/README.md +3 -3
  14. data/ext/hiera/hiera.yaml +1 -1
  15. data/ext/project_data.yaml +1 -1
  16. data/ext/redhat/client.sysconfig +1 -0
  17. data/ext/solaris/smf/puppet.xml +2 -2
  18. data/ext/windows/puppet_interactive.bat +1 -1
  19. data/ext/windows/service/daemon.rb +5 -5
  20. data/lib/hiera/puppet_function.rb +1 -2
  21. data/lib/hiera_puppet.rb +1 -1
  22. data/lib/puppet/agent/disabler.rb +3 -3
  23. data/lib/puppet/agent/locker.rb +1 -1
  24. data/lib/puppet/agent.rb +2 -2
  25. data/lib/puppet/application/agent.rb +33 -35
  26. data/lib/puppet/application/apply.rb +7 -7
  27. data/lib/puppet/application/describe.rb +3 -3
  28. data/lib/puppet/application/device.rb +1 -1
  29. data/lib/puppet/application/doc.rb +5 -7
  30. data/lib/puppet/application/facts.rb +1 -1
  31. data/lib/puppet/application/filebucket.rb +5 -5
  32. data/lib/puppet/application/lookup.rb +8 -8
  33. data/lib/puppet/application/resource.rb +5 -5
  34. data/lib/puppet/application/script.rb +3 -3
  35. data/lib/puppet/application/ssl.rb +4 -4
  36. data/lib/puppet/application_support.rb +2 -2
  37. data/lib/puppet/configurer.rb +13 -7
  38. data/lib/puppet/confine/variable.rb +2 -2
  39. data/lib/puppet/context.rb +1 -1
  40. data/lib/puppet/data_binding.rb +1 -1
  41. data/lib/puppet/defaults.rb +157 -226
  42. data/lib/puppet/error.rb +1 -1
  43. data/lib/puppet/etc.rb +4 -4
  44. data/lib/puppet/face/catalog/select.rb +3 -3
  45. data/lib/puppet/face/catalog.rb +4 -4
  46. data/lib/puppet/face/config.rb +6 -6
  47. data/lib/puppet/face/facts.rb +6 -6
  48. data/lib/puppet/face/help/man.erb +3 -3
  49. data/lib/puppet/face/node/clean.rb +3 -3
  50. data/lib/puppet/face/node.rb +2 -2
  51. data/lib/puppet/face/plugin.rb +4 -4
  52. data/lib/puppet/functions/all.rb +4 -4
  53. data/lib/puppet/functions/any.rb +4 -4
  54. data/lib/puppet/functions/assert_type.rb +5 -5
  55. data/lib/puppet/functions/defined.rb +1 -1
  56. data/lib/puppet/functions/each.rb +11 -11
  57. data/lib/puppet/functions/epp.rb +5 -5
  58. data/lib/puppet/functions/eyaml_lookup_key.rb +1 -1
  59. data/lib/puppet/functions/filter.rb +5 -5
  60. data/lib/puppet/functions/find_file.rb +1 -1
  61. data/lib/puppet/functions/hiera.rb +4 -4
  62. data/lib/puppet/functions/hiera_array.rb +5 -5
  63. data/lib/puppet/functions/hiera_hash.rb +5 -5
  64. data/lib/puppet/functions/hiera_include.rb +6 -6
  65. data/lib/puppet/functions/hocon_data.rb +1 -1
  66. data/lib/puppet/functions/include.rb +1 -1
  67. data/lib/puppet/functions/index.rb +3 -3
  68. data/lib/puppet/functions/inline_epp.rb +6 -6
  69. data/lib/puppet/functions/json_data.rb +1 -1
  70. data/lib/puppet/functions/lest.rb +1 -1
  71. data/lib/puppet/functions/lookup.rb +14 -14
  72. data/lib/puppet/functions/map.rb +5 -5
  73. data/lib/puppet/functions/reduce.rb +6 -6
  74. data/lib/puppet/functions/regsubst.rb +1 -13
  75. data/lib/puppet/functions/reverse_each.rb +5 -5
  76. data/lib/puppet/functions/scanf.rb +1 -1
  77. data/lib/puppet/functions/step.rb +5 -5
  78. data/lib/puppet/functions/then.rb +1 -1
  79. data/lib/puppet/functions/tree_each.rb +3 -3
  80. data/lib/puppet/functions/versioncmp.rb +1 -1
  81. data/lib/puppet/functions/with.rb +2 -2
  82. data/lib/puppet/functions/yaml_data.rb +1 -1
  83. data/lib/puppet/generate/type.rb +5 -1
  84. data/lib/puppet/gettext/config.rb +5 -5
  85. data/lib/puppet/gettext/module_translations.rb +1 -1
  86. data/lib/puppet/graph/simple_graph.rb +0 -1
  87. data/lib/puppet/http/client.rb +5 -5
  88. data/lib/puppet/http/factory.rb +1 -1
  89. data/lib/puppet/http/resolver/server_list.rb +2 -2
  90. data/lib/puppet/http/service/compiler.rb +3 -3
  91. data/lib/puppet/http/service/file_server.rb +1 -1
  92. data/lib/puppet/http/service.rb +19 -1
  93. data/lib/puppet/http/session.rb +1 -1
  94. data/lib/puppet/http.rb +1 -1
  95. data/lib/puppet/indirector/catalog/compiler.rb +2 -2
  96. data/lib/puppet/indirector/data_binding/hiera.rb +93 -2
  97. data/lib/puppet/indirector/face.rb +4 -4
  98. data/lib/puppet/indirector/facts/facter.rb +7 -7
  99. data/lib/puppet/indirector/file_bucket_file/file.rb +2 -2
  100. data/lib/puppet/indirector/file_bucket_file/rest.rb +7 -3
  101. data/lib/puppet/indirector/file_content/file_server.rb +1 -1
  102. data/lib/puppet/indirector/file_metadata/file_server.rb +1 -1
  103. data/lib/puppet/indirector/node/exec.rb +1 -1
  104. data/lib/puppet/indirector/node/rest.rb +1 -1
  105. data/lib/puppet/indirector/report/processor.rb +1 -1
  106. data/lib/puppet/indirector.rb +1 -1
  107. data/lib/puppet/interface/documentation.rb +1 -1
  108. data/lib/puppet/interface/face_collection.rb +1 -1
  109. data/lib/puppet/interface/option.rb +2 -2
  110. data/lib/puppet/module/task.rb +1 -1
  111. data/lib/puppet/module_tool/applications/application.rb +1 -1
  112. data/lib/puppet/module_tool/metadata.rb +1 -2
  113. data/lib/puppet/module_tool.rb +1 -1
  114. data/lib/puppet/network/authorization.rb +1 -1
  115. data/lib/puppet/network/http/api.rb +2 -2
  116. data/lib/puppet/network/http/connection.rb +2 -2
  117. data/lib/puppet/node/environment.rb +6 -6
  118. data/lib/puppet/node.rb +2 -2
  119. data/lib/puppet/pal/catalog_compiler.rb +1 -1
  120. data/lib/puppet/pal/pal_impl.rb +1 -25
  121. data/lib/puppet/parser/compiler.rb +1 -1
  122. data/lib/puppet/parser/functions/assert_type.rb +5 -5
  123. data/lib/puppet/parser/functions/create_resources.rb +1 -1
  124. data/lib/puppet/parser/functions/defined.rb +1 -1
  125. data/lib/puppet/parser/functions/digest.rb +1 -1
  126. data/lib/puppet/parser/functions/each.rb +11 -11
  127. data/lib/puppet/parser/functions/epp.rb +5 -5
  128. data/lib/puppet/parser/functions/filter.rb +5 -5
  129. data/lib/puppet/parser/functions/generate.rb +1 -1
  130. data/lib/puppet/parser/functions/hiera.rb +3 -3
  131. data/lib/puppet/parser/functions/hiera_array.rb +4 -4
  132. data/lib/puppet/parser/functions/hiera_hash.rb +4 -4
  133. data/lib/puppet/parser/functions/hiera_include.rb +5 -5
  134. data/lib/puppet/parser/functions/include.rb +1 -1
  135. data/lib/puppet/parser/functions/inline_epp.rb +6 -6
  136. data/lib/puppet/parser/functions/inline_template.rb +1 -1
  137. data/lib/puppet/parser/functions/lest.rb +1 -1
  138. data/lib/puppet/parser/functions/lookup.rb +14 -14
  139. data/lib/puppet/parser/functions/map.rb +5 -5
  140. data/lib/puppet/parser/functions/reduce.rb +7 -7
  141. data/lib/puppet/parser/functions/reverse_each.rb +5 -5
  142. data/lib/puppet/parser/functions/scanf.rb +1 -1
  143. data/lib/puppet/parser/functions/step.rb +5 -5
  144. data/lib/puppet/parser/functions/then.rb +1 -1
  145. data/lib/puppet/parser/functions/versioncmp.rb +1 -1
  146. data/lib/puppet/parser/functions/with.rb +1 -1
  147. data/lib/puppet/parser/functions.rb +3 -3
  148. data/lib/puppet/parser/scope.rb +1 -1
  149. data/lib/puppet/plugins/syntax_checkers.rb +2 -2
  150. data/lib/puppet/plugins.rb +1 -1
  151. data/lib/puppet/pops/evaluator/collectors/exported_collector.rb +1 -1
  152. data/lib/puppet/pops/evaluator/deferred_resolver.rb +4 -1
  153. data/lib/puppet/pops/issues.rb +3 -3
  154. data/lib/puppet/pops/loader/module_loaders.rb +4 -4
  155. data/lib/puppet/pops/loader/ruby_legacy_function_instantiator.rb +1 -1
  156. data/lib/puppet/pops/loaders.rb +4 -4
  157. data/lib/puppet/pops/lookup/lookup_adapter.rb +7 -66
  158. data/lib/puppet/pops/model/factory.rb +5 -5
  159. data/lib/puppet/pops/resource/resource_type_impl.rb +1 -1
  160. data/lib/puppet/pops/serialization/to_data_converter.rb +1 -1
  161. data/lib/puppet/pops/types/iterable.rb +1 -1
  162. data/lib/puppet/property/keyvalue.rb +3 -3
  163. data/lib/puppet/provider/group/aix.rb +2 -2
  164. data/lib/puppet/provider/nameservice/directoryservice.rb +2 -2
  165. data/lib/puppet/provider/package/aix.rb +1 -1
  166. data/lib/puppet/provider/package/apt.rb +2 -2
  167. data/lib/puppet/provider/package/aptitude.rb +0 -1
  168. data/lib/puppet/provider/package/dnfmodule.rb +1 -1
  169. data/lib/puppet/provider/package/nim.rb +1 -1
  170. data/lib/puppet/provider/package/pacman.rb +1 -2
  171. data/lib/puppet/provider/package/pip.rb +1 -1
  172. data/lib/puppet/provider/package/pip2.rb +1 -1
  173. data/lib/puppet/provider/package/pip3.rb +1 -1
  174. data/lib/puppet/provider/package/pkgdmg.rb +2 -2
  175. data/lib/puppet/provider/package/puppet_gem.rb +2 -2
  176. data/lib/puppet/provider/package/puppetserver_gem.rb +1 -1
  177. data/lib/puppet/provider/package/windows.rb +1 -1
  178. data/lib/puppet/provider/service/freebsd.rb +1 -1
  179. data/lib/puppet/provider/service/init.rb +5 -5
  180. data/lib/puppet/provider/service/launchd.rb +2 -2
  181. data/lib/puppet/provider/service/smf.rb +1 -1
  182. data/lib/puppet/provider/service/upstart.rb +2 -2
  183. data/lib/puppet/provider/user/aix.rb +3 -3
  184. data/lib/puppet/provider/user/directoryservice.rb +9 -9
  185. data/lib/puppet/provider/user/pw.rb +3 -3
  186. data/lib/puppet/provider.rb +1 -1
  187. data/lib/puppet/reference/configuration.rb +6 -13
  188. data/lib/puppet/reference/function.rb +4 -4
  189. data/lib/puppet/reference/indirection.rb +2 -2
  190. data/lib/puppet/reference/metaparameter.rb +3 -3
  191. data/lib/puppet/reference/providers.rb +3 -3
  192. data/lib/puppet/reference/report.rb +4 -4
  193. data/lib/puppet/reference/type.rb +2 -2
  194. data/lib/puppet/relationship.rb +1 -1
  195. data/lib/puppet/reports/http.rb +4 -4
  196. data/lib/puppet/reports.rb +1 -1
  197. data/lib/puppet/resource/catalog.rb +4 -4
  198. data/lib/puppet/resource/type.rb +8 -8
  199. data/lib/puppet/settings/base_setting.rb +2 -3
  200. data/lib/puppet/settings/config_file.rb +3 -3
  201. data/lib/puppet/settings/environment_conf.rb +3 -11
  202. data/lib/puppet/settings.rb +11 -51
  203. data/lib/puppet/ssl/certificate.rb +4 -0
  204. data/lib/puppet/ssl/certificate_request.rb +1 -1
  205. data/lib/puppet/ssl/oids.rb +1 -1
  206. data/lib/puppet/ssl/openssl_loader.rb +1 -1
  207. data/lib/puppet/ssl/ssl_provider.rb +5 -5
  208. data/lib/puppet/ssl/state_machine.rb +9 -3
  209. data/lib/puppet/syntax_checkers.rb +1 -1
  210. data/lib/puppet/transaction/report.rb +3 -3
  211. data/lib/puppet/transaction.rb +0 -1
  212. data/lib/puppet/type/exec.rb +20 -20
  213. data/lib/puppet/type/file/content.rb +10 -37
  214. data/lib/puppet/type/file/ensure.rb +18 -9
  215. data/lib/puppet/type/file/mode.rb +4 -4
  216. data/lib/puppet/type/file/selcontext.rb +2 -2
  217. data/lib/puppet/type/file/source.rb +19 -25
  218. data/lib/puppet/type/file.rb +22 -15
  219. data/lib/puppet/type/filebucket.rb +22 -8
  220. data/lib/puppet/type/group.rb +5 -5
  221. data/lib/puppet/type/notify.rb +1 -1
  222. data/lib/puppet/type/package.rb +4 -4
  223. data/lib/puppet/type/schedule.rb +11 -11
  224. data/lib/puppet/type/service.rb +8 -8
  225. data/lib/puppet/type/stage.rb +1 -1
  226. data/lib/puppet/type/user.rb +19 -21
  227. data/lib/puppet/type/whit.rb +2 -2
  228. data/lib/puppet/type.rb +27 -27
  229. data/lib/puppet/util/character_encoding.rb +3 -3
  230. data/lib/puppet/util/command_line.rb +1 -1
  231. data/lib/puppet/util/execution.rb +1 -1
  232. data/lib/puppet/util/filetype.rb +6 -6
  233. data/lib/puppet/util/log.rb +2 -2
  234. data/lib/puppet/util/logging.rb +3 -3
  235. data/lib/puppet/util/plist.rb +1 -1
  236. data/lib/puppet/util/profiler/around_profiler.rb +1 -1
  237. data/lib/puppet/util/profiler.rb +1 -1
  238. data/lib/puppet/util/rdoc.rb +6 -3
  239. data/lib/puppet/util/selinux.rb +5 -5
  240. data/lib/puppet/util/tag_set.rb +0 -1
  241. data/lib/puppet/util/windows/adsi.rb +1 -1
  242. data/lib/puppet/util/windows/com.rb +2 -2
  243. data/lib/puppet/util/windows/eventlog.rb +6 -6
  244. data/lib/puppet/util/windows/file.rb +2 -2
  245. data/lib/puppet/util/windows/security.rb +3 -3
  246. data/lib/puppet/util.rb +8 -3
  247. data/lib/puppet/version.rb +8 -8
  248. data/lib/puppet/x509/cert_provider.rb +1 -1
  249. data/lib/puppet.rb +5 -5
  250. data/locales/config.yaml +3 -3
  251. data/locales/puppet.pot +462 -464
  252. data/man/man5/puppet.conf.5 +122 -146
  253. data/man/man8/puppet-agent.8 +25 -25
  254. data/man/man8/puppet-apply.8 +6 -6
  255. data/man/man8/puppet-catalog.8 +11 -11
  256. data/man/man8/puppet-config.8 +7 -7
  257. data/man/man8/puppet-describe.8 +3 -3
  258. data/man/man8/puppet-device.8 +2 -2
  259. data/man/man8/puppet-doc.8 +5 -5
  260. data/man/man8/puppet-epp.8 +3 -3
  261. data/man/man8/puppet-facts.8 +11 -11
  262. data/man/man8/puppet-filebucket.8 +5 -5
  263. data/man/man8/puppet-generate.8 +3 -3
  264. data/man/man8/puppet-help.8 +3 -3
  265. data/man/man8/puppet-lookup.8 +8 -8
  266. data/man/man8/puppet-module.8 +7 -7
  267. data/man/man8/puppet-node.8 +11 -45
  268. data/man/man8/puppet-parser.8 +3 -3
  269. data/man/man8/puppet-plugin.8 +7 -7
  270. data/man/man8/puppet-report.8 +6 -6
  271. data/man/man8/puppet-resource.8 +5 -5
  272. data/man/man8/puppet-script.8 +3 -3
  273. data/man/man8/puppet-ssl.8 +21 -23
  274. data/man/man8/puppet.8 +2 -2
  275. metadata +5 -8
  276. data/lib/puppet/indirector/hiera.rb +0 -101
  277. data/lib/puppet/util/rdoc/generators/puppet_generator.rb +0 -902
  278. data/lib/puppet/util/rdoc/generators/template/puppet/puppet.rb +0 -1068
@@ -54,7 +54,7 @@ class Puppet::Settings
54
54
 
55
55
  NONE = 'none'
56
56
 
57
- # This method is intended for puppet internal use only; it is a convenience method that
57
+ # This method is intended for OpenVox internal use only; it is a convenience method that
58
58
  # returns reasonable application default settings values for a given run_mode.
59
59
  def self.app_defaults_for_run_mode(run_mode)
60
60
  {
@@ -321,10 +321,10 @@ class Puppet::Settings
321
321
  def initialize_global_settings(args = [], require_config = true)
322
322
  raise Puppet::DevError, _("Attempting to initialize global default settings more than once!") if global_defaults_initialized?
323
323
 
324
- # The first two phases of the lifecycle of a puppet application are:
324
+ # The first two phases of the lifecycle of an OpenVox application are:
325
325
  # 1) Parse the command line options and handle any of them that are
326
- # registered, defined "global" puppet settings (mostly from defaults.rb).
327
- # 2) Parse the puppet config file(s).
326
+ # registered, defined "global" OpenVox settings (mostly from defaults.rb).
327
+ # 2) Parse the OpenVox config file(s).
328
328
 
329
329
  parse_global_options(args)
330
330
  parse_config_files(require_config)
@@ -335,7 +335,7 @@ class Puppet::Settings
335
335
  # This method is called during application bootstrapping. It is responsible for parsing all of the
336
336
  # command line options and initializing the settings accordingly.
337
337
  #
338
- # It will ignore options that are not defined in the global puppet settings list, because they may
338
+ # It will ignore options that are not defined in the global OpenVox settings list, because they may
339
339
  # be valid options for the specific application that we are about to launch... however, at this point
340
340
  # in the bootstrapping lifecycle, we don't yet know what that application is.
341
341
  def parse_global_options(args)
@@ -512,45 +512,6 @@ class Puppet::Settings
512
512
  @config.include?(name)
513
513
  end
514
514
 
515
- # Prints the contents of a config file with the available config settings, or it
516
- # prints a single value of a config setting.
517
- def print_config_options
518
- if Puppet::Util::Log.sendlevel?(:info)
519
- Puppet::Util::Log.newdestination(:console)
520
- message = _("Using --configprint is deprecated. Use 'puppet config <subcommand>' instead.")
521
- Puppet.deprecation_warning(message)
522
- end
523
-
524
- env = value(:environment)
525
- val = value(:configprint)
526
- if val == "all"
527
- hash = {}
528
- each do |name, _obj|
529
- val = value(name, env)
530
- val = val.inspect if val == ""
531
- hash[name] = val
532
- end
533
- hash.sort { |a, b| a[0].to_s <=> b[0].to_s }.each do |name, v|
534
- puts "#{name} = #{v}"
535
- end
536
- else
537
- val.split(/\s*,\s*/).sort.each do |v|
538
- if include?(v)
539
- # if there is only one value, just print it for back compatibility
540
- if v == val
541
- puts value(val, env)
542
- break
543
- end
544
- puts "#{v} = #{value(v, env)}"
545
- else
546
- puts "invalid setting: #{v}"
547
- return false
548
- end
549
- end
550
- end
551
- true
552
- end
553
-
554
515
  def generate_config
555
516
  puts to_config
556
517
  true
@@ -562,14 +523,13 @@ class Puppet::Settings
562
523
  end
563
524
 
564
525
  def print_configs
565
- return print_config_options if value(:configprint) != ""
566
526
  return generate_config if value(:genconfig)
567
527
 
568
528
  generate_manifest if value(:genmanifest)
569
529
  end
570
530
 
571
531
  def print_configs?
572
- (value(:configprint) != "" || value(:genconfig) || value(:genmanifest)) && true
532
+ (value(:genconfig) || value(:genmanifest)) && true
573
533
  end
574
534
 
575
535
  # The currently configured run mode that is preferred for constructing the application configuration.
@@ -846,7 +806,7 @@ class Puppet::Settings
846
806
  # The order in which to search for values, without defaults.
847
807
  #
848
808
  # @param environment [String,Symbol] symbolic reference to an environment name
849
- # @param run_mode [Symbol] symbolic reference to a Puppet run mode
809
+ # @param run_mode [Symbol] symbolic reference to an OpenVox run mode
850
810
  # @return [Array<SearchPathElement>]
851
811
  # @api private
852
812
  def configsearchpath(environment = nil, run_mode = preferred_run_mode)
@@ -871,7 +831,7 @@ class Puppet::Settings
871
831
  # The order in which to search for values.
872
832
  #
873
833
  # @param environment [String,Symbol] symbolic reference to an environment name
874
- # @param run_mode [Symbol] symbolic reference to a Puppet run mode
834
+ # @param run_mode [Symbol] symbolic reference to an OpenVox run mode
875
835
  # @return [Array<SearchPathElement>]
876
836
  # @api private
877
837
  def searchpath(environment = nil, run_mode = preferred_run_mode)
@@ -1008,9 +968,9 @@ class Puppet::Settings
1008
968
  # you do not specify it, it will default to "string". Legal values include:
1009
969
  # :string - A generic string setting
1010
970
  # :boolean - A boolean setting; values are expected to be "true" or "false"
1011
- # :file - A (single) file path; puppet may attempt to create this file depending on how the settings are used. This type
971
+ # :file - A (single) file path; OpenVox may attempt to create this file depending on how the settings are used. This type
1012
972
  # also supports additional options such as "mode", "owner", "group"
1013
- # :directory - A (single) directory path; puppet may attempt to create this file depending on how the settings are used. This type
973
+ # :directory - A (single) directory path; OpenVox may attempt to create this file depending on how the settings are used. This type
1014
974
  # also supports additional options such as "mode", "owner", "group"
1015
975
  # :path - This is intended to be used for settings whose value can contain multiple directory paths, represented
1016
976
  # as strings separated by the system path separator (e.g. system path, module path, etc.).
@@ -1530,7 +1490,7 @@ Generated on #{Time.now}.
1530
1490
  interpolated_expression
1531
1491
  end
1532
1492
  if failed_environment_interpolation
1533
- # TRANSLATORS '$environment' is a Puppet specific variable and should not be translated
1493
+ # TRANSLATORS '$environment' is an OpenVox specific variable and should not be translated
1534
1494
  Puppet.warning(_("You cannot interpolate $environment within '%{setting_name}' when using directory environments.") % { setting_name: setting_name } +
1535
1495
  ' ' + _("Its value will remain %{value}.") % { value: interpolated_value })
1536
1496
  end
@@ -9,6 +9,10 @@ require_relative '../../puppet/ssl/base'
9
9
  # the case).
10
10
  #
11
11
  # @deprecated Use {Puppet::SSL::SSLProvider} instead.
12
+ # This class and its associated helpers are still
13
+ # necessary as they enable FIPS-mode OpenVox Server
14
+ # to populate trusted data when `require 'openssl'`
15
+ # is not available.
12
16
  class Puppet::SSL::Certificate < Puppet::SSL::Base
13
17
  # This is defined from the base class
14
18
  wraps OpenSSL::X509::Certificate
@@ -202,7 +202,7 @@ class Puppet::SSL::CertificateRequest < Puppet::SSL::Base
202
202
 
203
203
  private
204
204
 
205
- # Exclude OIDs that may conflict with how Puppet creates CSRs.
205
+ # Exclude OIDs that may conflict with how OpenVox creates CSRs.
206
206
  #
207
207
  # We only have nominal support for Microsoft extension requests, but since we
208
208
  # ultimately respect that field when looking for extension requests in a CSR
@@ -2,7 +2,7 @@
2
2
 
3
3
  require_relative '../../puppet/ssl'
4
4
 
5
- # This module defines OIDs for use within Puppet.
5
+ # This module defines OIDs for use within OpenVox.
6
6
  #
7
7
  # # ASN.1 Definition
8
8
  #
@@ -4,7 +4,7 @@ require_relative '../../puppet/util/platform'
4
4
 
5
5
  # This file should be required instead of writing `require 'openssl'`
6
6
  # or any library that loads openssl like `net/https`. This allows the
7
- # core Puppet code to load correctly in JRuby environments that do not
7
+ # core OpenVox code to load correctly in JRuby environments that do not
8
8
  # have a functioning openssl (eg a FIPS enabled one).
9
9
 
10
10
  if Puppet::Util::Platform.jruby_fips?
@@ -18,7 +18,7 @@ require_relative '../../puppet/ssl'
18
18
  # cert = <OpenSSL::X509::Certificate>
19
19
  # ssl_context = provider.create_context(cacerts: cacerts, crls: crls, private_key: key, client_cert: cert)
20
20
  #
21
- # @example To create an SSLContext to connect to non-puppet HTTPS servers:
21
+ # @example To create an SSLContext to connect to non-OpenVox HTTPS servers:
22
22
  # cacerts = [<OpenSSL::X509::Certificate>]
23
23
  # ssl_context = provider.create_root_context(cacerts: cacerts)
24
24
  #
@@ -56,9 +56,9 @@ class Puppet::SSL::SSLProvider
56
56
  end
57
57
 
58
58
  # Create an `SSLContext` using the trusted `cacerts` and any certs in OpenSSL's
59
- # default verify path locations. When running puppet as a gem, the location is
60
- # system dependent. When running puppet from puppet-agent packages, the location
61
- # refers to the cacerts bundle in the puppet-agent package.
59
+ # default verify path locations. When running OpenVox as a gem, the location is
60
+ # system dependent. When running OpenVox from openvox-agent packages, the location
61
+ # refers to the cacerts bundle in the openvox-agent package.
62
62
  #
63
63
  # Connections made from the returned context will authenticate the server,
64
64
  # i.e. `VERIFY_PEER`, but will not use a client certificate (unless requested)
@@ -296,7 +296,7 @@ class Puppet::SSL::SSLProvider
296
296
 
297
297
  def verify_cert_with_store(store, cert)
298
298
  # StoreContext#initialize accepts a chain argument, but it's set to [] because
299
- # puppet requires any intermediate CA certs needed to complete the client's
299
+ # OpenVox requires any intermediate CA certs needed to complete the client's
300
300
  # chain to be in the CA bundle that we downloaded from the server, and
301
301
  # they've already been added to the store. See PUP-9500.
302
302
 
@@ -121,6 +121,10 @@ class Puppet::SSL::StateMachine
121
121
  rescue Puppet::HTTP::ResponseError => e
122
122
  if e.response.code == 304
123
123
  Puppet.info(_("CA certificate is unmodified, using existing CA certificate"))
124
+ # 304 confirms the local CA is current, so reset the TTL.
125
+ # Otherwise ca_last_update (backed by ca.pem mtime) never advances
126
+ # past the initial download and needs_refresh? triggers on every run.
127
+ @cert_provider.ca_last_update = Time.now
124
128
  else
125
129
  Puppet.info(_("Failed to refresh CA certificate, using existing CA certificate: %{message}") % { message: e.message })
126
130
  end
@@ -219,6 +223,8 @@ class Puppet::SSL::StateMachine
219
223
  rescue Puppet::HTTP::ResponseError => e
220
224
  if e.response.code == 304
221
225
  Puppet.info(_("CRL is unmodified, using existing CRL"))
226
+ # 304 confirms the local CRL is current, so reset the TTL.
227
+ @cert_provider.crl_last_update = Time.now
222
228
  else
223
229
  Puppet.info(_("Failed to refresh CRL, using existing CRL: %{message}") % { message: e.message })
224
230
  end
@@ -438,11 +444,11 @@ class Puppet::SSL::StateMachine
438
444
  # sleeping, start over from the top
439
445
  NeedCACerts.new(@machine)
440
446
  elsif @machine.waitforlock < 1
441
- LockFailure.new(@machine, _("Another puppet instance is already running and the waitforlock setting is set to 0; exiting"))
447
+ LockFailure.new(@machine, _("Another OpenVox instance is already running and the waitforlock setting is set to 0; exiting"))
442
448
  elsif Time.now.to_i >= @machine.waitlock_deadline
443
- LockFailure.new(@machine, _("Another puppet instance is already running and the maxwaitforlock timeout has been exceeded; exiting"))
449
+ LockFailure.new(@machine, _("Another OpenVox instance is already running and the maxwaitforlock timeout has been exceeded; exiting"))
444
450
  else
445
- Puppet.info _("Another puppet instance is already running; waiting for it to finish")
451
+ Puppet.info _("Another OpenVox instance is already running; waiting for it to finish")
446
452
  Puppet.info _("Will try again in %{time} seconds.") % { time: @machine.waitforlock }
447
453
  Kernel.sleep @machine.waitforlock
448
454
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # A name space for syntax checkers provided by Puppet.
3
+ # A name space for syntax checkers provided by OpenVox.
4
4
  module Puppet::SyntaxCheckers
5
5
  end
@@ -58,7 +58,7 @@ class Puppet::Transaction::Report
58
58
  # The id of the job responsible for this run.
59
59
  attr_accessor :job_id
60
60
 
61
- # A master generated catalog uuid, useful for connecting a single catalog to multiple reports.
61
+ # A server generated catalog uuid, useful for connecting a single catalog to multiple reports.
62
62
  attr_accessor :catalog_uuid
63
63
 
64
64
  # Whether a cached catalog was used in the run, and if so, the reason that it was used.
@@ -111,13 +111,13 @@ class Puppet::Transaction::Report
111
111
  #
112
112
  attr_reader :status
113
113
 
114
- # @return [String] The Puppet version in String form.
114
+ # @return [String] The OpenVox version in String form.
115
115
  # @see Puppet::version()
116
116
  #
117
117
  attr_reader :puppet_version
118
118
 
119
119
  # @return [Integer] report format version number. This value is constant for
120
- # a given version of Puppet; it is incremented when a new release of Puppet
120
+ # a given version of OpenVox; it is incremented when a new release of OpenVox
121
121
  # changes the API for the various objects that make up a report.
122
122
  #
123
123
  attr_reader :report_format
@@ -5,7 +5,6 @@ require_relative '../puppet/util/tagging'
5
5
  require_relative '../puppet/util/skip_tags'
6
6
  require_relative '../puppet/application'
7
7
  require 'digest/sha1'
8
- require 'set'
9
8
 
10
9
  # the class that actually walks our resource/property tree, collects the changes,
11
10
  # and performs them
@@ -13,11 +13,11 @@ module Puppet
13
13
 
14
14
  * The command itself is already idempotent. (For example, `apt-get update`.)
15
15
  * The exec has an `onlyif`, `unless`, or `creates` attribute, which prevents
16
- Puppet from running the command unless some condition is met. The
16
+ OpenVox from running the command unless some condition is met. The
17
17
  `onlyif` and `unless` commands of an `exec` are used in the process of
18
18
  determining whether the `exec` is already in sync, therefore they must be run
19
- during a noop Puppet run.
20
- * The exec has `refreshonly => true`, which allows Puppet to run the
19
+ during a noop OpenVox run.
20
+ * The exec has `refreshonly => true`, which allows OpenVox to run the
21
21
  command only when some other resource is changed. (See the notes on refreshing
22
22
  below.)
23
23
 
@@ -40,7 +40,7 @@ module Puppet
40
40
  consider developing a custom resource type instead, as it is much
41
41
  more predictable and maintainable.
42
42
 
43
- **Duplication:** Even though `command` is the namevar, Puppet allows
43
+ **Duplication:** Even though `command` is the namevar, OpenVox allows
44
44
  multiple `exec` resources with the same `command` value.
45
45
 
46
46
  **Refresh:** `exec` resources can respond to refresh events (via
@@ -65,9 +65,9 @@ module Puppet
65
65
  In short: If there's a possibility of your exec receiving refresh events,
66
66
  it is extremely important to make sure the run conditions are restricted.
67
67
 
68
- **Autorequires:** If Puppet is managing an exec's cwd or the executable
68
+ **Autorequires:** If OpenVox is managing an exec's cwd or the executable
69
69
  file used in an exec's command, the exec resource autorequires those
70
- files. If Puppet is managing the user that an exec should run as, the
70
+ files. If OpenVox is managing the user that an exec should run as, the
71
71
  exec resource autorequires that user."
72
72
 
73
73
  # Create a new check mechanism. It's basically a parameter that
@@ -109,13 +109,13 @@ module Puppet
109
109
  both the cmd.exe shell and the .NET runtime cast them to signed
110
110
  integers. This means some tools will report negative numbers for exit
111
111
  codes above 2147483647. (For example, cmd.exe reports 4294967295 as -1.)
112
- Since Puppet uses the plain Win32 APIs, it will report the very large
112
+ Since OpenVox uses the plain Win32 APIs, it will report the very large
113
113
  number instead of the negative number, which might not be what you
114
114
  expect if you got the exit code from a cmd.exe session.
115
115
 
116
116
  Microsoft recommends against using negative/very large exit codes, and
117
117
  you should avoid them when possible. To convert a negative exit code to
118
- the positive one Puppet will use, add it to 4294967296."
118
+ the positive one OpenVox will use, add it to 4294967296."
119
119
 
120
120
  # Make output a bit prettier
121
121
  def change_to_s(currentvalue, newvalue)
@@ -202,11 +202,11 @@ module Puppet
202
202
  (meaning its return code does not match the specified code) then
203
203
  any output is logged at the `err` log level.
204
204
 
205
- Multiple `exec` resources can use the same `command` value; Puppet
205
+ Multiple `exec` resources can use the same `command` value; OpenVox
206
206
  only uses the resource title to ensure `exec`s are unique.
207
207
 
208
208
  On *nix platforms, the command can be specified as an array of
209
- strings and Puppet will invoke it using the more secure method of
209
+ strings and OpenVox will invoke it using the more secure method of
210
210
  parameterized system calls. For example, rather than executing the
211
211
  malicious injected code, this command will echo it out:
212
212
 
@@ -236,10 +236,10 @@ module Puppet
236
236
  newparam(:user) do
237
237
  desc "The user to run the command as.
238
238
 
239
- > **Note:** Puppet cannot execute commands as other users on Windows.
239
+ > **Note:** OpenVox cannot execute commands as other users on Windows.
240
240
 
241
241
  Note that if you use this attribute, any error output is not captured
242
- due to a bug within Ruby. If you use Puppet to create this user, the
242
+ due to a bug within Ruby. If you use OpenVox to create this user, the
243
243
  exec automatically requires the user, as long as it is specified by
244
244
  name.
245
245
 
@@ -258,7 +258,7 @@ module Puppet
258
258
  newparam(:group) do
259
259
  desc "The group to run the command as. This seems to work quite
260
260
  haphazardly on different platforms -- it is a platform issue
261
- not a Ruby or Puppet one, since the same variety exists when
261
+ not a Ruby or OpenVox one, since the same variety exists when
262
262
  running commands as different users in the shell."
263
263
  # Validation is handled by the SUIDManager class.
264
264
  end
@@ -282,7 +282,7 @@ module Puppet
282
282
 
283
283
  newparam(:refresh) do
284
284
  desc "An alternate command to run when the `exec` receives a refresh event
285
- from another resource. By default, Puppet runs the main command again.
285
+ from another resource. By default, OpenVox runs the main command again.
286
286
  For more details, see the notes about refresh behavior above, in the
287
287
  description for this resource type.
288
288
 
@@ -422,7 +422,7 @@ module Puppet
422
422
  A file to look for before running the command. The command will
423
423
  only run if the file **doesn't exist.**
424
424
 
425
- This parameter doesn't cause Puppet to create a file; it is only
425
+ This parameter doesn't cause OpenVox to create a file; it is only
426
426
  useful if **the command itself** creates a file.
427
427
 
428
428
  exec { 'tar -xf /Volumes/nfs02/important.tar':
@@ -435,7 +435,7 @@ module Puppet
435
435
  `important.tar`. If it is ever deleted, the exec will bring it
436
436
  back by re-extracting the tarball. If `important.tar` does **not**
437
437
  actually contain `myfile`, the exec will keep running every time
438
- Puppet runs.
438
+ OpenVox runs.
439
439
 
440
440
  This parameter can also take an array of files, and the command will
441
441
  not run if **any** of these files exist. Consider this example:
@@ -459,7 +459,7 @@ module Puppet
459
459
  newcheck(:unless) do
460
460
  desc <<-'EOT'
461
461
  A test command that checks the state of the target system and restricts
462
- when the `exec` can run. If present, Puppet runs this test command
462
+ when the `exec` can run. If present, OpenVox runs this test command
463
463
  first, then runs the main command unless the test has an exit code of 0
464
464
  (success). For example:
465
465
 
@@ -476,7 +476,7 @@ module Puppet
476
476
  must fully qualify the command's name.
477
477
 
478
478
  Since this command is used in the process of determining whether the
479
- `exec` is already in sync, it must be run during a noop Puppet run.
479
+ `exec` is already in sync, it must be run during a noop OpenVox run.
480
480
 
481
481
  This parameter can also take an array of commands. For example:
482
482
 
@@ -522,7 +522,7 @@ module Puppet
522
522
  newcheck(:onlyif) do
523
523
  desc <<-'EOT'
524
524
  A test command that checks the state of the target system and restricts
525
- when the `exec` can run. If present, Puppet runs this test command
525
+ when the `exec` can run. If present, OpenVox runs this test command
526
526
  first, and only runs the main command if the test has an exit code of 0
527
527
  (success). For example:
528
528
 
@@ -539,7 +539,7 @@ module Puppet
539
539
  must fully qualify the command's name.
540
540
 
541
541
  Since this command is used in the process of determining whether the
542
- `exec` is already in sync, it must be run during a noop Puppet run.
542
+ `exec` is already in sync, it must be run during a noop OpenVox run.
543
543
 
544
544
  This parameter can also take an array of commands. For example:
545
545
 
@@ -37,8 +37,8 @@ module Puppet
37
37
  }
38
38
 
39
39
  ...but for larger files, this attribute is more useful when combined with the
40
- [template](https://puppet.com/docs/puppet/latest/function.html#template)
41
- or [file](https://puppet.com/docs/puppet/latest/function.html#file)
40
+ [template](https://docs.openvoxproject.org/openvox/latest/function.html#template)
41
+ or [file](https://docs.openvoxproject.org/openvox/latest/function.html#file)
42
42
  function.
43
43
  EOT
44
44
 
@@ -47,24 +47,14 @@ module Puppet
47
47
  munge do |value|
48
48
  if value == :absent
49
49
  value
50
- elsif value.is_a?(String) && checksum?(value)
51
- # XXX This is potentially dangerous because it means users can't write a file whose
52
- # entire contents are a plain checksum unless it is a Binary content.
53
- Puppet.puppet_deprecation_warning([
54
- # TRANSLATORS "content" is an attribute and should not be translated
55
- _('Using a checksum in a file\'s "content" property is deprecated.'),
56
- # TRANSLATORS "filebucket" is a resource type and should not be translated. The quoted occurrence of "content" is an attribute and should not be translated.
57
- _('The ability to use a checksum to retrieve content from the filebucket using the "content" property will be removed in a future release.'),
58
- # TRANSLATORS "content" is an attribute and should not be translated.
59
- _('The literal value of the "content" property will be written to the file.'),
60
- # TRANSLATORS "static catalogs" should not be translated.
61
- _('The checksum retrieval functionality is being replaced by the use of static catalogs.'),
62
- _('See https://puppet.com/docs/puppet/latest/static_catalogs.html for more information.')
63
- ].join(" "),
64
- :file => @resource.file,
65
- :line => @resource.line) if !@actual_content && !resource.parameter(:source)
50
+ elsif value.is_a?(String) && checksum?(value) && (@actual_content || resource.parameter(:source))
51
+ # The actual content is already known, either because it was
52
+ # previously set or because it comes from a source, and the value is
53
+ # its checksum.
66
54
  value
67
55
  else
56
+ # The value is the desired file content, even if it happens to look
57
+ # like a checksum.
68
58
  @actual_content = value.is_a?(Puppet::Pops::Types::PBinaryType::Binary) ? value.binary_buffer : value
69
59
  resource.parameter(:checksum).sum(@actual_content)
70
60
  end
@@ -150,31 +140,14 @@ module Puppet
150
140
 
151
141
  private
152
142
 
153
- # the content is munged so if it's a checksum source_or_content is nil
154
- # unless the checksum indirectly comes from source
143
+ # actual_content is only nil when the munged value is a checksum of
144
+ # content that comes from a source
155
145
  def each_chunk_from
156
146
  if actual_content.is_a?(String)
157
147
  yield actual_content
158
- elsif content_is_really_a_checksum? && actual_content.nil?
159
- yield read_file_from_filebucket
160
148
  elsif actual_content.nil?
161
149
  yield ''
162
150
  end
163
151
  end
164
-
165
- def content_is_really_a_checksum?
166
- checksum?(should)
167
- end
168
-
169
- def read_file_from_filebucket
170
- dipper = resource.bucket
171
- raise "Could not get filebucket from file" unless dipper
172
-
173
- sum = should.sub(/\{\w+\}/, '')
174
-
175
- dipper.getfile(sum)
176
- rescue => detail
177
- self.fail Puppet::Error, "Could not retrieve content for #{should} from filebucket: #{detail}", detail
178
- end
179
152
  end
180
153
  end
@@ -21,14 +21,14 @@ module Puppet
21
21
  * `link` ensures the file is a symlink, and **requires** that you also
22
22
  set the `target` attribute. Symlinks are supported on all Posix
23
23
  systems and on Windows Vista / 2008 and higher. On Windows, managing
24
- symlinks requires Puppet agent's user account to have the "Create
24
+ symlinks requires the OpenVox agent's user account to have the "Create
25
25
  Symbolic Links" privilege; this can be configured in the "User Rights
26
- Assignment" section in the Windows policy editor. By default, Puppet
26
+ Assignment" section in the Windows policy editor. By default, the OpenVox
27
27
  agent runs as the Administrator account, which has this privilege.
28
28
 
29
- Puppet avoids destroying directories unless the `force` attribute is set
29
+ OpenVox avoids destroying directories unless the `force` attribute is set
30
30
  to `true`. This means that if a file is currently a directory, setting
31
- `ensure` to anything but `directory` or `present` will cause Puppet to
31
+ `ensure` to anything but `directory` or `present` will cause OpenVox to
32
32
  skip managing the resource and log either a notice or an error.
33
33
 
34
34
  There is one other non-standard value for `ensure`. If you specify the
@@ -86,12 +86,21 @@ module Puppet
86
86
  raise Puppet::Error,
87
87
  "Cannot create #{@resource[:path]}; parent directory #{parent} does not exist"
88
88
  end
89
- if mode
90
- Puppet::Util.withumask(0o00) do
91
- Dir.mkdir(@resource[:path], symbolic_mode_to_int(mode, 0o755, true))
89
+ begin
90
+ if mode
91
+ Puppet::Util.withumask(0o00) do
92
+ Dir.mkdir(@resource[:path], symbolic_mode_to_int(mode, 0o755, true))
93
+ end
94
+ else
95
+ Dir.mkdir(@resource[:path])
92
96
  end
93
- else
94
- Dir.mkdir(@resource[:path])
97
+ rescue Errno::EEXIST
98
+ # Another process may have created the directory concurrently. If it
99
+ # really is a directory now, treat that as success.
100
+ #
101
+ # Directory mode, and other properties, will be checked and enforced by
102
+ # the call to `property_fix`.
103
+ raise unless Puppet::FileSystem.directory?(@resource[:path])
95
104
  end
96
105
  @resource.send(:property_fix)
97
106
  return :directory_created
@@ -14,7 +14,7 @@ module Puppet
14
14
  notation. This value **must** be specified as a string; do not use
15
15
  un-quoted numbers to represent file modes.
16
16
 
17
- If the mode is omitted (or explicitly set to `undef`), Puppet does not
17
+ If the mode is omitted (or explicitly set to `undef`), OpenVox does not
18
18
  enforce permissions on existing files and creates new files with
19
19
  permissions of `0644`.
20
20
 
@@ -22,7 +22,7 @@ module Puppet
22
22
  them to equivalent permissions for systems which represent permissions
23
23
  differently, including Windows. For detailed ACL controls on Windows,
24
24
  you can leave `mode` unmanaged and use
25
- [the puppetlabs/acl module.](https://forge.puppetlabs.com/puppetlabs/acl)
25
+ [the puppetlabs/acl module.](https://forge.puppet.com/puppetlabs/acl)
26
26
 
27
27
  Numeric modes should use the standard octal notation of
28
28
  `<SETUID/SETGID/STICKY><OWNER><GROUP><OTHER>` (for example, "0644").
@@ -32,10 +32,10 @@ module Puppet
32
32
  execute/search = 1.
33
33
  * The setuid/setgid/sticky digit is also a sum, where setuid = 4, setgid = 2,
34
34
  and sticky = 1.
35
- * The setuid/setgid/sticky digit is optional. If it is absent, Puppet will
35
+ * The setuid/setgid/sticky digit is optional. If it is absent, OpenVox will
36
36
  clear any existing setuid/setgid/sticky permissions. (So to make your intent
37
37
  clear, you should use at least four digits for numeric modes.)
38
- * When specifying numeric permissions for directories, Puppet sets the search
38
+ * When specifying numeric permissions for directories, OpenVox sets the search
39
39
  permission wherever the read permission is set.
40
40
 
41
41
  Symbolic modes should be represented as a string of comma-separated
@@ -86,10 +86,10 @@ module Puppet
86
86
  end
87
87
 
88
88
  Puppet::Type.type(:file).newparam(:selinux_ignore_defaults) do
89
- desc "If this is set, Puppet will not call the SELinux function selabel_lookup to
89
+ desc "If this is set, OpenVox will not call the SELinux function selabel_lookup to
90
90
  supply defaults for the SELinux attributes (seluser, selrole,
91
91
  seltype, and selrange). In general, you should leave this set at its
92
- default and only set it to true when you need Puppet to not try to fix
92
+ default and only set it to true when you need OpenVox to not try to fix
93
93
  SELinux labels automatically."
94
94
  newvalues(:true, :false)
95
95