puppet 6.4.4-x86-mingw32 → 6.4.5-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.
- checksums.yaml +4 -4
- data/CODEOWNERS +1 -1
- data/Gemfile +4 -4
- data/Gemfile.lock +38 -32
- 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 +38 -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/application/ssl.rb +4 -1
- data/lib/puppet/configurer.rb +86 -30
- data/lib/puppet/configurer/downloader.rb +2 -6
- data/lib/puppet/defaults.rb +32 -6
- data/lib/puppet/error.rb +9 -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.rb +1 -2
- data/lib/puppet/functions/camelcase.rb +2 -2
- data/lib/puppet/functions/epp.rb +4 -4
- data/lib/puppet/functions/find_file.rb +9 -9
- 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 +4 -3
- 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/task.rb +20 -4
- 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/site.rb +1 -1
- data/lib/puppet/network/resolver.rb +2 -2
- data/lib/puppet/node/environment.rb +4 -2
- data/lib/puppet/pal/pal_impl.rb +2 -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/parser/scope.rb +8 -7
- 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/loader/task_instantiator.rb +4 -0
- 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 -49
- 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/exec.rb +6 -2
- data/lib/puppet/provider/nameservice/directoryservice.rb +1 -1
- data/lib/puppet/provider/nameservice/pw.rb +2 -2
- data/lib/puppet/provider/package/apt.rb +5 -1
- data/lib/puppet/provider/package/dnfmodule.rb +87 -0
- data/lib/puppet/provider/package/dpkg.rb +34 -18
- 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 +5 -5
- 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/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 +9 -9
- 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/reference/indirection.rb +2 -2
- data/lib/puppet/reference/metaparameter.rb +1 -3
- data/lib/puppet/reference/providers.rb +1 -3
- 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/host.rb +1 -1
- data/lib/puppet/ssl/oids.rb +1 -1
- data/lib/puppet/transaction.rb +33 -11
- data/lib/puppet/transaction/report.rb +1 -1
- data/lib/puppet/type.rb +2 -4
- 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/notify.rb +3 -2
- data/lib/puppet/type/package.rb +10 -3
- data/lib/puppet/type/schedule.rb +1 -1
- 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/log.rb +2 -2
- data/lib/puppet/util/log/destinations.rb +2 -2
- data/lib/puppet/util/logging.rb +32 -20
- data/lib/puppet/util/metric.rb +2 -2
- 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 +48 -18
- 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/x509/cert_provider.rb +13 -6
- data/locales/puppet.pot +199 -159
- data/man/man5/puppet.conf.5 +35 -5
- data/man/man8/puppet-agent.8 +1 -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-key.8 +1 -1
- data/man/man8/puppet-lookup.8 +1 -1
- data/man/man8/puppet-man.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-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/lib/puppet/certificate_factory.rb +2 -2
- data/spec/spec_helper.rb +28 -0
- data/spec/unit/application/ssl_spec.rb +4 -7
- data/spec/unit/configurer_spec.rb +394 -398
- data/spec/unit/defaults_spec.rb +4 -4
- 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 +119 -145
- data/spec/unit/parser/scope_spec.rb +10 -0
- data/spec/unit/pops/evaluator/evaluating_parser_spec.rb +8 -3
- data/spec/unit/pops/loaders/module_loaders_spec.rb +37 -0
- 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 +238 -78
- 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 +25 -25
- data/spec/unit/provider/user/hpux_spec.rb +2 -2
- data/spec/unit/provider/user/useradd_spec.rb +46 -0
- data/spec/unit/ssl/host_spec.rb +0 -5
- data/spec/unit/ssl/state_machine_spec.rb +0 -6
- data/spec/unit/transaction_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/package_spec.rb +5 -0
- data/spec/unit/util/execution_spec.rb +16 -0
- data/spec/unit/util/http_proxy_spec.rb +118 -27
- 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/spec/unit/x509/cert_provider_spec.rb +24 -4
- data/tasks/manpages.rake +1 -0
- metadata +12 -10
- data/lib/puppet/pops/loader/null_loader.rb +0 -60
- data/spec/fixtures/vcr/cassettes/Puppet_Network_HTTP_Connection/when_handling_requests/_request_get/should_yield_to_the_block.yml +0 -24
- data/spec/fixtures/vcr/cassettes/Puppet_Network_HTTP_Connection/when_handling_requests/_request_head/should_yield_to_the_block.yml +0 -24
- data/spec/fixtures/vcr/cassettes/Puppet_Network_HTTP_Connection/when_handling_requests/_request_post/should_yield_to_the_block.yml +0 -24
@@ -125,14 +125,13 @@ Puppet::Type.type(:user).provide :windows_adsi do
|
|
125
125
|
|
126
126
|
def password=(value)
|
127
127
|
if user.disabled?
|
128
|
-
|
128
|
+
info _("The user account '%s' is disabled; The password will still be changed" % @resource[:name])
|
129
129
|
elsif user.locked_out?
|
130
|
-
|
130
|
+
info _("The user account '%s' is locked out; The password will still be changed" % @resource[:name])
|
131
131
|
elsif user.expired?
|
132
|
-
|
133
|
-
else
|
134
|
-
user.password = value
|
132
|
+
info _("The user account '%s' is expired; The password will still be changed" % @resource[:name])
|
135
133
|
end
|
134
|
+
user.password = value
|
136
135
|
end
|
137
136
|
|
138
137
|
def uid
|
@@ -5,14 +5,14 @@ require 'puppet/file_serving/metadata'
|
|
5
5
|
|
6
6
|
reference = Puppet::Util::Reference.newreference :indirection, :doc => "Indirection types and their terminus classes" do
|
7
7
|
text = ""
|
8
|
-
Puppet::Indirector::Indirection.instances.
|
8
|
+
Puppet::Indirector::Indirection.instances.sort_by(&:to_s).each do |indirection|
|
9
9
|
ind = Puppet::Indirector::Indirection.instance(indirection)
|
10
10
|
name = indirection.to_s.capitalize
|
11
11
|
text << "## " + indirection.to_s + "\n\n"
|
12
12
|
|
13
13
|
text << Puppet::Util::Docs.scrub(ind.doc) + "\n\n"
|
14
14
|
|
15
|
-
Puppet::Indirector::Terminus.terminus_classes(ind.name).
|
15
|
+
Puppet::Indirector::Terminus.terminus_classes(ind.name).sort_by(&:to_s).each do |terminus|
|
16
16
|
terminus_name = terminus.to_s
|
17
17
|
term_class = Puppet::Indirector::Terminus.terminus_class(ind.name, terminus)
|
18
18
|
if term_class
|
@@ -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"
|
@@ -32,10 +32,9 @@ providers = Puppet::Util::Reference.newreference :providers, :title => "Provider
|
|
32
32
|
|
33
33
|
table_data = {}
|
34
34
|
|
35
|
-
functional = false
|
36
35
|
notes = []
|
37
36
|
default = type.defaultprovider ? type.defaultprovider.name : 'none'
|
38
|
-
type.providers.
|
37
|
+
type.providers.sort_by(&:to_s).each do |pname|
|
39
38
|
data = []
|
40
39
|
table_data[pname] = data
|
41
40
|
provider = type.provider(pname)
|
@@ -44,7 +43,6 @@ providers = Puppet::Util::Reference.newreference :providers, :title => "Provider
|
|
44
43
|
if missing = provider.suitable?(false) and missing.empty?
|
45
44
|
data << "*X*"
|
46
45
|
suit = true
|
47
|
-
functional = true
|
48
46
|
else
|
49
47
|
data << "[#{count}]_" # A pointer to the appropriate footnote
|
50
48
|
suit = false
|
@@ -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(Puppet.lookup(:current_environment))
|
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
@@ -637,7 +637,7 @@ class Puppet::Resource::Catalog < Puppet::Graph::SimpleGraph
|
|
637
637
|
result.add_resource newres
|
638
638
|
end
|
639
639
|
|
640
|
-
message = convert.to_s.
|
640
|
+
message = convert.to_s.tr "_", " "
|
641
641
|
edges.each do |edge|
|
642
642
|
# Skip edges between virtual resources.
|
643
643
|
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))
|
data/lib/puppet/ssl/host.rb
CHANGED
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 = Puppet::Util::Yaml.safe_load_file(custom_oid_file, [Symbol])
|
data/lib/puppet/transaction.rb
CHANGED
@@ -57,7 +57,11 @@ class Puppet::Transaction
|
|
57
57
|
|
58
58
|
@prefetch_failed_providers = Hash.new { |h,k| h[k] = {} }
|
59
59
|
|
60
|
+
# With merge_dependency_warnings, notify and warn about class dependency failures ... just once per class. TJK 2019-09-09
|
61
|
+
@merge_dependency_warnings = Puppet[:merge_dependency_warnings]
|
60
62
|
@failed_dependencies_already_notified = Set.new()
|
63
|
+
@failed_class_dependencies_already_notified = Set.new()
|
64
|
+
@failed_class_dependencies_already_warned = Set.new()
|
61
65
|
end
|
62
66
|
|
63
67
|
# Invoke the pre_run_check hook in every resource in the catalog.
|
@@ -287,15 +291,25 @@ class Puppet::Transaction
|
|
287
291
|
# explosion of edges, we also ended up reporting failures for containers
|
288
292
|
# like class and stage. This is undesirable; while just skipping the
|
289
293
|
# output isn't perfect, it is RC-safe. --daniel 2011-06-07
|
290
|
-
|
291
|
-
|
294
|
+
is_puppet_class = resource.class == Puppet::Type.type(:whit)
|
295
|
+
# With merge_dependency_warnings, notify about class dependency failures ... just once per class. TJK 2019-09-09
|
292
296
|
s = resource_status(resource)
|
293
297
|
if s && s.dependency_failed?
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
298
|
+
if @merge_dependency_warnings && is_puppet_class
|
299
|
+
# Notes: Puppet::Resource::Status.failed_dependencies() is an Array of Puppet::Resource(s) and
|
300
|
+
# Puppet::Resource.ref() calls Puppet::Resource.to_s() which is: "#{type}[#{title}]" and
|
301
|
+
# Puppet::Resource.resource_status(resource) calls Puppet::Resource.to_s()
|
302
|
+
class_dependencies_to_be_notified = (s.failed_dependencies.map(&:ref) - @failed_class_dependencies_already_notified.to_a)
|
303
|
+
class_dependencies_to_be_notified.each do |dep_ref|
|
304
|
+
resource.notice _("Class dependency %{dep} has failures: %{status}") % { dep: dep_ref, status: resource_status(dep_ref).failed }
|
305
|
+
end
|
306
|
+
@failed_class_dependencies_already_notified.merge(class_dependencies_to_be_notified)
|
307
|
+
else
|
308
|
+
unless @merge_dependency_warnings || is_puppet_class
|
309
|
+
s.failed_dependencies.find_all { |d| !(@failed_dependencies_already_notified.include?(d.ref)) }.each do |dep|
|
310
|
+
resource.notice _("Dependency %{dep} has failures: %{status}") % { dep: dep, status: resource_status(dep).failed }
|
311
|
+
@failed_dependencies_already_notified.add(dep.ref)
|
312
|
+
end
|
299
313
|
end
|
300
314
|
end
|
301
315
|
end
|
@@ -395,11 +409,19 @@ class Puppet::Transaction
|
|
395
409
|
# explosion of edges, we also ended up reporting failures for containers
|
396
410
|
# like class and stage. This is undesirable; while just skipping the
|
397
411
|
# output isn't perfect, it is RC-safe. --daniel 2011-06-07
|
398
|
-
|
399
|
-
|
412
|
+
# With merge_dependency_warnings, warn about class dependency failures ... just once per class. TJK 2019-09-09
|
413
|
+
unless resource.class == Puppet::Type.type(:whit)
|
414
|
+
if @merge_dependency_warnings && resource.parent && failed_dependencies?(resource.parent)
|
415
|
+
ps = resource_status(resource.parent)
|
416
|
+
ps.failed_dependencies.find_all { |d| !(@failed_class_dependencies_already_warned.include?(d.ref)) }.each do |dep|
|
417
|
+
resource.parent.warning _("Skipping resources in class because of failed class dependencies")
|
418
|
+
@failed_class_dependencies_already_warned.add(dep.ref)
|
419
|
+
end
|
420
|
+
else
|
421
|
+
resource.warning _("Skipping because of failed dependencies")
|
422
|
+
end
|
400
423
|
end
|
401
|
-
elsif resource_status(resource).failed? &&
|
402
|
-
@prefetch_failed_providers[resource.type][resource.provider.class.name]
|
424
|
+
elsif resource_status(resource).failed? && @prefetch_failed_providers[resource.type][resource.provider.class.name]
|
403
425
|
#Do not try to evaluate a resource with a known failed provider
|
404
426
|
resource.warning _("Skipping because provider prefetch failed")
|
405
427
|
elsif resource.virtual?
|
@@ -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
@@ -1454,7 +1454,7 @@ class Type
|
|
1454
1454
|
}
|
1455
1455
|
|
1456
1456
|
Tags are useful for things like applying a subset of a host's configuration
|
1457
|
-
with [the `tags` setting](/puppet/latest/configuration.html#tags)
|
1457
|
+
with [the `tags` setting](https://puppet.com/docs/puppet/latest/configuration.html#tags)
|
1458
1458
|
(e.g. `puppet agent --test --tags bootstrap`)."
|
1459
1459
|
|
1460
1460
|
munge do |tags|
|
@@ -1916,9 +1916,7 @@ end
|
|
1916
1916
|
# Since we're mixing @doc with text from other sources, we must normalize
|
1917
1917
|
# its indentation with scrub. But we don't need to manually scrub the
|
1918
1918
|
# provider's doc string, since markdown_definitionlist sanitizes its inputs.
|
1919
|
-
scrub(@doc) + "Available providers are:\n\n" + parenttype.providers.
|
1920
|
-
a.to_s <=> b.to_s
|
1921
|
-
}.collect { |i|
|
1919
|
+
scrub(@doc) + "Available providers are:\n\n" + parenttype.providers.sort_by(&:to_s).collect { |i|
|
1922
1920
|
markdown_definitionlist( i, scrub(parenttype().provider(i).doc) )
|
1923
1921
|
}.join
|
1924
1922
|
end
|
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
@@ -577,8 +577,7 @@ Puppet::Type.newtype(:file) do
|
|
577
577
|
# remote system.
|
578
578
|
mark_children_for_purging(children) if self.purge?
|
579
579
|
|
580
|
-
|
581
|
-
result = children.values.sort { |a, b| a[:path] <=> b[:path] }
|
580
|
+
result = children.values.sort_by { |a| a[:path] }
|
582
581
|
remove_less_specific_files(result)
|
583
582
|
end
|
584
583
|
|
@@ -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
|
|
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
@@ -485,8 +485,8 @@ module Puppet
|
|
485
485
|
end
|
486
486
|
|
487
487
|
newparam(:flavor) do
|
488
|
-
desc "OpenBSD
|
489
|
-
which type of package you want."
|
488
|
+
desc "OpenBSD and DNF modules support 'flavors', which are
|
489
|
+
further specifications for which type of package you want."
|
490
490
|
end
|
491
491
|
|
492
492
|
newparam(:install_only, :boolean => false, :parent => Puppet::Parameter::Boolean, :required_features => :install_only) do
|
@@ -548,7 +548,14 @@ module Puppet
|
|
548
548
|
newparam(:allow_virtual, :boolean => true, :parent => Puppet::Parameter::Boolean, :required_features => :virtual_packages) do
|
549
549
|
desc 'Specifies if virtual package names are allowed for install and uninstall.'
|
550
550
|
|
551
|
-
defaultto
|
551
|
+
defaultto do
|
552
|
+
provider_class = provider.class
|
553
|
+
if provider_class.respond_to?(:defaultto_allow_virtual)
|
554
|
+
provider_class.defaultto_allow_virtual
|
555
|
+
else
|
556
|
+
true
|
557
|
+
end
|
558
|
+
end
|
552
559
|
end
|
553
560
|
|
554
561
|
autorequire(:file) do
|
data/lib/puppet/type/schedule.rb
CHANGED
data/lib/puppet/type/service.rb
CHANGED
@@ -230,7 +230,7 @@ module Puppet
|
|
230
230
|
desc "The control variable used to manage services (originally for HP-UX).
|
231
231
|
Defaults to the upcased service name plus `START` replacing dots with
|
232
232
|
underscores, for those providers that support the `controllable` feature."
|
233
|
-
defaultto { resource.name.
|
233
|
+
defaultto { resource.name.tr(".","_").upcase + "_START" if resource.provider.controllable? }
|
234
234
|
end
|
235
235
|
|
236
236
|
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
|
@@ -678,7 +679,8 @@ module Puppet
|
|
678
679
|
:required_features => :libuser,
|
679
680
|
:parent => Puppet::Parameter::Boolean) do
|
680
681
|
desc "Forces the management of local accounts when accounts are also
|
681
|
-
being managed by some other NSS
|
682
|
+
being managed by some other NSS. For AIX, refer to the
|
683
|
+
`ia_load_module` parameter."
|
682
684
|
defaultto false
|
683
685
|
end
|
684
686
|
|
data/lib/puppet/util.rb
CHANGED
@@ -322,7 +322,7 @@ module Util
|
|
322
322
|
params = { :scheme => 'file' }
|
323
323
|
|
324
324
|
if Puppet::Util::Platform.windows?
|
325
|
-
path = path.
|
325
|
+
path = path.tr('\\', '/')
|
326
326
|
|
327
327
|
if unc = /^\/\/([^\/]+)(\/.+)/.match(path)
|
328
328
|
params[:host] = unc[1]
|
@@ -523,21 +523,44 @@ module Util
|
|
523
523
|
|
524
524
|
module_function :thinmark
|
525
525
|
|
526
|
+
PUPPET_STACK_INSERTION_FRAME = /.*puppet_stack\.rb.*in.*`stack'/
|
527
|
+
|
526
528
|
# utility method to get the current call stack and format it to a human-readable string (which some IDEs/editors
|
527
529
|
# will recognize as links to the line numbers in the trace)
|
528
|
-
def self.pretty_backtrace(backtrace = caller(1))
|
529
|
-
backtrace.
|
530
|
-
|
531
|
-
|
532
|
-
|
533
|
-
|
534
|
-
|
535
|
-
|
536
|
-
|
530
|
+
def self.pretty_backtrace(backtrace = caller(1), puppetstack = [])
|
531
|
+
format_backtrace_array(backtrace, puppetstack).join("\n")
|
532
|
+
end
|
533
|
+
|
534
|
+
# arguments may be a Ruby stack, with an optional Puppet stack argument,
|
535
|
+
# or just a Puppet stack.
|
536
|
+
# stacks may be an Array of Strings "/foo.rb:0 in `blah'" or
|
537
|
+
# an Array of Arrays that represent a frame: ["/foo.pp", 0]
|
538
|
+
def self.format_backtrace_array(primary_stack, puppetstack = [])
|
539
|
+
primary_stack.flat_map do |frame|
|
540
|
+
frame = format_puppetstack_frame(frame) if frame.is_a?(Array)
|
541
|
+
primary_frame = resolve_stackframe(frame)
|
542
|
+
|
543
|
+
if primary_frame =~ PUPPET_STACK_INSERTION_FRAME && !puppetstack.empty?
|
544
|
+
[resolve_stackframe(format_puppetstack_frame(puppetstack.shift)),
|
545
|
+
primary_frame]
|
537
546
|
else
|
538
|
-
|
547
|
+
primary_frame
|
539
548
|
end
|
540
|
-
end
|
549
|
+
end
|
550
|
+
end
|
551
|
+
|
552
|
+
def self.resolve_stackframe(frame)
|
553
|
+
_, path, rest = /^(.*):(\d+.*)$/.match(frame).to_a
|
554
|
+
if path
|
555
|
+
path = Pathname(path).realpath rescue path
|
556
|
+
"#{path}:#{rest}"
|
557
|
+
else
|
558
|
+
frame
|
559
|
+
end
|
560
|
+
end
|
561
|
+
|
562
|
+
def self.format_puppetstack_frame(file_and_lineno)
|
563
|
+
file_and_lineno.join(':')
|
541
564
|
end
|
542
565
|
|
543
566
|
# Replace a file, securely. This takes a block, and passes it the file
|