puppet 7.10.0-x86-mingw32 → 7.11.0-x86-mingw32

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

Potentially problematic release.


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

Files changed (127) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +2 -2
  3. data/Gemfile.lock +9 -9
  4. data/lib/puppet/application/agent.rb +4 -0
  5. data/lib/puppet/application/apply.rb +20 -2
  6. data/lib/puppet/application/resource.rb +15 -13
  7. data/lib/puppet/concurrent/thread_local_singleton.rb +1 -0
  8. data/lib/puppet/configurer.rb +14 -4
  9. data/lib/puppet/confine/variable.rb +1 -1
  10. data/lib/puppet/defaults.rb +9 -3
  11. data/lib/puppet/facter_impl.rb +96 -0
  12. data/lib/puppet/file_serving/mount/file.rb +4 -4
  13. data/lib/puppet/file_system/file_impl.rb +3 -1
  14. data/lib/puppet/forge.rb +1 -1
  15. data/lib/puppet/indirector/catalog/compiler.rb +3 -3
  16. data/lib/puppet/indirector/facts/facter.rb +6 -6
  17. data/lib/puppet/indirector/indirection.rb +1 -1
  18. data/lib/puppet/module_tool/applications/uninstaller.rb +1 -1
  19. data/lib/puppet/module_tool/applications/upgrader.rb +1 -1
  20. data/lib/puppet/pal/pal_impl.rb +1 -1
  21. data/lib/puppet/parser/scope.rb +8 -7
  22. data/lib/puppet/parser/templatewrapper.rb +1 -0
  23. data/lib/puppet/pops/lookup/lookup_adapter.rb +3 -2
  24. data/lib/puppet/pops/model/ast.rb +1 -0
  25. data/lib/puppet/pops/model/factory.rb +14 -13
  26. data/lib/puppet/pops/parser/egrammar.ra +2 -2
  27. data/lib/puppet/pops/parser/eparser.rb +752 -753
  28. data/lib/puppet/pops/parser/lexer2.rb +69 -68
  29. data/lib/puppet/pops/parser/slurp_support.rb +1 -0
  30. data/lib/puppet/pops/serialization/to_stringified_converter.rb +1 -1
  31. data/lib/puppet/pops/types/type_formatter.rb +7 -6
  32. data/lib/puppet/pops/types/types.rb +1 -1
  33. data/lib/puppet/provider/aix_object.rb +1 -1
  34. data/lib/puppet/provider/group/groupadd.rb +5 -2
  35. data/lib/puppet/provider/package/pkg.rb +1 -1
  36. data/lib/puppet/provider/package/puppet_gem.rb +1 -1
  37. data/lib/puppet/provider/package/puppetserver_gem.rb +1 -1
  38. data/lib/puppet/provider/package/yum.rb +1 -1
  39. data/lib/puppet/provider/service/base.rb +1 -1
  40. data/lib/puppet/provider/service/init.rb +5 -5
  41. data/lib/puppet/provider/service/launchd.rb +1 -1
  42. data/lib/puppet/provider/service/redhat.rb +1 -1
  43. data/lib/puppet/provider/service/smf.rb +3 -3
  44. data/lib/puppet/provider/service/systemd.rb +1 -1
  45. data/lib/puppet/provider/service/upstart.rb +5 -5
  46. data/lib/puppet/provider/user/aix.rb +44 -1
  47. data/lib/puppet/provider/user/directoryservice.rb +1 -1
  48. data/lib/puppet/provider/user/useradd.rb +10 -7
  49. data/lib/puppet/provider.rb +1 -1
  50. data/lib/puppet/reference/providers.rb +2 -2
  51. data/lib/puppet/resource/type_collection.rb +2 -1
  52. data/lib/puppet/runtime.rb +11 -1
  53. data/lib/puppet/settings/file_setting.rb +3 -8
  54. data/lib/puppet/settings.rb +2 -2
  55. data/lib/puppet/test/test_helper.rb +4 -1
  56. data/lib/puppet/type/exec.rb +9 -1
  57. data/lib/puppet/type/group.rb +0 -1
  58. data/lib/puppet/type/resources.rb +1 -1
  59. data/lib/puppet/type/user.rb +0 -1
  60. data/lib/puppet/util/command_line.rb +1 -1
  61. data/lib/puppet/util/filetype.rb +2 -2
  62. data/lib/puppet/util/log.rb +1 -2
  63. data/lib/puppet/util/logging.rb +1 -25
  64. data/lib/puppet/util/pidlock.rb +1 -1
  65. data/lib/puppet/util/rdoc/parser/puppet_parser_core.rb +1 -1
  66. data/lib/puppet/util/suidmanager.rb +1 -2
  67. data/lib/puppet/util/tagging.rb +1 -0
  68. data/lib/puppet/util/windows/user.rb +0 -1
  69. data/lib/puppet/util.rb +4 -3
  70. data/lib/puppet/version.rb +1 -1
  71. data/lib/puppet.rb +2 -6
  72. data/man/man5/puppet.conf.5 +10 -2
  73. data/man/man8/puppet-agent.8 +4 -1
  74. data/man/man8/puppet-apply.8 +1 -1
  75. data/man/man8/puppet-catalog.8 +1 -1
  76. data/man/man8/puppet-config.8 +1 -1
  77. data/man/man8/puppet-describe.8 +1 -1
  78. data/man/man8/puppet-device.8 +1 -1
  79. data/man/man8/puppet-doc.8 +1 -1
  80. data/man/man8/puppet-epp.8 +1 -1
  81. data/man/man8/puppet-facts.8 +1 -1
  82. data/man/man8/puppet-filebucket.8 +1 -1
  83. data/man/man8/puppet-generate.8 +1 -1
  84. data/man/man8/puppet-help.8 +1 -1
  85. data/man/man8/puppet-lookup.8 +1 -1
  86. data/man/man8/puppet-module.8 +1 -1
  87. data/man/man8/puppet-node.8 +1 -1
  88. data/man/man8/puppet-parser.8 +1 -1
  89. data/man/man8/puppet-plugin.8 +1 -1
  90. data/man/man8/puppet-report.8 +1 -1
  91. data/man/man8/puppet-resource.8 +1 -1
  92. data/man/man8/puppet-script.8 +1 -1
  93. data/man/man8/puppet-ssl.8 +1 -1
  94. data/man/man8/puppet.8 +2 -2
  95. data/spec/integration/application/agent_spec.rb +16 -0
  96. data/spec/integration/configurer_spec.rb +1 -1
  97. data/spec/integration/indirector/facts/facter_spec.rb +3 -3
  98. data/spec/integration/transaction/report_spec.rb +1 -1
  99. data/spec/integration/type/file_spec.rb +2 -2
  100. data/spec/integration/type/package_spec.rb +6 -6
  101. data/spec/integration/util/rdoc/parser_spec.rb +1 -1
  102. data/spec/integration/util/windows/process_spec.rb +1 -9
  103. data/spec/unit/application/apply_spec.rb +76 -56
  104. data/spec/unit/application/resource_spec.rb +29 -0
  105. data/spec/unit/configurer_spec.rb +13 -3
  106. data/spec/unit/facter_impl_spec.rb +31 -0
  107. data/spec/unit/file_bucket/dipper_spec.rb +2 -2
  108. data/spec/unit/file_system_spec.rb +7 -0
  109. data/spec/unit/functions/lookup_spec.rb +64 -0
  110. data/spec/unit/indirector/indirection_spec.rb +10 -3
  111. data/spec/unit/pops/serialization/to_stringified_spec.rb +5 -0
  112. data/spec/unit/pops/types/type_calculator_spec.rb +6 -0
  113. data/spec/unit/provider/package/gem_spec.rb +1 -1
  114. data/spec/unit/provider/package/pip2_spec.rb +1 -1
  115. data/spec/unit/provider/package/pip3_spec.rb +1 -1
  116. data/spec/unit/provider/package/pip_spec.rb +1 -1
  117. data/spec/unit/provider/package/puppet_gem_spec.rb +1 -1
  118. data/spec/unit/provider/package/puppetserver_gem_spec.rb +1 -1
  119. data/spec/unit/provider/user/aix_spec.rb +100 -0
  120. data/spec/unit/provider/user/directoryservice_spec.rb +1 -1
  121. data/spec/unit/provider_spec.rb +4 -4
  122. data/spec/unit/puppet_spec.rb +12 -4
  123. data/spec/unit/settings/file_setting_spec.rb +10 -7
  124. data/spec/unit/type_spec.rb +2 -2
  125. data/spec/unit/util/logging_spec.rb +2 -0
  126. data/tasks/parallel.rake +3 -3
  127. metadata +5 -2
