puppet 5.5.17-x64-mingw32 → 5.5.18-x64-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.
- checksums.yaml +4 -4
- data/CODEOWNERS +1 -1
- data/Gemfile +2 -3
- data/Gemfile.lock +35 -31
- data/ext/build_defaults.yaml +1 -0
- data/ext/cert_inspector +3 -3
- data/ext/puppet-test +2 -2
- data/ext/regexp_nodes/regexp_nodes.rb +4 -4
- data/ext/windows/service/daemon.rb +54 -8
- data/install.rb +6 -6
- data/lib/puppet/application.rb +1 -1
- data/lib/puppet/application/apply.rb +2 -2
- data/lib/puppet/application/describe.rb +3 -9
- data/lib/puppet/application/doc.rb +1 -1
- data/lib/puppet/application/lookup.rb +1 -1
- data/lib/puppet/application/script.rb +2 -2
- data/lib/puppet/configurer.rb +86 -28
- data/lib/puppet/configurer/downloader.rb +2 -6
- data/lib/puppet/defaults.rb +17 -4
- data/lib/puppet/error.rb +9 -1
- data/lib/puppet/external/nagios/base.rb +1 -1
- data/lib/puppet/face/ca.rb +1 -1
- data/lib/puppet/face/module/list.rb +5 -5
- data/lib/puppet/face/module/search.rb +1 -1
- data/lib/puppet/face/module/uninstall.rb +1 -1
- data/lib/puppet/face/module/upgrade.rb +1 -1
- data/lib/puppet/file_serving/http_metadata.rb +1 -1
- data/lib/puppet/file_system.rb +0 -8
- data/lib/puppet/file_system/memory_file.rb +1 -1
- data/lib/puppet/file_system/posix.rb +3 -2
- data/lib/puppet/forge.rb +3 -3
- data/lib/puppet/functions/epp.rb +4 -4
- data/lib/puppet/functions/inline_epp.rb +5 -5
- data/lib/puppet/gettext/module_translations.rb +1 -1
- data/lib/puppet/graph/rb_tree_map.rb +2 -2
- data/lib/puppet/graph/simple_graph.rb +6 -5
- data/lib/puppet/indirector/file_bucket_file/file.rb +1 -1
- data/lib/puppet/indirector/hiera.rb +2 -0
- data/lib/puppet/indirector/resource/ral.rb +1 -3
- data/lib/puppet/indirector/resource/validator.rb +1 -1
- data/lib/puppet/interface.rb +2 -1
- data/lib/puppet/loaders.rb +0 -1
- data/lib/puppet/metatype/manager.rb +1 -1
- data/lib/puppet/module.rb +1 -1
- data/lib/puppet/module_tool/applications/builder.rb +1 -1
- data/lib/puppet/module_tool/applications/installer.rb +1 -1
- data/lib/puppet/module_tool/applications/uninstaller.rb +3 -3
- data/lib/puppet/module_tool/metadata.rb +1 -1
- data/lib/puppet/module_tool/shared_behaviors.rb +4 -4
- data/lib/puppet/module_tool/tar/mini.rb +1 -1
- data/lib/puppet/network/http/api/indirected_routes.rb +12 -11
- data/lib/puppet/network/http/connection.rb +10 -12
- data/lib/puppet/network/http/pool.rb +2 -0
- data/lib/puppet/network/http/rack/rest.rb +2 -2
- data/lib/puppet/network/http/site.rb +1 -1
- data/lib/puppet/network/resolver.rb +2 -2
- data/lib/puppet/node/environment.rb +4 -2
- data/lib/puppet/parser/ast.rb +1 -1
- data/lib/puppet/parser/ast/resourceparam.rb +1 -1
- data/lib/puppet/parser/functions.rb +1 -1
- data/lib/puppet/parser/functions/epp.rb +3 -3
- data/lib/puppet/parser/functions/inline_epp.rb +5 -5
- data/lib/puppet/pops/evaluator/collectors/catalog_collector.rb +1 -1
- data/lib/puppet/pops/evaluator/collectors/exported_collector.rb +1 -1
- data/lib/puppet/pops/evaluator/external_syntax_support.rb +3 -2
- data/lib/puppet/pops/evaluator/runtime3_support.rb +4 -4
- data/lib/puppet/pops/loaders.rb +1 -1
- data/lib/puppet/pops/lookup/hiera_config.rb +1 -0
- data/lib/puppet/pops/lookup/sub_lookup.rb +1 -1
- data/lib/puppet/pops/merge_strategy.rb +22 -18
- data/lib/puppet/pops/parser/heredoc_support.rb +1 -1
- data/lib/puppet/pops/parser/interpolation_support.rb +4 -4
- data/lib/puppet/pops/parser/locator.rb +1 -1
- data/lib/puppet/pops/parser/pn_parser.rb +17 -16
- data/lib/puppet/pops/puppet_stack.rb +51 -48
- data/lib/puppet/pops/types/p_sensitive_type.rb +1 -1
- data/lib/puppet/pops/types/string_converter.rb +10 -10
- data/lib/puppet/pops/types/types.rb +3 -3
- data/lib/puppet/property.rb +1 -1
- data/lib/puppet/property/ensure.rb +1 -1
- data/lib/puppet/provider/augeas/augeas.rb +1 -1
- data/lib/puppet/provider/cron/crontab.rb +1 -1
- data/lib/puppet/provider/exec.rb +6 -2
- data/lib/puppet/provider/mount.rb +1 -1
- data/lib/puppet/provider/mount/parsed.rb +8 -8
- data/lib/puppet/provider/nameservice/directoryservice.rb +1 -1
- data/lib/puppet/provider/nameservice/pw.rb +2 -2
- data/lib/puppet/provider/package/dnfmodule.rb +87 -0
- data/lib/puppet/provider/package/dpkg.rb +3 -12
- data/lib/puppet/provider/package/openbsd.rb +1 -1
- data/lib/puppet/provider/package/pip.rb +34 -9
- data/lib/puppet/provider/package/portage.rb +4 -4
- data/lib/puppet/provider/package/rpm.rb +6 -6
- data/lib/puppet/provider/package/windows/package.rb +1 -1
- data/lib/puppet/provider/package/yum.rb +1 -1
- data/lib/puppet/provider/package_targetable.rb +5 -4
- data/lib/puppet/provider/parsedfile.rb +1 -1
- data/lib/puppet/provider/scheduled_task/win32_taskscheduler.rb +3 -3
- data/lib/puppet/provider/service/daemontools.rb +9 -9
- data/lib/puppet/provider/service/openbsd.rb +1 -1
- data/lib/puppet/provider/service/rcng.rb +2 -2
- data/lib/puppet/provider/service/runit.rb +2 -8
- data/lib/puppet/provider/service/systemd.rb +8 -8
- data/lib/puppet/provider/user/directoryservice.rb +1 -1
- data/lib/puppet/provider/user/hpux.rb +1 -1
- data/lib/puppet/provider/user/user_role_add.rb +1 -1
- data/lib/puppet/provider/user/useradd.rb +22 -13
- data/lib/puppet/provider/user/windows_adsi.rb +4 -5
- data/lib/puppet/provider/yumrepo/inifile.rb +2 -2
- data/lib/puppet/reference/indirection.rb +2 -2
- data/lib/puppet/reference/metaparameter.rb +1 -3
- data/lib/puppet/reference/providers.rb +1 -1
- data/lib/puppet/reference/type.rb +3 -9
- data/lib/puppet/reports.rb +1 -1
- data/lib/puppet/resource.rb +1 -1
- data/lib/puppet/resource/catalog.rb +1 -1
- data/lib/puppet/settings.rb +3 -3
- data/lib/puppet/settings/environment_conf.rb +1 -0
- data/lib/puppet/ssl/certificate_authority/interface.rb +1 -1
- data/lib/puppet/ssl/certificate_factory.rb +2 -2
- data/lib/puppet/ssl/host.rb +3 -3
- data/lib/puppet/ssl/oids.rb +1 -1
- data/lib/puppet/transaction/report.rb +1 -1
- data/lib/puppet/type.rb +2 -4
- data/lib/puppet/type/cron.rb +1 -1
- data/lib/puppet/type/exec.rb +7 -3
- data/lib/puppet/type/file.rb +1 -2
- data/lib/puppet/type/file/data_sync.rb +5 -1
- data/lib/puppet/type/group.rb +4 -2
- data/lib/puppet/type/interface.rb +1 -1
- data/lib/puppet/type/notify.rb +3 -2
- data/lib/puppet/type/package.rb +2 -2
- data/lib/puppet/type/schedule.rb +1 -1
- data/lib/puppet/type/selboolean.rb +17 -3
- data/lib/puppet/type/service.rb +1 -1
- data/lib/puppet/type/user.rb +4 -2
- data/lib/puppet/util.rb +35 -12
- data/lib/puppet/util/command_line/trollop.rb +1 -1
- data/lib/puppet/util/http_proxy.rb +8 -14
- data/lib/puppet/util/instance_loader.rb +1 -1
- data/lib/puppet/util/log.rb +1 -1
- data/lib/puppet/util/log/destinations.rb +2 -2
- data/lib/puppet/util/logging.rb +30 -18
- data/lib/puppet/util/metric.rb +2 -2
- data/lib/puppet/util/monkey_patches.rb +1 -1
- data/lib/puppet/util/nagios_maker.rb +2 -2
- data/lib/puppet/util/network_device/cisco/device.rb +1 -1
- data/lib/puppet/util/network_device/cisco/interface.rb +2 -2
- data/lib/puppet/util/network_device/transport/ssh.rb +1 -1
- data/lib/puppet/util/provider_features.rb +2 -4
- data/lib/puppet/util/rdoc.rb +1 -1
- data/lib/puppet/util/reference.rb +1 -1
- data/lib/puppet/util/resource_template.rb +1 -1
- data/lib/puppet/util/selinux.rb +3 -1
- data/lib/puppet/util/windows/adsi.rb +58 -28
- data/lib/puppet/util/windows/registry.rb +7 -5
- data/lib/puppet/vendor.rb +1 -1
- data/lib/puppet/version.rb +1 -1
- data/lib/puppet_pal.rb +2 -2
- data/locales/puppet.pot +115 -95
- data/man/man5/puppet.conf.5 +21 -5
- data/man/man8/puppet-agent.8 +1 -1
- data/man/man8/puppet-apply.8 +1 -1
- data/man/man8/puppet-ca.8 +1 -1
- data/man/man8/puppet-catalog.8 +1 -1
- data/man/man8/puppet-cert.8 +1 -1
- data/man/man8/puppet-certificate.8 +1 -1
- 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 +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-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/fixtures/unit/provider/package/dnfmodule/dnf-module-list-installed.txt +11 -0
- data/spec/integration/configurer_spec.rb +52 -0
- data/spec/integration/type/notify_spec.rb +46 -0
- data/spec/unit/configurer_spec.rb +380 -397
- data/spec/unit/forge/forge_spec.rb +1 -3
- data/spec/unit/forge/repository_spec.rb +1 -3
- data/spec/unit/indirector/resource/ral_spec.rb +4 -4
- data/spec/unit/network/http/connection_spec.rb +26 -0
- data/spec/unit/pops/evaluator/evaluating_parser_spec.rb +8 -3
- data/spec/unit/provider/exec_spec.rb +209 -0
- data/spec/unit/provider/package/dnfmodule_spec.rb +186 -0
- data/spec/unit/provider/package/dpkg_spec.rb +15 -3
- data/spec/unit/provider/package/pip_spec.rb +51 -6
- data/spec/unit/provider/package/portage_spec.rb +4 -4
- data/spec/unit/provider/package_targetable_spec.rb +60 -0
- data/spec/unit/provider/service/daemontools_spec.rb +24 -0
- data/spec/unit/provider/service/runit_spec.rb +24 -0
- data/spec/unit/provider/service/systemd_spec.rb +22 -22
- data/spec/unit/provider/user/hpux_spec.rb +2 -2
- data/spec/unit/provider/user/useradd_spec.rb +46 -0
- data/spec/unit/type/exec_spec.rb +6 -12
- data/spec/unit/type/file/content_spec.rb +9 -3
- data/spec/unit/type/file_spec.rb +9 -4
- data/spec/unit/type/selboolean_spec.rb +4 -6
- data/spec/unit/util/execution_spec.rb +16 -0
- data/spec/unit/util/http_proxy_spec.rb +97 -0
- data/spec/unit/util/log/destinations_spec.rb +7 -3
- data/spec/unit/util/log_spec.rb +0 -138
- data/spec/unit/util/logging_spec.rb +200 -0
- data/spec/unit/util/windows/adsi_spec.rb +51 -0
- data/tasks/manpages.rake +1 -0
- metadata +12 -5
- data/lib/puppet/pops/loader/null_loader.rb +0 -60
- data/locales/ja/puppet.po +0 -12114
@@ -19,9 +19,7 @@ etc.), prevent Puppet from making changes (`noop`), and change logging verbosity
|
|
19
19
|
params << param
|
20
20
|
}
|
21
21
|
|
22
|
-
params.
|
23
|
-
a.to_s <=> b.to_s
|
24
|
-
}.each { |param|
|
22
|
+
params.sort_by(&:to_s).each { |param|
|
25
23
|
str << markdown_header(param.to_s, 3)
|
26
24
|
str << scrub(Puppet::Type.metaparamdoc(param))
|
27
25
|
str << "\n\n"
|
@@ -35,7 +35,7 @@ providers = Puppet::Util::Reference.newreference :providers, :title => "Provider
|
|
35
35
|
functional = false
|
36
36
|
notes = []
|
37
37
|
default = type.defaultprovider ? type.defaultprovider.name : 'none'
|
38
|
-
type.providers.
|
38
|
+
type.providers.sort_by(&:to_s).each do |pname|
|
39
39
|
data = []
|
40
40
|
table_data[pname] = data
|
41
41
|
provider = type.provider(pname)
|
@@ -49,9 +49,7 @@ Puppet::Util::Reference.newreference :type, :doc => "All Puppet resource types a
|
|
49
49
|
|
50
50
|
}
|
51
51
|
|
52
|
-
types.
|
53
|
-
a.to_s <=> b.to_s
|
54
|
-
}.each { |name,type|
|
52
|
+
types.sort_by(&:to_s).each { |name,type|
|
55
53
|
|
56
54
|
str << "
|
57
55
|
|
@@ -69,9 +67,7 @@ Puppet::Util::Reference.newreference :type, :doc => "All Puppet resource types a
|
|
69
67
|
end
|
70
68
|
|
71
69
|
docs = {}
|
72
|
-
type.validproperties.
|
73
|
-
a.to_s <=> b.to_s
|
74
|
-
}.reject { |sname|
|
70
|
+
type.validproperties.sort_by(&:to_s).reject { |sname|
|
75
71
|
property = type.propertybyname(sname)
|
76
72
|
property.nodoc
|
77
73
|
}.each { |sname|
|
@@ -91,9 +87,7 @@ Puppet::Util::Reference.newreference :type, :doc => "All Puppet resource types a
|
|
91
87
|
}
|
92
88
|
|
93
89
|
str << markdown_header("Parameters", 4) + "\n"
|
94
|
-
type.parameters.
|
95
|
-
a.to_s <=> b.to_s
|
96
|
-
}.each { |type_name, param|
|
90
|
+
type.parameters.sort_by(&:to_s).each { |type_name, param|
|
97
91
|
docs[type_name] = scrub(type.paramdoc(type_name))
|
98
92
|
}
|
99
93
|
|
data/lib/puppet/reports.rb
CHANGED
@@ -74,7 +74,7 @@ class Puppet::Reports
|
|
74
74
|
|
75
75
|
# Use this method so they all get loaded
|
76
76
|
instance_loader(:report).loadall
|
77
|
-
loaded_instances(:report).
|
77
|
+
loaded_instances(:report).sort_by(&:to_s).each do |name|
|
78
78
|
mod = self.report(name)
|
79
79
|
docs << "#{name}\n#{"-" * name.to_s.length}\n"
|
80
80
|
|
data/lib/puppet/resource.rb
CHANGED
@@ -647,7 +647,7 @@ class Puppet::Resource::Catalog < Puppet::Graph::SimpleGraph
|
|
647
647
|
result.add_resource newres
|
648
648
|
end
|
649
649
|
|
650
|
-
message = convert.to_s.
|
650
|
+
message = convert.to_s.tr "_", " "
|
651
651
|
edges.each do |edge|
|
652
652
|
# Skip edges between virtual resources.
|
653
653
|
next if virtual_not_exported?(edge.source)
|
data/lib/puppet/settings.rb
CHANGED
@@ -1229,10 +1229,10 @@ Generated on #{Time.now}.
|
|
1229
1229
|
if !Puppet::FileSystem.symlink?(configured_environment_path)
|
1230
1230
|
parameters = { :ensure => 'directory' }
|
1231
1231
|
unless Puppet::FileSystem.exist?(configured_environment_path)
|
1232
|
-
parameters
|
1232
|
+
parameters[:mode] = '0750'
|
1233
1233
|
if Puppet.features.root?
|
1234
|
-
parameters
|
1235
|
-
parameters
|
1234
|
+
parameters[:owner] = Puppet[:user] if service_user_available?
|
1235
|
+
parameters[:group] = Puppet[:group] if service_group_available?
|
1236
1236
|
end
|
1237
1237
|
end
|
1238
1238
|
catalog.add_resource(Puppet::Resource.new(:file, configured_environment_path, :parameters => parameters))
|
@@ -26,9 +26,9 @@ module Puppet::SSL::CertificateFactory
|
|
26
26
|
# @return [OpenSSL::X509::Certificate]
|
27
27
|
def self.build(cert_type, csr, issuer, serial, ttl = nil)
|
28
28
|
# Work out if we can even build the requested type of certificate.
|
29
|
-
build_extensions = "build_#{cert_type
|
29
|
+
build_extensions = "build_#{cert_type}_extensions"
|
30
30
|
respond_to?(build_extensions) or
|
31
|
-
raise ArgumentError, _("%{cert_type} is an invalid certificate type!") % { cert_type: cert_type
|
31
|
+
raise ArgumentError, _("%{cert_type} is an invalid certificate type!") % { cert_type: cert_type }
|
32
32
|
|
33
33
|
raise ArgumentError, _("Certificate TTL must be an integer") unless ttl.nil? || ttl.is_a?(Integer)
|
34
34
|
|
data/lib/puppet/ssl/host.rb
CHANGED
@@ -210,7 +210,7 @@ DOC
|
|
210
210
|
raise Puppet::Error, _("No certificate to validate.") unless certificate
|
211
211
|
raise Puppet::Error, _("No private key with which to validate certificate with fingerprint: %{fingerprint}") % { fingerprint: certificate.fingerprint } unless key
|
212
212
|
unless certificate.content.check_private_key(key.content)
|
213
|
-
raise Puppet::Error, _(<<ERROR_STRING) % { fingerprint: certificate.fingerprint, cert_name: Puppet[:certname], ssl_dir: Puppet[:ssldir], cert_dir: Puppet[:certdir].
|
213
|
+
raise Puppet::Error, _(<<ERROR_STRING) % { fingerprint: certificate.fingerprint, cert_name: Puppet[:certname], ssl_dir: Puppet[:ssldir], cert_dir: Puppet[:certdir].tr('/', '\\') }
|
214
214
|
The certificate retrieved from the master does not match the agent's private key. Did you forget to run as root?
|
215
215
|
Certificate fingerprint: %{fingerprint}
|
216
216
|
To fix this, remove the certificate from both the master and the agent and then start a puppet run, which will automatically regenerate a certificate.
|
@@ -235,7 +235,7 @@ ERROR_STRING
|
|
235
235
|
if !existing_request.nil? &&
|
236
236
|
(key.content.public_key.to_s != existing_request.content.public_key.to_s)
|
237
237
|
|
238
|
-
raise Puppet::Error, _(<<ERROR_STRING) % { fingerprint: existing_request.fingerprint, csr_public_key: existing_request.content.public_key.to_text, agent_public_key: key.content.public_key.to_text, cert_name: Puppet[:certname], ssl_dir: Puppet[:ssldir], cert_dir: Puppet[:certdir].
|
238
|
+
raise Puppet::Error, _(<<ERROR_STRING) % { fingerprint: existing_request.fingerprint, csr_public_key: existing_request.content.public_key.to_text, agent_public_key: key.content.public_key.to_text, cert_name: Puppet[:certname], ssl_dir: Puppet[:ssldir], cert_dir: Puppet[:certdir].tr('/', '\\') }
|
239
239
|
The CSR retrieved from the master does not match the agent's public key.
|
240
240
|
CSR fingerprint: %{fingerprint}
|
241
241
|
CSR public key: %{csr_public_key}
|
@@ -345,7 +345,7 @@ ERROR_STRING
|
|
345
345
|
exit(1)
|
346
346
|
end
|
347
347
|
|
348
|
-
|
348
|
+
loop do
|
349
349
|
sleep time
|
350
350
|
begin
|
351
351
|
break if certificate
|
data/lib/puppet/ssl/oids.rb
CHANGED
@@ -101,7 +101,7 @@ module Puppet::SSL::Oids
|
|
101
101
|
# shortname: 'myothershortname'
|
102
102
|
# longname: 'Other Long name'
|
103
103
|
def self.parse_custom_oid_file(custom_oid_file, map_key='oid_mapping')
|
104
|
-
if File.
|
104
|
+
if File.exist?(custom_oid_file) && File.readable?(custom_oid_file)
|
105
105
|
mapping = nil
|
106
106
|
begin
|
107
107
|
mapping = YAML.load_file(custom_oid_file)
|
@@ -346,7 +346,7 @@ class Puppet::Transaction::Report
|
|
346
346
|
report = raw_summary
|
347
347
|
|
348
348
|
ret = ""
|
349
|
-
report.keys.
|
349
|
+
report.keys.sort_by(&:to_s).each do |key|
|
350
350
|
ret += "#{Puppet::Util::Metric.labelize(key)}:\n"
|
351
351
|
|
352
352
|
report[key].keys.sort { |a,b|
|
data/lib/puppet/type.rb
CHANGED
@@ -1447,7 +1447,7 @@ class Type
|
|
1447
1447
|
}
|
1448
1448
|
|
1449
1449
|
Tags are useful for things like applying a subset of a host's configuration
|
1450
|
-
with [the `tags` setting](/puppet/latest/configuration.html#tags)
|
1450
|
+
with [the `tags` setting](https://puppet.com/docs/puppet/latest/configuration.html#tags)
|
1451
1451
|
(e.g. `puppet agent --test --tags bootstrap`)."
|
1452
1452
|
|
1453
1453
|
munge do |tags|
|
@@ -1909,9 +1909,7 @@ end
|
|
1909
1909
|
# Since we're mixing @doc with text from other sources, we must normalize
|
1910
1910
|
# its indentation with scrub. But we don't need to manually scrub the
|
1911
1911
|
# provider's doc string, since markdown_definitionlist sanitizes its inputs.
|
1912
|
-
scrub(@doc) + "Available providers are:\n\n" + parenttype.providers.
|
1913
|
-
a.to_s <=> b.to_s
|
1914
|
-
}.collect { |i|
|
1912
|
+
scrub(@doc) + "Available providers are:\n\n" + parenttype.providers.sort_by(&:to_s).collect { |i|
|
1915
1913
|
markdown_definitionlist( i, scrub(parenttype().provider(i).doc) )
|
1916
1914
|
}.join
|
1917
1915
|
end
|
data/lib/puppet/type/cron.rb
CHANGED
data/lib/puppet/type/exec.rb
CHANGED
@@ -150,9 +150,13 @@ module Puppet
|
|
150
150
|
end
|
151
151
|
end
|
152
152
|
unless log == :false
|
153
|
-
@
|
154
|
-
self.send(log,
|
155
|
-
|
153
|
+
if @resource.parameter(:command).sensitive
|
154
|
+
self.send(log, "[output redacted]")
|
155
|
+
else
|
156
|
+
@output.split(/\n/).each { |line|
|
157
|
+
self.send(log, line)
|
158
|
+
}
|
159
|
+
end
|
156
160
|
end
|
157
161
|
end
|
158
162
|
|
data/lib/puppet/type/file.rb
CHANGED
@@ -572,8 +572,7 @@ Puppet::Type.newtype(:file) do
|
|
572
572
|
# remote system.
|
573
573
|
mark_children_for_purging(children) if self.purge?
|
574
574
|
|
575
|
-
|
576
|
-
result = children.values.sort { |a, b| a[:path] <=> b[:path] }
|
575
|
+
result = children.values.sort_by { |a| a[:path] }
|
577
576
|
remove_less_specific_files(result)
|
578
577
|
end
|
579
578
|
|
@@ -42,7 +42,11 @@ module Puppet
|
|
42
42
|
send resource[:loglevel], "[diff redacted]"
|
43
43
|
else
|
44
44
|
write_temporarily(param) do |path|
|
45
|
-
|
45
|
+
diff_output = diff(resource[:path], path)
|
46
|
+
if diff_output.encoding == Encoding::BINARY || !diff_output.valid_encoding?
|
47
|
+
diff_output = "Binary files #{resource[:path]} and #{path} differ"
|
48
|
+
end
|
49
|
+
send resource[:loglevel], "\n" + diff_output
|
46
50
|
end
|
47
51
|
end
|
48
52
|
end
|
data/lib/puppet/type/group.rb
CHANGED
@@ -175,7 +175,8 @@ module Puppet
|
|
175
175
|
end
|
176
176
|
|
177
177
|
newparam(:ia_load_module, :required_features => :manages_aix_lam) do
|
178
|
-
desc "The name of the I&A module to use to manage this
|
178
|
+
desc "The name of the I&A module to use to manage this group.
|
179
|
+
This should be set to `files` if managing local groups."
|
179
180
|
end
|
180
181
|
|
181
182
|
newproperty(:attributes, :parent => Puppet::Property::KeyValue, :required_features => :manages_aix_lam) do
|
@@ -216,7 +217,8 @@ module Puppet
|
|
216
217
|
:required_features => :libuser,
|
217
218
|
:parent => Puppet::Parameter::Boolean) do
|
218
219
|
desc "Forces the management of local accounts when accounts are also
|
219
|
-
being managed by some other NSS
|
220
|
+
being managed by some other NSS. For AIX, refer to the
|
221
|
+
`ia_load_module` parameter."
|
220
222
|
defaultto false
|
221
223
|
end
|
222
224
|
|
@@ -105,7 +105,7 @@ Puppet::Type.newtype(:interface) do
|
|
105
105
|
|
106
106
|
def value_to_s(value)
|
107
107
|
value = [value] unless value.is_a?(Array)
|
108
|
-
value.map{ |v| "#{v[1]
|
108
|
+
value.map{ |v| "#{v[1]}/#{v[0]} #{v[2]}"}.join(",")
|
109
109
|
end
|
110
110
|
|
111
111
|
def change_to_s(currentvalue, newvalue)
|
data/lib/puppet/type/notify.rb
CHANGED
@@ -11,11 +11,12 @@ module Puppet
|
|
11
11
|
newproperty(:message, :idempotent => false) do
|
12
12
|
desc "The message to be sent to the log."
|
13
13
|
def sync
|
14
|
+
message = @sensitive ? 'Sensitive [value redacted]' : self.should
|
14
15
|
case @resource["withpath"]
|
15
16
|
when :true
|
16
|
-
send(@resource[:loglevel],
|
17
|
+
send(@resource[:loglevel], message)
|
17
18
|
else
|
18
|
-
Puppet.send(@resource[:loglevel],
|
19
|
+
Puppet.send(@resource[:loglevel], message)
|
19
20
|
end
|
20
21
|
return
|
21
22
|
end
|
data/lib/puppet/type/package.rb
CHANGED
@@ -481,8 +481,8 @@ module Puppet
|
|
481
481
|
end
|
482
482
|
|
483
483
|
newparam(:flavor) do
|
484
|
-
desc "OpenBSD
|
485
|
-
which type of package you want."
|
484
|
+
desc "OpenBSD and DNF modules support 'flavors', which are
|
485
|
+
further specifications for which type of package you want."
|
486
486
|
end
|
487
487
|
|
488
488
|
newparam(:install_only, :boolean => false, :parent => Puppet::Parameter::Boolean, :required_features => :install_only) do
|
data/lib/puppet/type/schedule.rb
CHANGED
@@ -9,9 +9,23 @@ module Puppet
|
|
9
9
|
end
|
10
10
|
|
11
11
|
newproperty(:value) do
|
12
|
-
|
13
|
-
|
14
|
-
|
12
|
+
value_doc = 'Valid values are: "on"/"true"/"off"/"false"'
|
13
|
+
desc <<-EOT
|
14
|
+
Whether the SELinux boolean should be enabled or disabled.
|
15
|
+
#{value_doc}
|
16
|
+
EOT
|
17
|
+
|
18
|
+
newvalues(:on, :off, :true, :false)
|
19
|
+
munge do |value|
|
20
|
+
case value
|
21
|
+
when true, :true, 'true', :on, 'on'
|
22
|
+
:on
|
23
|
+
when false, :false, 'false', :off, 'off'
|
24
|
+
:off
|
25
|
+
else
|
26
|
+
raise ArgumentError, _("Invalid value %{value}. %{doc}") % { value: value.inspect, doc: value_doc}
|
27
|
+
end
|
28
|
+
end
|
15
29
|
end
|
16
30
|
|
17
31
|
newparam(:persistent) do
|
data/lib/puppet/type/service.rb
CHANGED
@@ -228,7 +228,7 @@ module Puppet
|
|
228
228
|
desc "The control variable used to manage services (originally for HP-UX).
|
229
229
|
Defaults to the upcased service name plus `START` replacing dots with
|
230
230
|
underscores, for those providers that support the `controllable` feature."
|
231
|
-
defaultto { resource.name.
|
231
|
+
defaultto { resource.name.tr(".","_").upcase + "_START" if resource.provider.controllable? }
|
232
232
|
end
|
233
233
|
|
234
234
|
newparam :hasrestart do
|
data/lib/puppet/type/user.rb
CHANGED
@@ -614,7 +614,8 @@ module Puppet
|
|
614
614
|
end
|
615
615
|
|
616
616
|
newparam(:ia_load_module, :required_features => :manages_aix_lam) do
|
617
|
-
desc "The name of the I&A module to use to manage this user.
|
617
|
+
desc "The name of the I&A module to use to manage this user.
|
618
|
+
This should be set to `files` if managing local users."
|
618
619
|
end
|
619
620
|
|
620
621
|
newproperty(:attributes, :parent => Puppet::Property::KeyValue, :required_features => :manages_aix_lam) do
|
@@ -665,7 +666,8 @@ module Puppet
|
|
665
666
|
:required_features => :libuser,
|
666
667
|
:parent => Puppet::Parameter::Boolean) do
|
667
668
|
desc "Forces the management of local accounts when accounts are also
|
668
|
-
being managed by some other NSS
|
669
|
+
being managed by some other NSS. For AIX, refer to the
|
670
|
+
`ia_load_module` parameter."
|
669
671
|
defaultto false
|
670
672
|
end
|
671
673
|
|
data/lib/puppet/util.rb
CHANGED
@@ -323,7 +323,7 @@ module Util
|
|
323
323
|
params = { :scheme => 'file' }
|
324
324
|
|
325
325
|
if Puppet.features.microsoft_windows?
|
326
|
-
path = path.
|
326
|
+
path = path.tr('\\', '/')
|
327
327
|
|
328
328
|
if unc = /^\/\/([^\/]+)(\/.+)/.match(path)
|
329
329
|
params[:host] = unc[1]
|
@@ -524,21 +524,44 @@ module Util
|
|
524
524
|
|
525
525
|
module_function :thinmark
|
526
526
|
|
527
|
+
PUPPET_STACK_INSERTION_FRAME = /.*puppet_stack\.rb.*in.*`stack'/
|
528
|
+
|
527
529
|
# utility method to get the current call stack and format it to a human-readable string (which some IDEs/editors
|
528
530
|
# will recognize as links to the line numbers in the trace)
|
529
|
-
def self.pretty_backtrace(backtrace = caller(1))
|
530
|
-
backtrace.
|
531
|
-
|
532
|
-
|
533
|
-
|
534
|
-
|
535
|
-
|
536
|
-
|
537
|
-
|
531
|
+
def self.pretty_backtrace(backtrace = caller(1), puppetstack = [])
|
532
|
+
format_backtrace_array(backtrace, puppetstack).join("\n")
|
533
|
+
end
|
534
|
+
|
535
|
+
# arguments may be a Ruby stack, with an optional Puppet stack argument,
|
536
|
+
# or just a Puppet stack.
|
537
|
+
# stacks may be an Array of Strings "/foo.rb:0 in `blah'" or
|
538
|
+
# an Array of Arrays that represent a frame: ["/foo.pp", 0]
|
539
|
+
def self.format_backtrace_array(primary_stack, puppetstack = [])
|
540
|
+
primary_stack.flat_map do |frame|
|
541
|
+
frame = format_puppetstack_frame(frame) if frame.is_a?(Array)
|
542
|
+
primary_frame = resolve_stackframe(frame)
|
543
|
+
|
544
|
+
if primary_frame =~ PUPPET_STACK_INSERTION_FRAME && !puppetstack.empty?
|
545
|
+
[resolve_stackframe(format_puppetstack_frame(puppetstack.shift)),
|
546
|
+
primary_frame]
|
538
547
|
else
|
539
|
-
|
548
|
+
primary_frame
|
540
549
|
end
|
541
|
-
end
|
550
|
+
end
|
551
|
+
end
|
552
|
+
|
553
|
+
def self.resolve_stackframe(frame)
|
554
|
+
_, path, rest = /^(.*):(\d+.*)$/.match(frame).to_a
|
555
|
+
if path
|
556
|
+
path = Pathname(path).realpath rescue path
|
557
|
+
"#{path}:#{rest}"
|
558
|
+
else
|
559
|
+
frame
|
560
|
+
end
|
561
|
+
end
|
562
|
+
|
563
|
+
def self.format_puppetstack_frame(file_and_lineno)
|
564
|
+
file_and_lineno.join(':')
|
542
565
|
end
|
543
566
|
|
544
567
|
# Replace a file, securely. This takes a block, and passes it the file
|