puppet 5.5.2 → 5.5.3
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/lib/puppet/application/device.rb +43 -30
- data/lib/puppet/defaults.rb +7 -4
- data/lib/puppet/environments.rb +2 -3
- data/lib/puppet/face/config.rb +1 -1
- data/lib/puppet/face/module/build.rb +5 -0
- data/lib/puppet/gettext/config.rb +28 -5
- data/lib/puppet/indirector/catalog/compiler.rb +5 -7
- data/lib/puppet/node/environment.rb +5 -1
- data/lib/puppet/provider/selmodule/semodule.rb +1 -1
- data/lib/puppet/provider/service/upstart.rb +2 -0
- data/lib/puppet/reference/configuration.rb +6 -0
- data/lib/puppet/resource/status.rb +2 -0
- data/lib/puppet/resource/type_collection.rb +1 -1
- data/lib/puppet/settings.rb +6 -0
- data/lib/puppet/ssl/certificate_request.rb +11 -3
- data/lib/puppet/transaction/event_manager.rb +3 -1
- data/lib/puppet/transaction/report.rb +1 -1
- data/lib/puppet/util.rb +2 -0
- data/lib/puppet/util/command_line.rb +0 -1
- data/lib/puppet/util/log/destinations.rb +1 -1
- data/lib/puppet/util/windows/file.rb +18 -0
- data/lib/puppet/util/windows/security.rb +26 -14
- data/lib/puppet/version.rb +1 -1
- data/locales/puppet.pot +96 -79
- data/man/man5/puppet.conf.5 +8 -5
- data/man/man8/puppet-agent.8 +1 -1
- data/man/man8/puppet-apply.8 +1 -1
- data/man/man8/puppet-ca.8 +2 -2
- data/man/man8/puppet-catalog.8 +1 -1
- data/man/man8/puppet-cert.8 +1 -1
- data/man/man8/puppet-certificate.8 +2 -2
- data/man/man8/puppet-certificate_request.8 +1 -1
- data/man/man8/puppet-certificate_revocation_list.8 +1 -1
- data/man/man8/puppet-config.8 +2 -2
- data/man/man8/puppet-describe.8 +1 -1
- data/man/man8/puppet-device.8 +6 -2
- 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-key.8 +1 -1
- data/man/man8/puppet-lookup.8 +1 -1
- data/man/man8/puppet-man.8 +1 -1
- data/man/man8/puppet-master.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-status.8 +1 -1
- data/man/man8/puppet.8 +2 -2
- data/spec/integration/type/file_spec.rb +3 -1
- data/spec/integration/util/windows/security_spec.rb +14 -1
- data/spec/shared_examples/rhel_package_provider.rb +2 -2
- data/spec/unit/application/device_spec.rb +55 -11
- data/spec/unit/application/master_spec.rb +5 -4
- data/spec/unit/gettext/config_spec.rb +29 -10
- data/spec/unit/node/environment_spec.rb +4 -3
- data/spec/unit/provider/package/aptitude_spec.rb +1 -1
- data/spec/unit/provider/package/aptrpm_spec.rb +1 -1
- data/spec/unit/provider/package/dpkg_spec.rb +1 -1
- data/spec/unit/provider/package/nim_spec.rb +2 -11
- data/spec/unit/provider/package/opkg_spec.rb +2 -2
- data/spec/unit/provider/package/pkg_spec.rb +52 -17
- data/spec/unit/provider/package/rpm_spec.rb +30 -10
- data/spec/unit/provider/package/urpmi_spec.rb +9 -3
- data/spec/unit/provider/selmodule_spec.rb +6 -0
- data/spec/unit/provider/service/openrc_spec.rb +1 -1
- data/spec/unit/resource/status_spec.rb +2 -0
- data/spec/unit/resource/type_collection_spec.rb +4 -1
- data/spec/unit/ssl/certificate_request_spec.rb +11 -0
- data/spec/unit/transaction/event_manager_spec.rb +12 -0
- data/spec/unit/util/diff_spec.rb +11 -3
- data/spec/unit/util/execution_spec.rb +2 -1
- data/spec/unit/util/filetype_spec.rb +6 -2
- data/spec/unit/util/log/destinations_spec.rb +28 -12
- data/spec/unit/util/plist_spec.rb +12 -6
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c34d01120ed58c4595066bcf80fd5100865c6fb9
|
4
|
+
data.tar.gz: f86ac9bc12aa80d03c7c6dfebfd10bd6370a3a5d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6cefc3d13b8da706ac064b8da16c14df3813a87858591b83ccbc180977bb450b28e1a783979dd94fc095f9b782025abe69022d21425ef526301b0423cf35adcd
|
7
|
+
data.tar.gz: ed5fdf1a5eb4be48d04a24190e86b7490680b2513d6527e9475b9abb15a67e53d16ada714c64fdebf4c49721a718a29a31a9307079781cc3de573a53451bffed
|
@@ -32,6 +32,7 @@ class Puppet::Application::Device < Puppet::Application
|
|
32
32
|
:centrallogs => false,
|
33
33
|
:setdest => false,
|
34
34
|
:resource => false,
|
35
|
+
:facts => false,
|
35
36
|
:target => nil,
|
36
37
|
:to_yaml => false,
|
37
38
|
}.each do |opt,val|
|
@@ -44,6 +45,7 @@ class Puppet::Application::Device < Puppet::Application
|
|
44
45
|
option("--centrallogging")
|
45
46
|
option("--debug","-d")
|
46
47
|
option("--resource","-r")
|
48
|
+
option("--facts","-f")
|
47
49
|
option("--to_yaml","-y")
|
48
50
|
option("--verbose","-v")
|
49
51
|
|
@@ -93,7 +95,7 @@ USAGE
|
|
93
95
|
-----
|
94
96
|
puppet device [-d|--debug] [--detailed-exitcodes] [--deviceconfig <file>]
|
95
97
|
[-h|--help] [-l|--logdest syslog|<file>|console]
|
96
|
-
[-v|--verbose] [-w|--waitforcert <seconds>]
|
98
|
+
[-v|--verbose] [-w|--waitforcert <seconds>] [-f|--facts]
|
97
99
|
[-a|--apply <file>] [-r|--resource <type> [name]]
|
98
100
|
[-t|--target <device>] [--user=<user>] [-V|--version]
|
99
101
|
|
@@ -163,6 +165,9 @@ you can specify '--server <servername>' as an argument.
|
|
163
165
|
* --apply:
|
164
166
|
Apply a manifest against a remote target. Target must be specified.
|
165
167
|
|
168
|
+
* --facts:
|
169
|
+
Displays the facts of a remote target. Target must be specified.
|
170
|
+
|
166
171
|
* --resource:
|
167
172
|
Displays a resource state as Puppet code, roughly equivalent to
|
168
173
|
`puppet resource`. Can be filterd by title. Requires --target be specified.
|
@@ -208,18 +213,14 @@ Licensed under the Apache 2.0 License
|
|
208
213
|
|
209
214
|
def main
|
210
215
|
if options[:resource] and !options[:target]
|
211
|
-
|
212
|
-
|
216
|
+
raise _("resource command requires target")
|
217
|
+
end
|
218
|
+
if options[:facts] and !options[:target]
|
219
|
+
raise _("facts command requires target")
|
213
220
|
end
|
214
221
|
unless options[:apply].nil?
|
215
|
-
if options[:target].nil?
|
216
|
-
|
217
|
-
exit(1)
|
218
|
-
end
|
219
|
-
unless File.file?(options[:apply])
|
220
|
-
Puppet.err _("%{file} does not exist, cannot apply") % { file: options[:apply] }
|
221
|
-
exit(1)
|
222
|
-
end
|
222
|
+
raise _("missing argument: --target is required when using --apply") if options[:target].nil?
|
223
|
+
raise _("%{file} does not exist, cannot apply") % { file: options[:apply] } unless File.file?(options[:apply])
|
223
224
|
end
|
224
225
|
vardir = Puppet[:vardir]
|
225
226
|
confdir = Puppet[:confdir]
|
@@ -235,7 +236,7 @@ Licensed under the Apache 2.0 License
|
|
235
236
|
end
|
236
237
|
if devices.empty?
|
237
238
|
if options[:target]
|
238
|
-
|
239
|
+
raise _("Target device / certificate '%{target}' not found in %{config}") % { target: options[:target], config: Puppet[:deviceconfig] }
|
239
240
|
else
|
240
241
|
Puppet.err _("No device found in %{config}") % { config: Puppet[:deviceconfig] }
|
241
242
|
exit(1)
|
@@ -260,9 +261,7 @@ Licensed under the Apache 2.0 License
|
|
260
261
|
if options[:resource]
|
261
262
|
type, name = parse_args(command_line.args)
|
262
263
|
Puppet.info _("retrieving resource: %{resource} from %{target} at %{scheme}%{url_host}%{port}%{url_path}") % { resource: type, target: device.name, scheme: scheme, url_host: device_url.host, port: port, url_path: device_url.path }
|
263
|
-
|
264
264
|
resources = find_resources(type, name)
|
265
|
-
|
266
265
|
if options[:to_yaml]
|
267
266
|
text = resources.map do |resource|
|
268
267
|
resource.prune_parameters(:parameters_to_include => @extra_params).to_hierayaml.force_encoding(Encoding.default_external)
|
@@ -274,14 +273,24 @@ Licensed under the Apache 2.0 License
|
|
274
273
|
end.join("\n")
|
275
274
|
end
|
276
275
|
(puts text)
|
276
|
+
0
|
277
|
+
elsif options[:facts]
|
278
|
+
Puppet.info _("retrieving facts from %{target} at %{scheme}%{url_host}%{port}%{url_path}") % { resource: type, target: device.name, scheme: scheme, url_host: device_url.host, port: port, url_path: device_url.path }
|
279
|
+
remote_facts = Puppet::Node::Facts.indirection.find(name, :environment => env)
|
280
|
+
# Give a proper name to the facts
|
281
|
+
remote_facts.name = remote_facts.values['clientcert']
|
282
|
+
renderer = Puppet::Network::FormatHandler.format(:console)
|
283
|
+
puts renderer.render(remote_facts)
|
284
|
+
0
|
277
285
|
elsif options[:apply]
|
286
|
+
# ensure we have a cache folder structure exists for the device
|
287
|
+
FileUtils.mkdir_p(Puppet[:statedir]) unless File.directory?(Puppet[:statedir])
|
278
288
|
# avoid reporting to server
|
279
289
|
Puppet::Transaction::Report.indirection.terminus_class = :yaml
|
280
290
|
Puppet::Resource::Catalog.indirection.cache_class = nil
|
281
291
|
|
282
292
|
require 'puppet/application/apply'
|
283
293
|
begin
|
284
|
-
|
285
294
|
Puppet[:node_terminus] = :plain
|
286
295
|
Puppet[:catalog_terminus] = :compiler
|
287
296
|
Puppet[:catalog_cache_terminus] = nil
|
@@ -353,26 +362,30 @@ Licensed under the Apache 2.0 License
|
|
353
362
|
|
354
363
|
def setup
|
355
364
|
setup_logs
|
365
|
+
if options[:apply] || options[:facts] || options[:resource]
|
366
|
+
Puppet::Util::Log.newdestination(:console)
|
367
|
+
Puppet.settings.use :main, :agent, :ssl
|
368
|
+
else
|
369
|
+
args[:Server] = Puppet[:server]
|
370
|
+
if options[:centrallogs]
|
371
|
+
logdest = args[:Server]
|
356
372
|
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
logdest += ":" + args[:Port] if args.include?(:Port)
|
362
|
-
Puppet::Util::Log.newdestination(logdest)
|
363
|
-
end
|
373
|
+
logdest += ":" + args[:Port] if args.include?(:Port)
|
374
|
+
Puppet::Util::Log.newdestination(logdest)
|
375
|
+
end
|
364
376
|
|
365
|
-
|
377
|
+
Puppet.settings.use :main, :agent, :device, :ssl
|
366
378
|
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
379
|
+
# We need to specify a ca location for all of the SSL-related
|
380
|
+
# indirected classes to work; in fingerprint mode we just need
|
381
|
+
# access to the local files and we don't need a ca.
|
382
|
+
Puppet::SSL::Host.ca_location = :remote
|
371
383
|
|
372
|
-
|
384
|
+
Puppet::Transaction::Report.indirection.terminus_class = :rest
|
373
385
|
|
374
|
-
|
375
|
-
|
386
|
+
if Puppet[:catalog_cache_terminus]
|
387
|
+
Puppet::Resource::Catalog.indirection.cache_class = Puppet[:catalog_cache_terminus].intern
|
388
|
+
end
|
376
389
|
end
|
377
390
|
end
|
378
391
|
end
|
data/lib/puppet/defaults.rb
CHANGED
@@ -258,10 +258,10 @@ module Puppet
|
|
258
258
|
},
|
259
259
|
:configprint => {
|
260
260
|
:default => "",
|
261
|
-
:desc => "
|
261
|
+
:desc => "Prints the value of a specific configuration setting. If the name of a
|
262
262
|
setting is provided for this, then the value is printed and puppet
|
263
263
|
exits. Comma-separate multiple values. For a list of all values,
|
264
|
-
specify 'all'.",
|
264
|
+
specify 'all'. This setting is deprecated, the 'puppet config' command replaces this functionality.",
|
265
265
|
},
|
266
266
|
:color => {
|
267
267
|
:default => "ansi",
|
@@ -735,7 +735,8 @@ A comma-separated list of alternate DNS names for Puppet Server. These are extra
|
|
735
735
|
hostnames (in addition to its `certname`) that the server is allowed to use when
|
736
736
|
serving agents. Puppet checks this setting when automatically requesting a
|
737
737
|
certificate for Puppet agent or Puppet Server, and when manually generating a
|
738
|
-
certificate with `puppet cert generate`.
|
738
|
+
certificate with `puppet cert generate`. These can be either IP or DNS, and the type
|
739
|
+
should be specified and followed with a colon. Untyped inputs will default to DNS.
|
739
740
|
|
740
741
|
In order to handle agent requests at a given hostname (like
|
741
742
|
"puppet.example.com"), Puppet Server needs a certificate that proves it's
|
@@ -1621,7 +1622,9 @@ EOT
|
|
1621
1622
|
:type => :boolean,
|
1622
1623
|
:desc => "Whether to only use the cached catalog rather than compiling a new catalog
|
1623
1624
|
on every run. Puppet can be run with this enabled by default and then selectively
|
1624
|
-
disabled when a recompile is desired.
|
1625
|
+
disabled when a recompile is desired. Because a Puppet agent using cached catalogs
|
1626
|
+
does not contact the master for a new catalog, it also does not upload facts at
|
1627
|
+
the beginning of the Puppet run.",
|
1625
1628
|
},
|
1626
1629
|
:ignoremissingtypes => {
|
1627
1630
|
:default => false,
|
data/lib/puppet/environments.rb
CHANGED
@@ -443,10 +443,9 @@ module Puppet::Environments
|
|
443
443
|
# Also clears caches in Settings that may prevent the entry from being updated
|
444
444
|
def evict_if_expired(name)
|
445
445
|
if (result = @cache[name]) && (result.expired? || @cache_expiration_service.expired?(name))
|
446
|
-
|
447
|
-
@cache.delete(name)
|
446
|
+
Puppet.debug {"Evicting cache entry for environment '#{name}'"}
|
448
447
|
@cache_expiration_service.evicted(name)
|
449
|
-
|
448
|
+
clear(name)
|
450
449
|
Puppet.settings.clear_environment_settings(name)
|
451
450
|
end
|
452
451
|
end
|
data/lib/puppet/face/config.rb
CHANGED
@@ -39,7 +39,7 @@ Puppet::Face.define(:config, '0.0.1') do
|
|
39
39
|
description <<-'EOT'
|
40
40
|
Prints the value of a single setting or a list of settings.
|
41
41
|
|
42
|
-
This action is
|
42
|
+
This action is a replacement interface to the information available with
|
43
43
|
`puppet <subcommand> --configprint`.
|
44
44
|
EOT
|
45
45
|
notes <<-'EOT'
|
@@ -52,6 +52,9 @@ Puppet::Face.define(:module, '1.0.0') do
|
|
52
52
|
end
|
53
53
|
end
|
54
54
|
|
55
|
+
#TRANSLATORS 'puppet module build' is the name of the puppet command and 'Puppet Development Kit' is the name of the software package replacing this action and should not be translated.
|
56
|
+
Puppet.deprecation_warning _("`puppet module build` is deprecated and will be removed in a future release. This action has been replaced by Puppet Development Kit. For more information visit https://puppet.com/docs/pdk/latest/pdk.html.")
|
57
|
+
|
55
58
|
Puppet::ModuleTool.set_option_defaults options
|
56
59
|
Puppet::ModuleTool::Applications::Builder.run(module_path, options)
|
57
60
|
end
|
@@ -60,5 +63,7 @@ Puppet::Face.define(:module, '1.0.0') do
|
|
60
63
|
# Get the string representation of the Pathname object.
|
61
64
|
_("Module built: %{path}") % { path: return_value.expand_path.to_s }
|
62
65
|
end
|
66
|
+
|
67
|
+
deprecate
|
63
68
|
end
|
64
69
|
end
|
@@ -6,6 +6,7 @@ module Puppet::GettextConfig
|
|
6
6
|
POSIX_PATH = File.absolute_path('../../../../../share/locale', File.dirname(__FILE__))
|
7
7
|
WINDOWS_PATH = File.absolute_path('../../../../../../../puppet/share/locale', File.dirname(__FILE__))
|
8
8
|
|
9
|
+
# This is the only domain name that won't be a symbol, making it unique from environments.
|
9
10
|
DEFAULT_TEXT_DOMAIN = 'default-text-domain'
|
10
11
|
|
11
12
|
# Load gettext helpers and track whether they're available.
|
@@ -59,10 +60,12 @@ module Puppet::GettextConfig
|
|
59
60
|
# Clears the translation repository for the given text domain,
|
60
61
|
# creating it if it doesn't exist, then adds default translations
|
61
62
|
# and switches to using this domain.
|
62
|
-
# @param [String] domain_name the name of the domain to create
|
63
|
+
# @param [String, Symbol] domain_name the name of the domain to create
|
63
64
|
def self.reset_text_domain(domain_name)
|
64
65
|
return if @gettext_disabled || !gettext_loaded?
|
66
|
+
domain_name = domain_name.to_sym
|
65
67
|
|
68
|
+
Puppet.debug "Reset text domain to #{domain_name.inspect}"
|
66
69
|
FastGettext.add_text_domain(domain_name,
|
67
70
|
type: :chain,
|
68
71
|
chain: [],
|
@@ -71,6 +74,18 @@ module Puppet::GettextConfig
|
|
71
74
|
FastGettext.text_domain = domain_name
|
72
75
|
end
|
73
76
|
|
77
|
+
# @api private
|
78
|
+
# Resets the thread's configured text_domain to the default text domain.
|
79
|
+
# In Puppet Server, thread A may process a compile request that configures
|
80
|
+
# a domain, while thread B may invalidate that environment and delete the
|
81
|
+
# domain. That leaves thread A with an invalid text_domain selected.
|
82
|
+
# To avoid that, clear_text_domain after any processing that needs the
|
83
|
+
# non-default text domain.
|
84
|
+
def self.clear_text_domain
|
85
|
+
return if @gettext_disabled || !gettext_loaded?
|
86
|
+
FastGettext.text_domain = nil
|
87
|
+
end
|
88
|
+
|
74
89
|
# @api private
|
75
90
|
# Creates a default text domain containing the translations for
|
76
91
|
# Puppet as the start of chain. When semantic_puppet gets initialized,
|
@@ -94,12 +109,16 @@ module Puppet::GettextConfig
|
|
94
109
|
|
95
110
|
# @api private
|
96
111
|
# Switches the active text domain, if the requested domain exists.
|
97
|
-
# @param [String] domain_name the name of the domain to switch to
|
112
|
+
# @param [String, Symbol] domain_name the name of the domain to switch to
|
98
113
|
def self.use_text_domain(domain_name)
|
99
114
|
return if @gettext_disabled || !gettext_loaded?
|
115
|
+
domain_name = domain_name.to_sym
|
100
116
|
|
101
117
|
if FastGettext.translation_repositories.include?(domain_name)
|
118
|
+
Puppet.debug "Use text domain #{domain_name.inspect}"
|
102
119
|
FastGettext.text_domain = domain_name
|
120
|
+
else
|
121
|
+
Puppet.debug "Requested unknown text domain #{domain_name.inspect}"
|
103
122
|
end
|
104
123
|
end
|
105
124
|
|
@@ -113,13 +132,17 @@ module Puppet::GettextConfig
|
|
113
132
|
|
114
133
|
# @api private
|
115
134
|
# Deletes the text domain with the given name
|
116
|
-
# @param [String] domain_name the name of the domain to delete
|
135
|
+
# @param [String, Symbol] domain_name the name of the domain to delete
|
117
136
|
def self.delete_text_domain(domain_name)
|
118
137
|
return if @gettext_disabled || !gettext_loaded?
|
138
|
+
domain_name = domain_name.to_sym
|
119
139
|
|
120
|
-
FastGettext.translation_repositories.delete(domain_name)
|
140
|
+
deleted = FastGettext.translation_repositories.delete(domain_name)
|
121
141
|
if FastGettext.text_domain == domain_name
|
142
|
+
Puppet.debug "Deleted current text domain #{domain_name.inspect}: #{!deleted.nil?}"
|
122
143
|
FastGettext.text_domain = nil
|
144
|
+
else
|
145
|
+
Puppet.debug "Deleted text domain #{domain_name.inspect}: #{!deleted.nil?}"
|
123
146
|
end
|
124
147
|
end
|
125
148
|
|
@@ -145,7 +168,7 @@ module Puppet::GettextConfig
|
|
145
168
|
# Since we are currently (Nov 2017) vendoring semantic_puppet, in normal
|
146
169
|
# flows these translations will be copied along with Puppet's.
|
147
170
|
#
|
148
|
-
# @param [
|
171
|
+
# @param [Symbol] domain_name the name of the domain to add translations to
|
149
172
|
def self.copy_default_translations(domain_name)
|
150
173
|
return if @gettext_disabled || !gettext_loaded?
|
151
174
|
|
@@ -49,14 +49,12 @@ class Puppet::Resource::Catalog::Compiler < Puppet::Indirector::Code
|
|
49
49
|
node = node_from_request(facts, request)
|
50
50
|
node.trusted_data = Puppet.lookup(:trusted_information) { Puppet::Context::TrustedInformation.local(node) }.to_h
|
51
51
|
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
52
|
+
if node.environment
|
53
|
+
node.environment.with_text_domain do
|
54
|
+
compile(node, request.options)
|
55
|
+
end
|
56
56
|
else
|
57
|
-
|
58
|
-
# a config or raise an exception.
|
59
|
-
return nil
|
57
|
+
compile(node, request.options)
|
60
58
|
end
|
61
59
|
end
|
62
60
|
|
@@ -435,7 +435,7 @@ class Puppet::Node::Environment
|
|
435
435
|
|
436
436
|
# Loads module translations for the current environment once for
|
437
437
|
# the lifetime of the environment.
|
438
|
-
def
|
438
|
+
def with_text_domain
|
439
439
|
return if Puppet[:disable_i18n]
|
440
440
|
|
441
441
|
if @text_domain.nil?
|
@@ -445,6 +445,10 @@ class Puppet::Node::Environment
|
|
445
445
|
else
|
446
446
|
Puppet::GettextConfig.use_text_domain(@text_domain)
|
447
447
|
end
|
448
|
+
|
449
|
+
yield
|
450
|
+
ensure
|
451
|
+
Puppet::GettextConfig.clear_text_domain
|
448
452
|
end
|
449
453
|
|
450
454
|
# Checks if a reparse is required (cache of files is stale).
|
@@ -22,7 +22,7 @@ Puppet::Type.type(:selmodule).provide(:semodule) do
|
|
22
22
|
self.debug "Checking for module #{@resource[:name]}"
|
23
23
|
execpipe("#{command(:semodule)} --list") do |out|
|
24
24
|
out.each_line do |line|
|
25
|
-
if line =~
|
25
|
+
if line =~ /^#{@resource[:name]}\b/
|
26
26
|
return :true
|
27
27
|
end
|
28
28
|
end
|
@@ -16,6 +16,8 @@ Puppet::Type.type(:service).provide :upstart, :parent => :debian do
|
|
16
16
|
Facter.value(:operatingsystem) == 'LinuxMint',
|
17
17
|
]
|
18
18
|
|
19
|
+
confine :exists => "/var/run/upstart-socket-bridge.pid"
|
20
|
+
|
19
21
|
defaultfor :operatingsystem => :ubuntu, :operatingsystemmajrelease => ["10.04", "12.04", "14.04", "14.10"]
|
20
22
|
|
21
23
|
commands :start => "/sbin/start",
|
@@ -54,6 +54,12 @@ config.header = <<EOT
|
|
54
54
|
|
55
55
|
* Each of these settings can be specified in `puppet.conf` or on the
|
56
56
|
command line.
|
57
|
+
* Puppet Enterprise (PE) and open source Puppet share the configuration settings
|
58
|
+
that are documented here. However, PE defaults for some settings differ from
|
59
|
+
the open source Puppet defaults. Some examples of settings that have different
|
60
|
+
PE defaults include `disable18n`, `environment_timeout`, `always_retry_plugins`,
|
61
|
+
and the Puppet Server JRuby `max-active-instances` setting. To verify PE
|
62
|
+
configuration defaults, check the `puppet.conf` file after installation.
|
57
63
|
* When using boolean settings on the command line, use `--setting` and
|
58
64
|
`--no-setting` instead of `--setting (true|false)`. (Using `--setting false`
|
59
65
|
results in "Error: Could not parse application options: needless argument".)
|
@@ -193,6 +193,7 @@ module Puppet
|
|
193
193
|
@changed = data['changed']
|
194
194
|
@skipped = data['skipped']
|
195
195
|
@failed = data['failed']
|
196
|
+
@failed_to_restart = data['failed_to_restart']
|
196
197
|
@corrective_change = data['corrective_change']
|
197
198
|
@events = data['events'].map do |event|
|
198
199
|
# Older versions contain tags that causes Psych to create instances directly
|
@@ -213,6 +214,7 @@ module Puppet
|
|
213
214
|
'tags' => @tags.to_a,
|
214
215
|
'time' => @time.iso8601(9),
|
215
216
|
'failed' => @failed,
|
217
|
+
'failed_to_restart' => self.failed_to_restart?,
|
216
218
|
'changed' => @changed,
|
217
219
|
'out_of_sync' => @out_of_sync,
|
218
220
|
'skipped' => @skipped,
|
@@ -208,7 +208,7 @@ class Puppet::Resource::TypeCollection
|
|
208
208
|
if environment.config_version.nil? || environment.config_version == ""
|
209
209
|
@version = Time.now.to_i
|
210
210
|
else
|
211
|
-
@version = Puppet::Util::Execution.execute([environment.config_version]).strip
|
211
|
+
@version = Puppet::Util::Execution.execute([environment.config_version]).to_s.strip
|
212
212
|
end
|
213
213
|
end
|
214
214
|
|
data/lib/puppet/settings.rb
CHANGED
@@ -452,6 +452,12 @@ class Puppet::Settings
|
|
452
452
|
# Prints the contents of a config file with the available config settings, or it
|
453
453
|
# prints a single value of a config setting.
|
454
454
|
def print_config_options
|
455
|
+
if Puppet::Util::Log.sendlevel?(:info)
|
456
|
+
Puppet::Util::Log.newdestination(:console)
|
457
|
+
message = (_("Using --configprint is deprecated. Use 'puppet config <subcommand>' instead."))
|
458
|
+
Puppet.deprecation_warning(message)
|
459
|
+
end
|
460
|
+
|
455
461
|
env = value(:environment)
|
456
462
|
val = value(:configprint)
|
457
463
|
if val == "all"
|
@@ -262,9 +262,17 @@ DOC
|
|
262
262
|
end
|
263
263
|
|
264
264
|
if options[:dns_alt_names]
|
265
|
-
|
266
|
-
|
267
|
-
|
265
|
+
raw_names = options[:dns_alt_names].split(/\s*,\s*/).map(&:strip) + [name]
|
266
|
+
|
267
|
+
parsed_names = raw_names.map do |name|
|
268
|
+
if !name.start_with?("IP:") && !name.start_with?("DNS:")
|
269
|
+
"DNS:#{name}"
|
270
|
+
else
|
271
|
+
name
|
272
|
+
end
|
273
|
+
end.sort.uniq.join(", ")
|
274
|
+
|
275
|
+
alt_names_ext = extension_factory.create_extension("subjectAltName", parsed_names, false)
|
268
276
|
|
269
277
|
extensions << alt_names_ext
|
270
278
|
end
|