@@ -159,7 +159,7 @@ Puppet::Type.type(:user).provide :directoryservice do
159
159
  end
160
160
 
161
161
  def self.get_os_version
162
- @os_version ||= Facter.value(:macosx_productversion_major)
162
+ @os_version ||= Puppet.runtime[:facter].value(:macosx_productversion_major)
163
163
  end
164
164
 
165
165
  # Use dscl to retrieve an array of hashes containing attributes about all
@@ -7,7 +7,10 @@ require_relative '../../../puppet/error'
7
7
  Puppet::Type.type(:user).provide :useradd, :parent => Puppet::Provider::NameService::ObjectAdd do
8
8
  desc "User management via `useradd` and its ilk. Note that you will need to
9
9
  install Ruby's shadow password library (often known as `ruby-libshadow`)
10
- if you wish to manage user passwords."
10
+ if you wish to manage user passwords.
11
+
12
+ To use the `forcelocal` parameter, you need to install the `libuser` package (providing
13
+ `/usr/sbin/lgroupadd` and `/usr/sbin/luseradd`)."
11
14
 
12
15
  commands :add => "useradd", :delete => "userdel", :modify => "usermod", :password => "chage", :chpasswd => "chpasswd"
13
16
 
@@ -21,13 +24,13 @@ Puppet::Type.type(:user).provide :useradd, :parent => Puppet::Provider::NameServ
21
24
  options :expiry, :method => :sp_expire,
