puppet 6.6.0-x86-mingw32 → 6.7.0-x86-mingw32
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of puppet might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/Gemfile.lock +8 -8
- data/ext/solaris/smf/puppet.xml +2 -0
- data/ext/yaml_nodes.rb +7 -7
- data/lib/hiera_puppet.rb +2 -1
- data/lib/puppet/application/apply.rb +2 -3
- data/lib/puppet/application/doc.rb +2 -1
- data/lib/puppet/application/face_base.rb +22 -15
- data/lib/puppet/application/script.rb +4 -6
- data/lib/puppet/configurer.rb +10 -5
- data/lib/puppet/confine_collection.rb +2 -1
- data/lib/puppet/daemon.rb +3 -2
- data/lib/puppet/defaults.rb +8 -0
- data/lib/puppet/environments.rb +9 -7
- data/lib/puppet/etc.rb +1 -1
- data/lib/puppet/external/pson/pure/parser.rb +2 -1
- data/lib/puppet/face/epp.rb +4 -2
- data/lib/puppet/face/help.rb +3 -2
- data/lib/puppet/face/module/changes.rb +2 -1
- data/lib/puppet/file_bucket/dipper.rb +2 -1
- data/lib/puppet/file_serving/configuration.rb +2 -1
- data/lib/puppet/file_serving/fileset.rb +1 -1
- data/lib/puppet/file_serving/http_metadata.rb +4 -2
- data/lib/puppet/file_serving/metadata.rb +2 -1
- data/lib/puppet/file_serving/mount/file.rb +2 -1
- data/lib/puppet/file_serving/mount/locales.rb +2 -1
- data/lib/puppet/file_serving/mount/modules.rb +4 -2
- data/lib/puppet/file_serving/mount/pluginfacts.rb +2 -1
- data/lib/puppet/file_serving/mount/plugins.rb +2 -1
- data/lib/puppet/file_serving/mount/tasks.rb +4 -2
- data/lib/puppet/file_system/uniquefile.rb +4 -2
- data/lib/puppet/functions/match.rb +2 -3
- data/lib/puppet/generate/type.rb +2 -1
- data/lib/puppet/graph/relationship_graph.rb +2 -1
- data/lib/puppet/graph/simple_graph.rb +3 -2
- data/lib/puppet/indirector/catalog/compiler.rb +16 -8
- data/lib/puppet/indirector/certificate/rest.rb +2 -1
- data/lib/puppet/indirector/face.rb +2 -2
- data/lib/puppet/indirector/file_server.rb +4 -2
- data/lib/puppet/indirector/indirection.rb +12 -6
- data/lib/puppet/indirector/node/exec.rb +2 -1
- data/lib/puppet/indirector/report/processor.rb +2 -1
- data/lib/puppet/indirector/request.rb +9 -5
- data/lib/puppet/indirector/ssl_file.rb +10 -8
- data/lib/puppet/indirector/terminus.rb +6 -3
- data/lib/puppet/info_service.rb +9 -0
- data/lib/puppet/info_service/plan_information_service.rb +36 -0
- data/lib/puppet/interface.rb +2 -1
- data/lib/puppet/interface/action.rb +10 -5
- data/lib/puppet/interface/action_manager.rb +2 -1
- data/lib/puppet/interface/documentation.rb +10 -7
- data/lib/puppet/interface/face_collection.rb +6 -3
- data/lib/puppet/interface/option.rb +4 -2
- data/lib/puppet/interface/option_manager.rb +4 -2
- data/lib/puppet/module.rb +35 -1
- data/lib/puppet/module/plan.rb +160 -0
- data/lib/puppet/module_tool.rb +2 -1
- data/lib/puppet/module_tool/applications/application.rb +2 -1
- data/lib/puppet/module_tool/applications/installer.rb +4 -2
- data/lib/puppet/module_tool/applications/upgrader.rb +4 -2
- data/lib/puppet/module_tool/contents_description.rb +2 -1
- data/lib/puppet/module_tool/metadata.rb +2 -3
- data/lib/puppet/module_tool/shared_behaviors.rb +2 -1
- data/lib/puppet/network/authconfig.rb +4 -2
- data/lib/puppet/network/authstore.rb +2 -1
- data/lib/puppet/network/formats.rb +2 -1
- data/lib/puppet/network/http/api/indirected_routes.rb +6 -4
- data/lib/puppet/network/http/handler.rb +2 -1
- data/lib/puppet/network/http/request.rb +2 -1
- data/lib/puppet/network/http/route.rb +2 -1
- data/lib/puppet/network/resolver.rb +3 -2
- data/lib/puppet/network/rights.rb +2 -1
- data/lib/puppet/node.rb +8 -4
- data/lib/puppet/pal/catalog_compiler.rb +8 -1
- data/lib/puppet/pal/compiler.rb +2 -1
- data/lib/puppet/pal/pal_impl.rb +8 -0
- data/lib/puppet/pal/script_compiler.rb +4 -2
- data/lib/puppet/parameter.rb +4 -2
- data/lib/puppet/parameter/value_collection.rb +8 -8
- data/lib/puppet/parser/ast/pops_bridge.rb +2 -1
- data/lib/puppet/parser/compiler.rb +10 -5
- data/lib/puppet/parser/files.rb +2 -1
- data/lib/puppet/parser/functions.rb +2 -1
- data/lib/puppet/parser/relationship.rb +2 -1
- data/lib/puppet/parser/resource.rb +6 -3
- data/lib/puppet/parser/scope.rb +6 -4
- data/lib/puppet/parser/templatewrapper.rb +2 -1
- data/lib/puppet/parser/type_loader.rb +2 -1
- data/lib/puppet/pops/adaptable.rb +2 -5
- data/lib/puppet/pops/evaluator/collectors/exported_collector.rb +2 -1
- data/lib/puppet/pops/evaluator/collectors/fixed_set_collector.rb +2 -1
- data/lib/puppet/pops/evaluator/runtime3_resource_support.rb +2 -1
- data/lib/puppet/pops/evaluator/runtime3_support.rb +8 -4
- data/lib/puppet/pops/loader/base_loader.rb +4 -2
- data/lib/puppet/pops/loader/dependency_loader.rb +4 -2
- data/lib/puppet/pops/loader/gem_support.rb +4 -2
- data/lib/puppet/pops/loader/loader.rb +4 -2
- data/lib/puppet/pops/loader/loader_paths.rb +2 -1
- data/lib/puppet/pops/loader/static_loader.rb +1 -1
- data/lib/puppet/pops/lookup/interpolation.rb +2 -1
- data/lib/puppet/pops/model/factory.rb +4 -2
- data/lib/puppet/pops/parser/epp_support.rb +2 -1
- data/lib/puppet/pops/parser/heredoc_support.rb +2 -1
- data/lib/puppet/pops/parser/interpolation_support.rb +10 -5
- data/lib/puppet/pops/parser/lexer2.rb +6 -3
- data/lib/puppet/pops/parser/locator.rb +2 -1
- data/lib/puppet/pops/types/type_calculator.rb +1 -1
- data/lib/puppet/pops/types/type_parser.rb +4 -2
- data/lib/puppet/pops/validation.rb +2 -1
- data/lib/puppet/pops/validation/checker4_0.rb +6 -3
- data/lib/puppet/pops/visitor.rb +12 -6
- data/lib/puppet/property.rb +19 -16
- data/lib/puppet/property/ensure.rb +2 -1
- data/lib/puppet/property/keyvalue.rb +2 -1
- data/lib/puppet/property/list.rb +2 -1
- data/lib/puppet/provider.rb +10 -8
- data/lib/puppet/provider/exec.rb +7 -4
- data/lib/puppet/provider/file/posix.rb +6 -3
- data/lib/puppet/provider/group/groupadd.rb +2 -1
- data/lib/puppet/provider/group/ldap.rb +7 -4
- data/lib/puppet/provider/group/pw.rb +4 -2
- data/lib/puppet/provider/ldap.rb +8 -4
- data/lib/puppet/provider/nameservice.rb +8 -5
- data/lib/puppet/provider/nameservice/directoryservice.rb +8 -4
- data/lib/puppet/provider/network_device.rb +4 -2
- data/lib/puppet/provider/package.rb +2 -1
- data/lib/puppet/provider/package/aix.rb +4 -2
- data/lib/puppet/provider/package/appdmg.rb +4 -2
- data/lib/puppet/provider/package/apple.rb +2 -1
- data/lib/puppet/provider/package/apt.rb +4 -2
- data/lib/puppet/provider/package/blastwave.rb +2 -1
- data/lib/puppet/provider/package/dpkg.rb +6 -3
- data/lib/puppet/provider/package/fink.rb +2 -1
- data/lib/puppet/provider/package/gem.rb +4 -2
- data/lib/puppet/provider/package/macports.rb +6 -3
- data/lib/puppet/provider/package/nim.rb +8 -4
- data/lib/puppet/provider/package/openbsd.rb +14 -8
- data/lib/puppet/provider/package/opkg.rb +2 -1
- data/lib/puppet/provider/package/pacman.rb +2 -1
- data/lib/puppet/provider/package/pip.rb +2 -1
- data/lib/puppet/provider/package/pkgdmg.rb +4 -2
- data/lib/puppet/provider/package/pkgng.rb +4 -2
- data/lib/puppet/provider/package/pkgutil.rb +2 -1
- data/lib/puppet/provider/package/portupgrade.rb +2 -1
- data/lib/puppet/provider/package/rpm.rb +8 -4
- data/lib/puppet/provider/package/windows/package.rb +2 -1
- data/lib/puppet/provider/parsedfile.rb +14 -7
- data/lib/puppet/provider/service/base.rb +7 -4
- data/lib/puppet/provider/service/launchd.rb +4 -2
- data/lib/puppet/provider/service/service.rb +2 -1
- data/lib/puppet/provider/service/upstart.rb +11 -8
- data/lib/puppet/provider/user/directoryservice.rb +2 -1
- data/lib/puppet/provider/user/hpux.rb +1 -1
- data/lib/puppet/provider/user/ldap.rb +8 -4
- data/lib/puppet/provider/user/openbsd.rb +2 -1
- data/lib/puppet/provider/user/pw.rb +2 -1
- data/lib/puppet/provider/user/user_role_add.rb +4 -2
- data/lib/puppet/provider/user/useradd.rb +7 -4
- data/lib/puppet/reference/providers.rb +2 -3
- data/lib/puppet/reference/type.rb +4 -2
- data/lib/puppet/relationship.rb +4 -9
- data/lib/puppet/resource.rb +16 -9
- data/lib/puppet/resource/capability_finder.rb +12 -8
- data/lib/puppet/resource/catalog.rb +36 -40
- data/lib/puppet/resource/type.rb +7 -3
- data/lib/puppet/resource/type_collection.rb +4 -2
- data/lib/puppet/settings.rb +36 -19
- data/lib/puppet/settings/base_setting.rb +2 -1
- data/lib/puppet/settings/config_file.rb +2 -1
- data/lib/puppet/settings/file_setting.rb +2 -1
- data/lib/puppet/settings/ini_file.rb +2 -1
- data/lib/puppet/ssl/base.rb +2 -1
- data/lib/puppet/ssl/host.rb +16 -8
- data/lib/puppet/ssl/key.rb +2 -2
- data/lib/puppet/ssl/state_machine.rb +22 -3
- data/lib/puppet/transaction/event.rb +2 -1
- data/lib/puppet/transaction/event_manager.rb +4 -2
- data/lib/puppet/transaction/report.rb +10 -10
- data/lib/puppet/transaction/resource_harness.rb +4 -2
- data/lib/puppet/type.rb +84 -48
- data/lib/puppet/type/component.rb +2 -1
- data/lib/puppet/type/exec.rb +11 -7
- data/lib/puppet/type/file.rb +15 -9
- data/lib/puppet/type/file/content.rb +7 -3
- data/lib/puppet/type/file/ctime.rb +2 -1
- data/lib/puppet/type/file/data_sync.rb +2 -1
- data/lib/puppet/type/file/ensure.rb +10 -7
- data/lib/puppet/type/file/mode.rb +2 -1
- data/lib/puppet/type/file/mtime.rb +2 -1
- data/lib/puppet/type/file/selcontext.rb +2 -1
- data/lib/puppet/type/file/source.rb +6 -7
- data/lib/puppet/type/file/target.rb +2 -1
- data/lib/puppet/type/file/type.rb +2 -1
- data/lib/puppet/type/package.rb +6 -3
- data/lib/puppet/type/resources.rb +2 -1
- data/lib/puppet/type/service.rb +2 -1
- data/lib/puppet/type/tidy.rb +14 -7
- data/lib/puppet/type/user.rb +19 -7
- data/lib/puppet/util.rb +6 -3
- data/lib/puppet/util/checksums.rb +1 -1
- data/lib/puppet/util/classgen.rb +12 -6
- data/lib/puppet/util/command_line.rb +8 -4
- data/lib/puppet/util/connection.rb +4 -2
- data/lib/puppet/util/diff.rb +4 -2
- data/lib/puppet/util/execution.rb +4 -2
- data/lib/puppet/util/feature.rb +7 -4
- data/lib/puppet/util/fileparsing.rb +57 -46
- data/lib/puppet/util/filetype.rb +2 -1
- data/lib/puppet/util/http_proxy.rb +2 -1
- data/lib/puppet/util/instance_loader.rb +2 -1
- data/lib/puppet/util/ldap/connection.rb +4 -2
- data/lib/puppet/util/ldap/manager.rb +6 -3
- data/lib/puppet/util/log.rb +6 -3
- data/lib/puppet/util/metric.rb +2 -1
- data/lib/puppet/util/posix.rb +4 -2
- data/lib/puppet/util/rdoc/code_objects.rb +2 -1
- data/lib/puppet/util/rdoc/generators/puppet_generator.rb +4 -2
- data/lib/puppet/util/selinux.rb +2 -1
- data/lib/puppet/version.rb +2 -5
- data/locales/puppet.pot +713 -685
- data/man/man5/puppet.conf.5 +9 -2
- 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/lib/puppet_spec/modules.rb +16 -2
- data/spec/unit/indirector/request_spec.rb +5 -6
- data/spec/unit/info_service_spec.rb +48 -0
- data/spec/unit/module_spec.rb +73 -0
- data/spec/unit/plan_spec.rb +65 -0
- data/spec/unit/puppet_pal_catalog_spec.rb +12 -0
- data/spec/unit/ssl/state_machine_spec.rb +68 -5
- metadata +6 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a1c87237b40e10b29c04b19684e30ae3ca4a4c92dd0e4a1afb65017e8c9e8fdd
|
4
|
+
data.tar.gz: ef353e61b54c2a53c887008eb6d6eb160d2b6170ee2783b7c5ebd1400f84e617
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4020aa8b4bceadda49b97628134a07fa7f1a5257bae294957cd735c5060c919d21bf21030630f8399ba97a07d500687b252436996e8081c416b5a8481430a70f
|
7
|
+
data.tar.gz: d0362c944ecd07c6609edb192737f9df84ee6e24495537698d98340782a86924989b3a280da9d6995d6382c6c4c4eab7ec572e2888555dd94fff595d225aa03e
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
puppet (6.
|
4
|
+
puppet (6.7.0)
|
5
5
|
CFPropertyList (~> 2.2)
|
6
6
|
facter (>= 2.4.0, < 4)
|
7
7
|
fast_gettext (~> 1.1)
|
@@ -23,7 +23,7 @@ GEM
|
|
23
23
|
crack (0.4.3)
|
24
24
|
safe_yaml (~> 1.0.0)
|
25
25
|
diff-lcs (1.3)
|
26
|
-
facter (2.5.
|
26
|
+
facter (2.5.5)
|
27
27
|
fast_gettext (1.1.2)
|
28
28
|
gettext (3.2.9)
|
29
29
|
locale (>= 2.0.5)
|
@@ -32,7 +32,7 @@ GEM
|
|
32
32
|
fast_gettext (~> 1.1.0)
|
33
33
|
gettext (>= 3.0.2)
|
34
34
|
locale
|
35
|
-
hashdiff (0.
|
35
|
+
hashdiff (1.0.0)
|
36
36
|
hiera (3.5.0)
|
37
37
|
hiera-eyaml (3.0.0)
|
38
38
|
highline (~> 1.6.19)
|
@@ -44,14 +44,14 @@ GEM
|
|
44
44
|
json-schema (2.8.1)
|
45
45
|
addressable (>= 2.4)
|
46
46
|
locale (2.1.2)
|
47
|
-
memory_profiler (0.9.
|
47
|
+
memory_profiler (0.9.14)
|
48
48
|
method_source (0.9.2)
|
49
49
|
minitar (0.8)
|
50
50
|
msgpack (1.3.0)
|
51
51
|
multi_json (1.13.1)
|
52
52
|
mustache (1.1.0)
|
53
53
|
optimist (3.0.0)
|
54
|
-
packaging (0.99.
|
54
|
+
packaging (0.99.36)
|
55
55
|
artifactory (~> 2)
|
56
56
|
rake (~> 12.3)
|
57
57
|
parallel (1.17.0)
|
@@ -64,7 +64,7 @@ GEM
|
|
64
64
|
public_suffix (3.1.1)
|
65
65
|
puppet-resource_api (1.8.4)
|
66
66
|
hocon (>= 1.0)
|
67
|
-
puppetserver-ca (1.3.
|
67
|
+
puppetserver-ca (1.3.2)
|
68
68
|
facter (>= 2.0.1, < 4)
|
69
69
|
racc (1.4.9)
|
70
70
|
rainbow (2.2.2)
|
@@ -82,7 +82,7 @@ GEM
|
|
82
82
|
rspec-mocks (~> 3.8.0)
|
83
83
|
rspec-collection_matchers (1.1.3)
|
84
84
|
rspec-expectations (>= 2.99.0.beta1)
|
85
|
-
rspec-core (3.8.
|
85
|
+
rspec-core (3.8.2)
|
86
86
|
rspec-support (~> 3.8.0)
|
87
87
|
rspec-expectations (3.8.4)
|
88
88
|
diff-lcs (>= 1.2.0, < 2.0)
|
@@ -114,7 +114,7 @@ GEM
|
|
114
114
|
addressable (>= 2.3.6)
|
115
115
|
crack (>= 0.3.2)
|
116
116
|
hashdiff
|
117
|
-
yard (0.9.
|
117
|
+
yard (0.9.20)
|
118
118
|
|
119
119
|
PLATFORMS
|
120
120
|
ruby
|
data/ext/solaris/smf/puppet.xml
CHANGED
data/ext/yaml_nodes.rb
CHANGED
@@ -74,7 +74,7 @@ info = read_node(node)
|
|
74
74
|
|
75
75
|
# Iterate over any provided parents, merging in there information.
|
76
76
|
parents_seen = []
|
77
|
-
while parent = info["parent"]
|
77
|
+
while parent = info["parent"] #rubocop:disable Lint/AssignmentInCondition
|
78
78
|
raise "Found inheritance loop with parent #{parent}" if parents_seen.include?(parent)
|
79
79
|
|
80
80
|
parents_seen << parent
|
@@ -84,21 +84,21 @@ while parent = info["parent"]
|
|
84
84
|
parent_info = read_node(parent)
|
85
85
|
|
86
86
|
# Include any parent classes in our list.
|
87
|
-
if
|
88
|
-
info["classes"] +=
|
87
|
+
if parent_info["classes"]
|
88
|
+
info["classes"] += parent_info["classes"]
|
89
89
|
info["classes"].uniq!
|
90
90
|
end
|
91
91
|
|
92
92
|
# And inherit parameters from our parent, while preferring our own values.
|
93
|
-
if
|
93
|
+
if parent_info["parameters"]
|
94
94
|
# When using Hash#merge, the hash being merged in wins, and we
|
95
95
|
# want the subnode parameters to be the parent node parameters.
|
96
|
-
info["parameters"] =
|
96
|
+
info["parameters"] = parent_info["parameters"].merge(info["parameters"])
|
97
97
|
end
|
98
98
|
|
99
99
|
# Copy over any parent node name.
|
100
|
-
if
|
101
|
-
info["parent"] =
|
100
|
+
if parent_info["parent"]
|
101
|
+
info["parent"] = parent_info["parent"]
|
102
102
|
end
|
103
103
|
end
|
104
104
|
|
data/lib/hiera_puppet.rb
CHANGED
@@ -349,9 +349,8 @@ Copyright (c) 2011 Puppet Inc., LLC Licensed under the Apache 2.0 License
|
|
349
349
|
facts = nil
|
350
350
|
unless Puppet[:node_name_fact].empty?
|
351
351
|
# Collect our facts.
|
352
|
-
|
353
|
-
|
354
|
-
end
|
352
|
+
facts = Puppet::Node::Facts.indirection.find(Puppet[:node_name_value])
|
353
|
+
raise _("Could not find facts for %{node}") % { node: Puppet[:node_name_value] } unless facts
|
355
354
|
|
356
355
|
Puppet[:node_name_value] = facts.values[Puppet[:node_name_fact]]
|
357
356
|
facts.name = Puppet[:node_name_value]
|
@@ -156,7 +156,8 @@ HELP
|
|
156
156
|
exit_code = 0
|
157
157
|
require 'puppet/util/reference'
|
158
158
|
options[:references].sort { |a,b| a.to_s <=> b.to_s }.each do |name|
|
159
|
-
|
159
|
+
section = Puppet::Util::Reference.reference(name)
|
160
|
+
raise _("Could not find reference %{name}") % { name: name } unless section
|
160
161
|
|
161
162
|
begin
|
162
163
|
# Add the per-section text, but with no ToC
|
@@ -74,32 +74,38 @@ class Puppet::Application::FaceBase < Puppet::Application
|
|
74
74
|
index = -1
|
75
75
|
until action_name or (index += 1) >= command_line.args.length do
|
76
76
|
item = command_line.args[index]
|
77
|
-
if item =~ /^-/
|
77
|
+
if item =~ /^-/
|
78
78
|
option = @face.options.find do |name|
|
79
79
|
item =~ /^-+#{name.to_s.gsub(/[-_]/, '[-_]')}(?:[ =].*)?$/
|
80
80
|
end
|
81
|
-
if option
|
81
|
+
if option
|
82
82
|
option = @face.get_option(option)
|
83
83
|
# If we have an inline argument, just carry on. We don't need to
|
84
84
|
# care about optional vs mandatory in that case because we do a real
|
85
85
|
# parse later, and that will totally take care of raising the error
|
86
86
|
# when we get there. --daniel 2011-04-04
|
87
|
-
if option.takes_argument? and !item.index('=')
|
87
|
+
if option.takes_argument? and !item.index('=')
|
88
88
|
index += 1 unless
|
89
89
|
(option.optional_argument? and command_line.args[index + 1] =~ /^-/)
|
90
90
|
end
|
91
|
-
elsif option = find_global_settings_argument(item) then
|
92
|
-
unless Puppet.settings.boolean? option.name then
|
93
|
-
# As far as I can tell, we treat non-bool options as always having
|
94
|
-
# a mandatory argument. --daniel 2011-04-05
|
95
|
-
# ... But, the mandatory argument will not be the next item if an = is
|
96
|
-
# employed in the long form of the option. --jeffmccune 2012-09-18
|
97
|
-
index += 1 unless item =~ /^--#{option.name}=/
|
98
|
-
end
|
99
|
-
elsif option = find_application_argument(item) then
|
100
|
-
index += 1 if (option[:argument] and not option[:optional])
|
101
91
|
else
|
102
|
-
|
92
|
+
option = find_global_settings_argument(item)
|
93
|
+
if option
|
94
|
+
unless Puppet.settings.boolean? option.name
|
95
|
+
# As far as I can tell, we treat non-bool options as always having
|
96
|
+
# a mandatory argument. --daniel 2011-04-05
|
97
|
+
# ... But, the mandatory argument will not be the next item if an = is
|
98
|
+
# employed in the long form of the option. --jeffmccune 2012-09-18
|
99
|
+
index += 1 unless item =~ /^--#{option.name}=/
|
100
|
+
end
|
101
|
+
else
|
102
|
+
option = find_application_argument(item)
|
103
|
+
if option
|
104
|
+
index += 1 if (option[:argument] and not option[:optional])
|
105
|
+
else
|
106
|
+
raise OptionParser::InvalidOption.new(item.sub(/=.*$/, ''))
|
107
|
+
end
|
108
|
+
end
|
103
109
|
end
|
104
110
|
else
|
105
111
|
# Stash away the requested action name for later, and try to fetch the
|
@@ -112,7 +118,8 @@ class Puppet::Application::FaceBase < Puppet::Application
|
|
112
118
|
end
|
113
119
|
|
114
120
|
if @action.nil?
|
115
|
-
|
121
|
+
@action = @face.get_default_action()
|
122
|
+
if @action
|
116
123
|
@is_default_action = true
|
117
124
|
else
|
118
125
|
# First try to handle global command line options
|
@@ -140,18 +140,16 @@ Copyright (c) 2017 Puppet Inc., LLC Licensed under the Apache 2.0 License
|
|
140
140
|
|
141
141
|
unless Puppet[:node_name_fact].empty?
|
142
142
|
# Collect the facts specified for that node
|
143
|
-
|
144
|
-
|
145
|
-
end
|
143
|
+
facts = Puppet::Node::Facts.indirection.find(Puppet[:node_name_value])
|
144
|
+
raise _("Could not find facts for %{node}") % { node: Puppet[:node_name_value] } unless facts
|
146
145
|
|
147
146
|
Puppet[:node_name_value] = facts.values[Puppet[:node_name_fact]]
|
148
147
|
facts.name = Puppet[:node_name_value]
|
149
148
|
end
|
150
149
|
|
151
150
|
# Find the Node
|
152
|
-
|
153
|
-
|
154
|
-
end
|
151
|
+
node = Puppet::Node.indirection.find(Puppet[:node_name_value])
|
152
|
+
raise _("Could not find node %{node}") % { node: Puppet[:node_name_value] } unless node
|
155
153
|
|
156
154
|
configured_environment = node.environment || Puppet.lookup(:current_environment)
|
157
155
|
|
data/lib/puppet/configurer.rb
CHANGED
@@ -67,7 +67,8 @@ class Puppet::Configurer
|
|
67
67
|
# Get the remote catalog, yo. Returns nil if no catalog can be found.
|
68
68
|
def retrieve_catalog(query_options)
|
69
69
|
query_options ||= {}
|
70
|
-
|
70
|
+
result = retrieve_catalog_from_cache(query_options) if Puppet[:use_cached_catalog]
|
71
|
+
if result
|
71
72
|
@cached_catalog_status = 'explicitly_requested'
|
72
73
|
|
73
74
|
Puppet.info _("Using cached catalog from environment '%{environment}'") % { environment: result.environment }
|
@@ -104,7 +105,8 @@ class Puppet::Configurer
|
|
104
105
|
|
105
106
|
catalog_conversion_time = thinmark do
|
106
107
|
# Will mutate the result and replace all Deferred values with resolved values
|
107
|
-
|
108
|
+
facts = options[:convert_with_facts]
|
109
|
+
if facts
|
108
110
|
Puppet::Pops::Evaluator::DeferredResolver.resolve_and_replace(facts, result)
|
109
111
|
end
|
110
112
|
|
@@ -257,7 +259,8 @@ class Puppet::Configurer
|
|
257
259
|
Puppet::GettextConfig.reset_text_domain('agent')
|
258
260
|
Puppet::ModuleTranslations.load_from_vardir(Puppet[:vardir])
|
259
261
|
|
260
|
-
|
262
|
+
catalog = prepare_and_retrieve_catalog_from_cache(options)
|
263
|
+
if catalog
|
261
264
|
options[:catalog] = catalog
|
262
265
|
@cached_catalog_status = 'explicitly_requested'
|
263
266
|
|
@@ -339,7 +342,8 @@ class Puppet::Configurer
|
|
339
342
|
query_options[:configured_environment] = configured_environment
|
340
343
|
options[:convert_for_node] = node
|
341
344
|
|
342
|
-
|
345
|
+
catalog = prepare_and_retrieve_catalog(options, query_options)
|
346
|
+
unless catalog
|
343
347
|
return nil
|
344
348
|
end
|
345
349
|
|
@@ -364,7 +368,8 @@ class Puppet::Configurer
|
|
364
368
|
query_options = get_facts(options)
|
365
369
|
query_options[:configured_environment] = configured_environment
|
366
370
|
|
367
|
-
|
371
|
+
catalog = prepare_and_retrieve_catalog(options, query_options)
|
372
|
+
return nil unless catalog
|
368
373
|
tries += 1
|
369
374
|
end
|
370
375
|
|
@@ -11,7 +11,8 @@ class Puppet::ConfineCollection
|
|
11
11
|
for_binary = false
|
12
12
|
end
|
13
13
|
hash.each do |test, values|
|
14
|
-
|
14
|
+
klass = Puppet::Confine.test(test)
|
15
|
+
if klass
|
15
16
|
@confines << klass.new(values)
|
16
17
|
@confines[-1].for_binary = true if for_binary
|
17
18
|
else
|
data/lib/puppet/daemon.rb
CHANGED
@@ -38,7 +38,8 @@ class Puppet::Daemon
|
|
38
38
|
|
39
39
|
# Put the daemon into the background.
|
40
40
|
def daemonize
|
41
|
-
|
41
|
+
pid = fork
|
42
|
+
if pid
|
42
43
|
Process.detach(pid)
|
43
44
|
exit(0)
|
44
45
|
end
|
@@ -181,7 +182,7 @@ class Puppet::Daemon
|
|
181
182
|
end
|
182
183
|
|
183
184
|
signal_loop = Puppet::Scheduler.create_job(SIGNAL_CHECK_INTERVAL) do
|
184
|
-
while method = @signals.shift
|
185
|
+
while method = @signals.shift #rubocop:disable Lint/AssignmentInCondition
|
185
186
|
Puppet.notice "Processing #{method}"
|
186
187
|
send(method)
|
187
188
|
end
|
data/lib/puppet/defaults.rb
CHANGED
@@ -913,6 +913,14 @@ EOT
|
|
913
913
|
:group => "service",
|
914
914
|
:desc => "Where each client stores the CA certificate."
|
915
915
|
},
|
916
|
+
:ca_fingerprint => {
|
917
|
+
:default => nil,
|
918
|
+
:type => :string,
|
919
|
+
:desc => "The expected fingerprint of the CA certificate. If specified, the agent
|
920
|
+
will compare the CA certificate fingerprint that it downloads against this value
|
921
|
+
and reject the CA certificate if the values do not match. This only applies
|
922
|
+
during the first download of the CA certificate."
|
923
|
+
},
|
916
924
|
:ssl_client_ca_auth => {
|
917
925
|
:type => :file,
|
918
926
|
:mode => "0644",
|
data/lib/puppet/environments.rb
CHANGED
@@ -141,17 +141,16 @@ module Puppet::Environments
|
|
141
141
|
class StaticDirectory < Static
|
142
142
|
# Accepts a single environment in the given directory having the given name (not required to be reflected as the name
|
143
143
|
# of the directory)
|
144
|
-
#
|
145
144
|
def initialize(env_name, env_dir, environment)
|
146
145
|
super(environment)
|
147
146
|
@env_dir = env_dir
|
148
|
-
@env_name = env_name
|
147
|
+
@env_name = env_name.intern
|
149
148
|
end
|
150
149
|
|
151
150
|
# @!macro loader_get_conf
|
152
151
|
def get_conf(name)
|
153
|
-
return nil unless name == @env_name
|
154
|
-
Puppet::Settings::EnvironmentConf.load_from(@env_dir,
|
152
|
+
return nil unless name.intern == @env_name
|
153
|
+
Puppet::Settings::EnvironmentConf.load_from(@env_dir, [])
|
155
154
|
end
|
156
155
|
end
|
157
156
|
|
@@ -268,7 +267,8 @@ module Puppet::Environments
|
|
268
267
|
# @!macro loader_get
|
269
268
|
def get(name)
|
270
269
|
@loaders.each do |loader|
|
271
|
-
|
270
|
+
env = loader.get(name)
|
271
|
+
if env
|
272
272
|
return env
|
273
273
|
end
|
274
274
|
end
|
@@ -278,7 +278,8 @@ module Puppet::Environments
|
|
278
278
|
# @!macro loader_get_conf
|
279
279
|
def get_conf(name)
|
280
280
|
@loaders.each do |loader|
|
281
|
-
|
281
|
+
conf = loader.get_conf(name)
|
282
|
+
if conf
|
282
283
|
return conf
|
283
284
|
end
|
284
285
|
end
|
@@ -349,7 +350,8 @@ module Puppet::Environments
|
|
349
350
|
# This strategy favors smaller memory footprint over environment
|
350
351
|
# retrieval time.
|
351
352
|
clear_all_expired
|
352
|
-
|
353
|
+
result = @cache[name]
|
354
|
+
if result
|
353
355
|
# found in cache
|
354
356
|
return result.value
|
355
357
|
elsif (result = @loader.get(name))
|
data/lib/puppet/etc.rb
CHANGED
@@ -180,7 +180,8 @@ module PSON
|
|
180
180
|
if scan(STRING)
|
181
181
|
return '' if self[1].empty?
|
182
182
|
string = self[1].gsub(%r{(?:\\[\\bfnrt"/]|(?:\\u(?:[A-Fa-f\d]{4}))+|\\[\x20-\xff])}n) do |c|
|
183
|
-
|
183
|
+
u = UNESCAPE_MAP[$MATCH[1]]
|
184
|
+
if u
|
184
185
|
u
|
185
186
|
else # \uXXXX
|
186
187
|
bytes = ''
|
data/lib/puppet/face/epp.rb
CHANGED
@@ -402,7 +402,8 @@ Puppet::Face.define(:epp, '0.0.1') do
|
|
402
402
|
|
403
403
|
def get_values(compiler, options)
|
404
404
|
template_values = nil
|
405
|
-
|
405
|
+
values_file = options[:values_file]
|
406
|
+
if values_file
|
406
407
|
begin
|
407
408
|
if values_file =~ /\.yaml$/
|
408
409
|
template_values = Puppet::Util::Yaml.safe_load_file(values_file, [Symbol])
|
@@ -420,7 +421,8 @@ Puppet::Face.define(:epp, '0.0.1') do
|
|
420
421
|
end
|
421
422
|
end
|
422
423
|
|
423
|
-
|
424
|
+
values = options[:values]
|
425
|
+
if values
|
424
426
|
evaluating_parser = Puppet::Pops::Parser::EvaluatingParser.new
|
425
427
|
result = evaluating_parser.evaluate_string(compiler.topscope, values, 'values-hash')
|
426
428
|
case result
|
data/lib/puppet/face/help.rb
CHANGED
@@ -182,8 +182,9 @@ Puppet::Face.define(:help, '0.0.1') do
|
|
182
182
|
# depends on the implementation coincidence of how our pages are
|
183
183
|
# formatted. If we can't match the pattern we expect we return the empty
|
184
184
|
# string to ensure we don't blow up in the summary. --daniel 2011-04-11
|
185
|
-
while line = help.shift do
|
186
|
-
|
185
|
+
while line = help.shift do #rubocop:disable Lint/AssignmentInCondition
|
186
|
+
md = /^puppet-#{appname}\([^\)]+\) -- (.*)$/.match(line)
|
187
|
+
if md
|
187
188
|
return md[1]
|
188
189
|
end
|
189
190
|
end
|