puppet 7.10.0 → 7.11.0
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.
- checksums.yaml +4 -4
- data/Gemfile +2 -2
- data/Gemfile.lock +9 -9
- data/lib/puppet/application/agent.rb +4 -0
- data/lib/puppet/application/apply.rb +20 -2
- data/lib/puppet/application/resource.rb +15 -13
- data/lib/puppet/concurrent/thread_local_singleton.rb +1 -0
- data/lib/puppet/configurer.rb +14 -4
- data/lib/puppet/confine/variable.rb +1 -1
- data/lib/puppet/defaults.rb +9 -3
- data/lib/puppet/facter_impl.rb +96 -0
- data/lib/puppet/file_serving/mount/file.rb +4 -4
- data/lib/puppet/file_system/file_impl.rb +3 -1
- data/lib/puppet/forge.rb +1 -1
- data/lib/puppet/indirector/catalog/compiler.rb +3 -3
- data/lib/puppet/indirector/facts/facter.rb +6 -6
- data/lib/puppet/indirector/indirection.rb +1 -1
- data/lib/puppet/module_tool/applications/uninstaller.rb +1 -1
- data/lib/puppet/module_tool/applications/upgrader.rb +1 -1
- data/lib/puppet/pal/pal_impl.rb +1 -1
- data/lib/puppet/parser/scope.rb +8 -7
- data/lib/puppet/parser/templatewrapper.rb +1 -0
- data/lib/puppet/pops/lookup/lookup_adapter.rb +3 -2
- data/lib/puppet/pops/model/ast.rb +1 -0
- data/lib/puppet/pops/model/factory.rb +14 -13
- data/lib/puppet/pops/parser/egrammar.ra +2 -2
- data/lib/puppet/pops/parser/eparser.rb +752 -753
- data/lib/puppet/pops/parser/lexer2.rb +69 -68
- data/lib/puppet/pops/parser/slurp_support.rb +1 -0
- data/lib/puppet/pops/serialization/to_stringified_converter.rb +1 -1
- data/lib/puppet/pops/types/type_formatter.rb +7 -6
- data/lib/puppet/pops/types/types.rb +1 -1
- data/lib/puppet/provider/aix_object.rb +1 -1
- data/lib/puppet/provider/group/groupadd.rb +5 -2
- data/lib/puppet/provider/package/pkg.rb +1 -1
- data/lib/puppet/provider/package/puppet_gem.rb +1 -1
- data/lib/puppet/provider/package/puppetserver_gem.rb +1 -1
- data/lib/puppet/provider/package/yum.rb +1 -1
- data/lib/puppet/provider/service/base.rb +1 -1
- data/lib/puppet/provider/service/init.rb +5 -5
- data/lib/puppet/provider/service/launchd.rb +1 -1
- data/lib/puppet/provider/service/redhat.rb +1 -1
- data/lib/puppet/provider/service/smf.rb +3 -3
- data/lib/puppet/provider/service/systemd.rb +1 -1
- data/lib/puppet/provider/service/upstart.rb +5 -5
- data/lib/puppet/provider/user/aix.rb +44 -1
- data/lib/puppet/provider/user/directoryservice.rb +1 -1
- data/lib/puppet/provider/user/useradd.rb +10 -7
- data/lib/puppet/provider.rb +1 -1
- data/lib/puppet/reference/providers.rb +2 -2
- data/lib/puppet/resource/type_collection.rb +2 -1
- data/lib/puppet/runtime.rb +11 -1
- data/lib/puppet/settings/file_setting.rb +3 -8
- data/lib/puppet/settings.rb +2 -2
- data/lib/puppet/test/test_helper.rb +4 -1
- data/lib/puppet/type/exec.rb +9 -1
- data/lib/puppet/type/group.rb +0 -1
- data/lib/puppet/type/resources.rb +1 -1
- data/lib/puppet/type/user.rb +0 -1
- data/lib/puppet/util/command_line.rb +1 -1
- data/lib/puppet/util/filetype.rb +2 -2
- data/lib/puppet/util/log.rb +1 -2
- data/lib/puppet/util/logging.rb +1 -25
- data/lib/puppet/util/pidlock.rb +1 -1
- data/lib/puppet/util/rdoc/parser/puppet_parser_core.rb +1 -1
- data/lib/puppet/util/suidmanager.rb +1 -2
- data/lib/puppet/util/tagging.rb +1 -0
- data/lib/puppet/util/windows/user.rb +0 -1
- data/lib/puppet/util.rb +4 -3
- data/lib/puppet/version.rb +1 -1
- data/lib/puppet.rb +2 -6
- data/man/man5/puppet.conf.5 +10 -2
- data/man/man8/puppet-agent.8 +4 -1
- data/man/man8/puppet-apply.8 +1 -1
- data/man/man8/puppet-catalog.8 +1 -1
- data/man/man8/puppet-config.8 +1 -1
- data/man/man8/puppet-describe.8 +1 -1
- data/man/man8/puppet-device.8 +1 -1
- data/man/man8/puppet-doc.8 +1 -1
- data/man/man8/puppet-epp.8 +1 -1
- data/man/man8/puppet-facts.8 +1 -1
- data/man/man8/puppet-filebucket.8 +1 -1
- data/man/man8/puppet-generate.8 +1 -1
- data/man/man8/puppet-help.8 +1 -1
- data/man/man8/puppet-lookup.8 +1 -1
- data/man/man8/puppet-module.8 +1 -1
- data/man/man8/puppet-node.8 +1 -1
- data/man/man8/puppet-parser.8 +1 -1
- data/man/man8/puppet-plugin.8 +1 -1
- data/man/man8/puppet-report.8 +1 -1
- data/man/man8/puppet-resource.8 +1 -1
- data/man/man8/puppet-script.8 +1 -1
- data/man/man8/puppet-ssl.8 +1 -1
- data/man/man8/puppet.8 +2 -2
- data/spec/integration/application/agent_spec.rb +16 -0
- data/spec/integration/configurer_spec.rb +1 -1
- data/spec/integration/indirector/facts/facter_spec.rb +3 -3
- data/spec/integration/transaction/report_spec.rb +1 -1
- data/spec/integration/type/file_spec.rb +2 -2
- data/spec/integration/type/package_spec.rb +6 -6
- data/spec/integration/util/rdoc/parser_spec.rb +1 -1
- data/spec/integration/util/windows/process_spec.rb +1 -9
- data/spec/unit/application/apply_spec.rb +76 -56
- data/spec/unit/application/resource_spec.rb +29 -0
- data/spec/unit/configurer_spec.rb +13 -3
- data/spec/unit/facter_impl_spec.rb +31 -0
- data/spec/unit/file_bucket/dipper_spec.rb +2 -2
- data/spec/unit/file_system_spec.rb +7 -0
- data/spec/unit/functions/lookup_spec.rb +64 -0
- data/spec/unit/indirector/indirection_spec.rb +10 -3
- data/spec/unit/pops/serialization/to_stringified_spec.rb +5 -0
- data/spec/unit/pops/types/type_calculator_spec.rb +6 -0
- data/spec/unit/provider/package/gem_spec.rb +1 -1
- data/spec/unit/provider/package/pip2_spec.rb +1 -1
- data/spec/unit/provider/package/pip3_spec.rb +1 -1
- data/spec/unit/provider/package/pip_spec.rb +1 -1
- data/spec/unit/provider/package/puppet_gem_spec.rb +1 -1
- data/spec/unit/provider/package/puppetserver_gem_spec.rb +1 -1
- data/spec/unit/provider/user/aix_spec.rb +100 -0
- data/spec/unit/provider/user/directoryservice_spec.rb +1 -1
- data/spec/unit/provider_spec.rb +4 -4
- data/spec/unit/puppet_spec.rb +12 -4
- data/spec/unit/settings/file_setting_spec.rb +10 -7
- data/spec/unit/type_spec.rb +2 -2
- data/spec/unit/util/logging_spec.rb +2 -0
- data/tasks/parallel.rake +3 -3
- 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 ||=
|
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
|
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
|
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?
|
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 =
|
232
|
-
osversion =
|
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' !=
|
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]
|
data/lib/puppet/provider.rb
CHANGED
@@ -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 =
|
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 =
|
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:
|
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 = "::"
|
183
|
+
COLON_COLON = "::"
|
183
184
|
|
184
185
|
# Resolve namespaces and find the given object. Autoload it if
|
185
186
|
# necessary.
|
data/lib/puppet/runtime.rb
CHANGED
@@ -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
|
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
|
139
|
-
return nil if path =~ /^\/dev/
|
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
|
|
data/lib/puppet/settings.rb
CHANGED
@@ -79,11 +79,11 @@ class Puppet::Settings
|
|
79
79
|
end
|
80
80
|
|
81
81
|
def self.hostname_fact()
|
82
|
-
|
82
|
+
Puppet.runtime[:facter].value :hostname
|
83
83
|
end
|
84
84
|
|
85
85
|
def self.domain_fact()
|
86
|
-
|
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
|
-
|
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
|
|
data/lib/puppet/type/exec.rb
CHANGED
@@ -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)
|
data/lib/puppet/type/group.rb
CHANGED
@@ -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
|
178
|
+
@system_users_max_uid ||= case Puppet.runtime[:facter].value(:osfamily)
|
179
179
|
when 'OpenBSD', 'FreeBSD'
|
180
180
|
999
|
181
181
|
else
|
data/lib/puppet/type/user.rb
CHANGED
data/lib/puppet/util/filetype.rb
CHANGED
@@ -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?(
|
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 ||
|
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}"
|
data/lib/puppet/util/log.rb
CHANGED
@@ -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
|
-
|
113
|
+
Puppet.runtime[:facter].debugging(level == :debug)
|
115
114
|
end
|
116
115
|
|
117
116
|
def Log.levels
|
data/lib/puppet/util/logging.rb
CHANGED
@@ -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
|
-
|
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
|
|
data/lib/puppet/util/pidlock.rb
CHANGED
@@ -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 =
|
20
|
+
@osx_maj_ver = Puppet.runtime[:facter].value('macosx_productversion_major') || false
|
22
21
|
end
|
23
22
|
module_function :osx_maj_ver
|
24
23
|
|
data/lib/puppet/util/tagging.rb
CHANGED
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
|
775
|
+
return yield unless Puppet.runtime[:facter].load_external?
|
776
|
+
|
776
777
|
begin
|
777
|
-
|
778
|
+
Puppet.runtime[:facter].load_external(false)
|
778
779
|
yield
|
779
780
|
ensure
|
780
|
-
|
781
|
+
Puppet.runtime[:facter].load_external(true)
|
781
782
|
end
|
782
783
|
end
|
783
784
|
module_function :skip_external_facts
|
data/lib/puppet/version.rb
CHANGED
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
|
-
|
192
|
+
Puppet.runtime[:facter].add(:puppetversion) do
|
197
193
|
setcode { Puppet.version.to_s }
|
198
194
|
end
|
199
195
|
|
200
|
-
|
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) ||
|
data/man/man5/puppet.conf.5
CHANGED
@@ -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" "
|
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\.
|
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
|
.
|