22
25
  :munge => proc { |value|
23
26
  if value == :absent
24
- if Facter.value(:operatingsystem)=='SLES' && Facter.value(:operatingsystemmajrelease) == "11"
27
+ if Puppet.runtime[:facter].value(:operatingsystem)=='SLES' && Puppet.runtime[:facter].value(:operatingsystemmajrelease) == "11"
25
28
  -1
26
29
  else
27
30
  ''
28
31
  end
29
32
  else
30
- case Facter.value(:operatingsystem)
33
+ case Puppet.runtime[:facter].value(:operatingsystem)
31
34
  when 'Solaris'
32
35
  # Solaris uses %m/%d/%Y for useradd/usermod
33
36
  expiry_year, expiry_month, expiry_day = value.split('-')
@@ -193,7 +196,7 @@ Puppet::Type.type(:user).provide :useradd, :parent => Puppet::Provider::NameServ
193
196
  end
194
197
 
195
198
  has_features :manages_homedir, :allows_duplicates, :manages_expiry
196
- has_features :system_users unless %w{HP-UX Solaris}.include? Facter.value(:operatingsystem)
199
+ has_features :system_users unless %w{HP-UX Solaris}.include? Puppet.runtime[:facter].value(:operatingsystem)
197
200
 
198
201
  has_features :manages_passwords, :manages_password_age if Puppet.features.libshadow?
199
202
  has_features :manages_shell
@@ -228,8 +231,8 @@ Puppet::Type.type(:user).provide :useradd, :parent => Puppet::Provider::NameServ
228
231
  # libuser does not implement the -m flag
229
232
  cmd << "-m" unless @resource.forcelocal?
230
233
  else
231
- osfamily = Facter.value(:osfamily)
232
- osversion = Facter.value(:operatingsystemmajrelease).to_i
234
+ osfamily = Puppet.runtime[:facter].value(:osfamily)
235
+ osversion = Puppet.runtime[:facter].value(:operatingsystemmajrelease).to_i
233
236
  # SLES 11 uses pwdutils instead of shadow, which does not have -M
234
237
  # Solaris and OpenBSD use different useradd flavors
235
238
  unless osfamily =~ /Solaris|OpenBSD/ || osfamily == 'Suse' && osversion <= 11
@@ -327,7 +330,7 @@ Puppet::Type.type(:user).provide :useradd, :parent => Puppet::Provider::NameServ
327
330
  cmd = [command(:delete)]
328
331
  end
329
332
  # Solaris `userdel -r` will fail if the homedir does not exist.
330
- if @resource.managehome? && (('Solaris' != Facter.value(:operatingsystem)) || Dir.exist?(Dir.home(@resource[:name])))
333
+ if @resource.managehome? && (('Solaris' != Puppet.runtime[:facter].value(:operatingsystem)) || Dir.exist?(Dir.home(@resource[:name])))
331
334
  cmd << '-r'
332
335
  end
333
336
  cmd << @resource[:name]
@@ -289,7 +289,7 @@ class Puppet::Provider
289
289
  # values. Given one or more Regexp instances, fact is compared via the basic
290
290
  # pattern-matching operator.
291
291
  def self.fact_match(fact, values)
292
- fact_val = Facter.value(fact).to_s.downcase
292
+ fact_val = Puppet.runtime[:facter].value(fact).to_s.downcase
293
293
  if fact_val.empty?
294
294
  return false
295
295
  else
@@ -15,7 +15,7 @@ providers = Puppet::Util::Reference.newreference :providers, :title => "Provider
15
15
  # Throw some facts in there, so we know where the report is from.
16
16
  ["Ruby Version", "Puppet Version", "Operating System", "Operating System Release"].each do |label|
17
17
  name = label.gsub(/\s+/, '')
18
- value = Facter.value(name)
18
+ value = Puppet.runtime[:facter].value(name)
19
19
  ret << option(label, value)
20
20
  end
21
21
  ret << "\n"
@@ -61,7 +61,7 @@ providers = Puppet::Util::Reference.newreference :providers, :title => "Provider
61
61
  if Puppet.settings.valid?(name)
62
62
  details << _(" - Setting %{name} (currently %{value}) not in list %{facts}\n") % { name: name, value: Puppet.settings.value(name).inspect, facts: facts.join(", ") }
63
63
  else
64
- details << _(" - Fact %{name} (currently %{value}) not in list %{facts}\n") % { name: name, value: Facter.value(name).inspect, facts: facts.join(", ") }
64
+ details << _(" - Fact %{name} (currently %{value}) not in list %{facts}\n") % { name: name, value: Puppet.runtime[:facter].value(name).inspect, facts: facts.join(", ") }
65
65
  end
66
66
  end
67
67
  when :true
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require_relative '../../puppet/parser/type_loader'
2
3
  require_relative '../../puppet/util/file_watcher'
3
4
  require_relative '../../puppet/util/warnings'
@@ -179,7 +180,7 @@ class Puppet::Resource::TypeCollection
179
180
 
180
181
  private
181
182
 
182
- COLON_COLON = "::".freeze
183
+ COLON_COLON = "::"
183
184
 
184
185
  # Resolve namespaces and find the given object. Autoload it if
185
186
  # necessary.
@@ -1,4 +1,5 @@
1
1
  require_relative '../puppet/http'
2
+ require_relative '../puppet/facter_impl'
2
3
  require 'singleton'
3
4
 
4
5
  # Provides access to runtime implementations.
@@ -16,11 +17,20 @@ class Puppet::Runtime
16
17
  else
17
18
  Puppet::HTTP::ExternalClient.new(klass)
18
19
  end
19
- end
20
+ end,
21
+ facter: proc { Puppet::FacterImpl.new }
20
22
  }
21
23
  end
22
24
  private :initialize
23
25
 
26
+ # Loads all runtime implementations.
27
+ #
28
+ # @return Array[Symbol] the names of loaded implementations
29
+ # @api private
30
+ def load_services
31
+ @runtime_services.keys.each { |key| self[key] }
32
+ end
33
+
24
34
  # Get a runtime implementation.
25
35
  #
26
36
  # @param name [Symbol] the name of the implementation
@@ -53,7 +53,7 @@ class Puppet::Settings::FileSetting < Puppet::Settings::StringSetting
53
53
  end
54
54
  end
55
55
 
56
- attr_accessor :mode, :create
56
+ attr_accessor :mode
57
57
 
58
58
  def initialize(args)
59
59
  @group = Unspecified.new
@@ -61,11 +61,6 @@ class Puppet::Settings::FileSetting < Puppet::Settings::StringSetting
61
61
  super(args)
62
62
  end
63
63
 
64
- # Should we create files, rather than just directories?
65
- def create_files?
66
- create
67
- end
68
-
69
64
  # @param value [String] the group to use on the created file (can only be "root" or "service")
70
65
  # @api public
71
66
  def group=(value)
@@ -135,8 +130,8 @@ class Puppet::Settings::FileSetting < Puppet::Settings::StringSetting
135
130
  # Make sure the paths are fully qualified.
136
131
  path = File.expand_path(path)
137
132
 
138
- return nil unless type == :directory or create_files? or Puppet::FileSystem.exist?(path)
139
- return nil if path =~ /^\/dev/ or path =~ /^[A-Z]:\/dev/i
133
+ return nil unless type == :directory || Puppet::FileSystem.exist?(path)
134
+ return nil if path =~ /^\/dev/ || path =~ /^[A-Z]:\/dev/i
140
135
 
141
136
  resource = Puppet::Resource.new(:file, path)
142
137
 
@@ -79,11 +79,11 @@ class Puppet::Settings
79
79
  end
80
80
 
81
81
  def self.hostname_fact()
82
- Facter.value :hostname
82
+ Puppet.runtime[:facter].value :hostname
83
83
  end
84
84
 
85
85
  def self.domain_fact()
86
- Facter.value :domain
86
+ Puppet.runtime[:facter].value :domain
87
87
  end
88
88
 
89
89
  def self.default_config_file_name
@@ -142,7 +142,9 @@ module Puppet::Test
142
142
  },
143
143
  "Context for specs")
144
144
 
145
- Puppet.runtime.clear
145
+ # trigger `require 'facter'`
146
+ Puppet.runtime[:facter]
147
+
146
148
  Puppet::Parser::Functions.reset
147
149
  Puppet::Application.clear!
148
150
  Puppet::Util::Profiler.clear
@@ -166,6 +168,7 @@ module Puppet::Test
166
168
 
167
169
  Puppet::Util::Storage.clear
168
170
  Puppet::Util::ExecutionStub.reset
171
+ Puppet.runtime.clear
169
172
 
170
173
  Puppet.clear_deprecation_warnings
171
174
 
@@ -201,7 +201,15 @@ module Puppet
201
201
  any output is logged at the `err` log level.
202
202
 
203
203
  Multiple `exec` resources can use the same `command` value; Puppet
204
- only uses the resource title to ensure `exec`s are unique."
204
+ only uses the resource title to ensure `exec`s are unique.
205
+
206
+ On *nix platforms, the command can be specified as an array of
207
+ strings and Puppet will invoke it using the more secure method of
208
+ parameterized system calls. For example, rather than executing the
209
+ malicious injected code, this command will echo it out:
210
+
211
+ command => ['/bin/echo', 'hello world; rm -rf /']
212
+ "
205
213
 
206
214
  validate do |command|
207
215
  unless command.is_a?(String) || command.is_a?(Array)
@@ -1,5 +1,4 @@
1
1
  require 'etc'
2
- require 'facter'
3
2
  require_relative '../../puppet/property/keyvalue'
4
3
  require_relative '../../puppet/parameter/boolean'
5
4
 
@@ -175,7 +175,7 @@ Puppet::Type.newtype(:resources) do
175
175
  end
176
176
 
177
177
  # Otherwise, use a sensible default based on the OS family
178
- @system_users_max_uid ||= case Facter.value(:osfamily)
178
+ @system_users_max_uid ||= case Puppet.runtime[:facter].value(:osfamily)
179
179
  when 'OpenBSD', 'FreeBSD'
180
180
  999
181
181
  else
@@ -1,5 +1,4 @@
1
1
  require 'etc'
2
- require 'facter'
3
2
  require_relative '../../puppet/parameter/boolean'
4
3
  require_relative '../../puppet/property/list'
5
4
  require_relative '../../puppet/property/ordered_list'
@@ -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}"
@@ -2,7 +2,6 @@ require_relative '../../puppet/util/tagging'
2
2
  require_relative '../../puppet/util/classgen'
3
3
  require_relative '../../puppet/util/psych_support'
4
4
  require_relative '../../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_relative '../../puppet/util/log'
3
3
  require_relative '../../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
@@ -1,4 +1,3 @@
1
- require 'facter'
2
1
  require_relative '../../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
 
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require_relative '../../puppet/util/tag_set'
2
3
 
3
4
  module Puppet::Util::Tagging
@@ -1,6 +1,5 @@
1
1
  require_relative '../../../puppet/util/windows'
2
2
 
3
- require 'facter'
4
3
  require 'ffi'
5
4
 
6
5
  module Puppet::Util::Windows::User
data/lib/puppet/util.rb CHANGED
@@ -772,12 +772,13 @@ module Util
772
772
  # Executes a block of code, wrapped around Facter.load_external(false) and
773
773
  # Facter.load_external(true) which will cause Facter to not evaluate external facts.
774
774
  def skip_external_facts
775
- return yield unless Facter.respond_to? :load_external
775
+ return yield unless Puppet.runtime[:facter].load_external?
776
+
776
777
  begin
777
- Facter.load_external(false)
778
+ Puppet.runtime[:facter].load_external(false)
778
779
  yield
779
780
  ensure
780
- Facter.load_external(true)
781
+ Puppet.runtime[:facter].load_external(true)
781
782
  end
782
783
  end
783
784
  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 = '7.10.0'
9
+ PUPPETVERSION = '7.11.0'
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_relative 'puppet/error'
17
16
  require_relative 'puppet/util'
18
17
  require_relative 'puppet/util/autoload'
@@ -88,9 +87,6 @@ module Puppet
88
87
  require_relative '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
 
@@ -193,11 +189,11 @@ module Puppet
193
189
  def self.initialize_facts
194
190
  # Add the puppetversion fact; this is done before generating the hash so it is
195
191
  # accessible to custom facts.
196
- Facter.add(:puppetversion) do
192
+ Puppet.runtime[:facter].add(:puppetversion) do
197
193
  setcode { Puppet.version.to_s }
198
194
  end
199
195
 
200
- Facter.add(:agent_specified_environment) do
196
+ Puppet.runtime[:facter].add(:agent_specified_environment) do
201
197
  setcode do
202
198
  Puppet.settings.set_by_cli(:environment) ||
203
199
  Puppet.settings.set_in_section(:environment, :agent) ||
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "PUPPETCONF" "5" "August 2021" "Puppet, Inc." "Puppet manual"
4
+ .TH "PUPPETCONF" "5" "September 2021" "Puppet, Inc." "Puppet manual"
5
5
  \fBThis page is autogenerated; any changes will get overwritten\fR
6
6
  .
7
7
  .SH "Configuration settings"
@@ -929,7 +929,7 @@ The time to wait for data to be read from an HTTP connection\. If nothing is rea
929
929
  The HTTP User\-Agent string to send when making network requests\.
930
930
  .
931
931
  .IP "\(bu" 4
932
- \fIDefault\fR: \fBPuppet/7\.10\.0 Ruby/2\.5\.1\-p57 (x86_64\-linux)\fR
932
+ \fIDefault\fR: \fBPuppet/7\.11\.0 Ruby/2\.5\.1\-p57 (x86_64\-linux)\fR
933
933
  .
934
934
  .IP "" 0
935
935
  .
@@ -2110,6 +2110,14 @@ This argument is by default disabled (value set to 0)\. In this case puppet agen
2110
2110
  .
2111
2111
  .IP "" 0
2112
2112
  .
2113
+ .SS "write_catalog_summary"
2114
+ Whether to write the \fBclassfile\fR and \fBresourcefile\fR after applying the catalog\. It is enabled by default, except when running \fBpuppet apply\fR\.
2115
+ .
2116
+ .IP "\(bu" 4
2117
+ \fIDefault\fR: \fBtrue\fR
2118
+ .
2119
+ .IP "" 0
2120
+ .
2113
2121
  .SS "yamldir"
2114
2122
  The directory in which YAML data is stored, usually in a subdirectory\.
2115
2123
  .