bolt 0.20.3 → 0.20.5
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of bolt might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/bolt-modules/boltlib/lib/puppet/functions/run_task.rb +3 -3
- data/bolt-modules/boltlib/lib/puppet/functions/set_feature.rb +33 -0
- data/lib/bolt/inventory.rb +19 -1
- data/lib/bolt/target.rb +15 -0
- data/lib/bolt/transport/local.rb +6 -1
- data/lib/bolt/transport/orch.rb +2 -0
- data/lib/bolt/transport/ssh.rb +7 -2
- data/lib/bolt/transport/winrm.rb +6 -1
- data/lib/bolt/version.rb +1 -1
- data/modules/facts/plans/retrieve.pp +2 -26
- data/modules/facts/tasks/init.json +9 -0
- data/vendored/puppet/lib/hiera/puppet_function.rb +1 -1
- data/vendored/puppet/lib/hiera/scope.rb +24 -2
- data/vendored/puppet/lib/puppet.rb +4 -13
- data/vendored/puppet/lib/puppet/application.rb +2 -2
- data/vendored/puppet/lib/puppet/application/agent.rb +1 -1
- data/vendored/puppet/lib/puppet/application/apply.rb +1 -1
- data/vendored/puppet/lib/puppet/application/cert.rb +1 -1
- data/vendored/puppet/lib/puppet/application/device.rb +8 -8
- data/vendored/puppet/lib/puppet/application/face_base.rb +1 -1
- data/vendored/puppet/lib/puppet/application/lookup.rb +2 -2
- data/vendored/puppet/lib/puppet/application/resource.rb +2 -2
- data/vendored/puppet/lib/puppet/application/script.rb +1 -1
- data/vendored/puppet/lib/puppet/configurer.rb +47 -24
- data/vendored/puppet/lib/puppet/confine.rb +4 -1
- data/vendored/puppet/lib/puppet/context.rb +1 -1
- data/vendored/puppet/lib/puppet/defaults.rb +32 -44
- data/vendored/puppet/lib/puppet/error.rb +14 -7
- data/vendored/puppet/lib/puppet/external/dot.rb +23 -17
- data/vendored/puppet/lib/puppet/face/config.rb +58 -3
- data/vendored/puppet/lib/puppet/face/epp.rb +1 -1
- data/vendored/puppet/lib/puppet/face/module/build.rb +3 -3
- data/vendored/puppet/lib/puppet/face/module/install.rb +0 -4
- data/vendored/puppet/lib/puppet/face/module/list.rb +0 -5
- data/vendored/puppet/lib/puppet/face/module/search.rb +1 -1
- data/vendored/puppet/lib/puppet/face/module/uninstall.rb +0 -4
- data/vendored/puppet/lib/puppet/face/module/upgrade.rb +0 -4
- data/vendored/puppet/lib/puppet/face/status.rb +2 -2
- data/vendored/puppet/lib/puppet/file_serving/base.rb +5 -5
- data/vendored/puppet/lib/puppet/file_serving/metadata.rb +2 -1
- data/vendored/puppet/lib/puppet/forge.rb +7 -8
- data/vendored/puppet/lib/puppet/forge/errors.rb +3 -3
- data/vendored/puppet/lib/puppet/functions/abs.rb +61 -0
- data/vendored/puppet/lib/puppet/functions/all.rb +2 -2
- data/vendored/puppet/lib/puppet/functions/any.rb +2 -2
- data/vendored/puppet/lib/puppet/functions/assert_type.rb +3 -3
- data/vendored/puppet/lib/puppet/functions/break.rb +3 -7
- data/vendored/puppet/lib/puppet/functions/camelcase.rb +62 -0
- data/vendored/puppet/lib/puppet/functions/capitalize.rb +61 -0
- data/vendored/puppet/lib/puppet/functions/ceiling.rb +37 -0
- data/vendored/puppet/lib/puppet/functions/chomp.rb +57 -0
- data/vendored/puppet/lib/puppet/functions/chop.rb +67 -0
- data/vendored/puppet/lib/puppet/functions/compare.rb +125 -0
- data/vendored/puppet/lib/puppet/functions/convert_to.rb +3 -2
- data/vendored/puppet/lib/puppet/functions/dig.rb +21 -1
- data/vendored/puppet/lib/puppet/functions/downcase.rb +89 -0
- data/vendored/puppet/lib/puppet/functions/each.rb +2 -2
- data/vendored/puppet/lib/puppet/functions/empty.rb +1 -3
- data/vendored/puppet/lib/puppet/functions/eyaml_lookup_key.rb +4 -2
- data/vendored/puppet/lib/puppet/functions/filter.rb +2 -2
- data/vendored/puppet/lib/puppet/functions/floor.rb +37 -0
- data/vendored/puppet/lib/puppet/functions/get.rb +150 -0
- data/vendored/puppet/lib/puppet/functions/getvar.rb +87 -0
- data/vendored/puppet/lib/puppet/functions/hiera.rb +5 -5
- data/vendored/puppet/lib/puppet/functions/hiera_array.rb +5 -5
- data/vendored/puppet/lib/puppet/functions/hiera_hash.rb +6 -6
- data/vendored/puppet/lib/puppet/functions/hiera_include.rb +7 -7
- data/vendored/puppet/lib/puppet/functions/hocon_data.rb +1 -1
- data/vendored/puppet/lib/puppet/functions/json_data.rb +3 -3
- data/vendored/puppet/lib/puppet/functions/lest.rb +1 -1
- data/vendored/puppet/lib/puppet/functions/lookup.rb +3 -2
- data/vendored/puppet/lib/puppet/functions/lstrip.rb +58 -0
- data/vendored/puppet/lib/puppet/functions/map.rb +1 -1
- data/vendored/puppet/lib/puppet/functions/match.rb +11 -0
- data/vendored/puppet/lib/puppet/functions/max.rb +183 -0
- data/vendored/puppet/lib/puppet/functions/min.rb +182 -0
- data/vendored/puppet/lib/puppet/functions/next.rb +1 -8
- data/vendored/puppet/lib/puppet/functions/reduce.rb +1 -1
- data/vendored/puppet/lib/puppet/functions/return.rb +1 -8
- data/vendored/puppet/lib/puppet/functions/reverse_each.rb +1 -1
- data/vendored/puppet/lib/puppet/functions/round.rb +24 -0
- data/vendored/puppet/lib/puppet/functions/rstrip.rb +58 -0
- data/vendored/puppet/lib/puppet/functions/size.rb +15 -0
- data/vendored/puppet/lib/puppet/functions/sort.rb +74 -0
- data/vendored/puppet/lib/puppet/functions/step.rb +1 -1
- data/vendored/puppet/lib/puppet/functions/strftime.rb +1 -7
- data/vendored/puppet/lib/puppet/functions/strip.rb +58 -0
- data/vendored/puppet/lib/puppet/functions/then.rb +1 -1
- data/vendored/puppet/lib/puppet/functions/tree_each.rb +7 -7
- data/vendored/puppet/lib/puppet/functions/upcase.rb +89 -0
- data/vendored/puppet/lib/puppet/functions/with.rb +4 -4
- data/vendored/puppet/lib/puppet/functions/yaml_data.rb +4 -2
- data/vendored/puppet/lib/puppet/graph/simple_graph.rb +9 -5
- data/vendored/puppet/lib/puppet/indirector/certificate_revocation_list/rest.rb +0 -11
- data/vendored/puppet/lib/puppet/indirector/indirection.rb +8 -12
- data/vendored/puppet/lib/puppet/indirector/node/exec.rb +1 -1
- data/vendored/puppet/lib/puppet/indirector/node/ldap.rb +1 -1
- data/vendored/puppet/lib/puppet/indirector/request.rb +11 -11
- data/vendored/puppet/lib/puppet/indirector/rest.rb +11 -11
- data/vendored/puppet/lib/puppet/interface/action.rb +2 -5
- data/vendored/puppet/lib/puppet/metatype/manager.rb +0 -2
- data/vendored/puppet/lib/puppet/module.rb +7 -33
- data/vendored/puppet/lib/puppet/module/task.rb +0 -1
- data/vendored/puppet/lib/puppet/module_tool.rb +2 -5
- data/vendored/puppet/lib/puppet/module_tool/applications/application.rb +5 -5
- data/vendored/puppet/lib/puppet/module_tool/applications/builder.rb +2 -2
- data/vendored/puppet/lib/puppet/module_tool/applications/checksummer.rb +3 -3
- data/vendored/puppet/lib/puppet/module_tool/applications/installer.rb +6 -7
- data/vendored/puppet/lib/puppet/module_tool/applications/uninstaller.rb +1 -2
- data/vendored/puppet/lib/puppet/module_tool/applications/unpacker.rb +2 -2
- data/vendored/puppet/lib/puppet/module_tool/applications/upgrader.rb +5 -6
- data/vendored/puppet/lib/puppet/module_tool/dependency.rb +1 -1
- data/vendored/puppet/lib/puppet/module_tool/installed_modules.rb +2 -2
- data/vendored/puppet/lib/puppet/module_tool/local_tarball.rb +3 -3
- data/vendored/puppet/lib/puppet/module_tool/metadata.rb +3 -4
- data/vendored/puppet/lib/puppet/module_tool/shared_behaviors.rb +2 -2
- data/vendored/puppet/lib/puppet/network/authconfig.rb +0 -13
- data/vendored/puppet/lib/puppet/network/format_support.rb +1 -1
- data/vendored/puppet/lib/puppet/network/formats.rb +5 -7
- data/vendored/puppet/lib/puppet/network/http.rb +0 -2
- data/vendored/puppet/lib/puppet/network/http/api.rb +1 -10
- data/vendored/puppet/lib/puppet/network/http/api/master/v3/environment.rb +2 -2
- data/vendored/puppet/lib/puppet/network/http/api/master/v3/environments.rb +2 -2
- data/vendored/puppet/lib/puppet/network/http/compression.rb +1 -1
- data/vendored/puppet/lib/puppet/network/http/connection.rb +11 -3
- data/vendored/puppet/lib/puppet/network/http/error.rb +3 -3
- data/vendored/puppet/lib/puppet/network/http/factory.rb +3 -0
- data/vendored/puppet/lib/puppet/network/http/handler.rb +59 -27
- data/vendored/puppet/lib/puppet/network/resolver.rb +140 -67
- data/vendored/puppet/lib/puppet/node/environment.rb +2 -19
- data/vendored/puppet/lib/puppet/parameter.rb +12 -7
- data/vendored/puppet/lib/puppet/parser/ast.rb +4 -8
- data/vendored/puppet/lib/puppet/parser/ast/branch.rb +3 -3
- data/vendored/puppet/lib/puppet/parser/ast/leaf.rb +5 -0
- data/vendored/puppet/lib/puppet/parser/ast/pops_bridge.rb +18 -0
- data/vendored/puppet/lib/puppet/parser/compiler.rb +3 -4
- data/vendored/puppet/lib/puppet/parser/compiler/catalog_validator/relationship_validator.rb +9 -2
- data/vendored/puppet/lib/puppet/parser/functions.rb +1 -1
- data/vendored/puppet/lib/puppet/parser/functions/assert_type.rb +3 -3
- data/vendored/puppet/lib/puppet/parser/functions/create_resources.rb +1 -7
- data/vendored/puppet/lib/puppet/parser/functions/each.rb +2 -2
- data/vendored/puppet/lib/puppet/parser/functions/filter.rb +1 -1
- data/vendored/puppet/lib/puppet/parser/functions/hiera.rb +4 -4
- data/vendored/puppet/lib/puppet/parser/functions/hiera_array.rb +5 -5
- data/vendored/puppet/lib/puppet/parser/functions/hiera_hash.rb +6 -6
- data/vendored/puppet/lib/puppet/parser/functions/hiera_include.rb +10 -11
- data/vendored/puppet/lib/puppet/parser/functions/inline_template.rb +1 -1
- data/vendored/puppet/lib/puppet/parser/functions/lest.rb +1 -1
- data/vendored/puppet/lib/puppet/parser/functions/lookup.rb +1 -1
- data/vendored/puppet/lib/puppet/parser/functions/map.rb +1 -1
- data/vendored/puppet/lib/puppet/parser/functions/reduce.rb +1 -1
- data/vendored/puppet/lib/puppet/parser/functions/return.rb +22 -1
- data/vendored/puppet/lib/puppet/parser/functions/reverse_each.rb +1 -1
- data/vendored/puppet/lib/puppet/parser/functions/step.rb +1 -1
- data/vendored/puppet/lib/puppet/parser/functions/then.rb +1 -1
- data/vendored/puppet/lib/puppet/parser/functions/with.rb +4 -4
- data/vendored/puppet/lib/puppet/parser/resource.rb +0 -1
- data/vendored/puppet/lib/puppet/parser/resource/param.rb +12 -5
- data/vendored/puppet/lib/puppet/parser/scope.rb +5 -7
- data/vendored/puppet/lib/puppet/pops/evaluator/compare_operator.rb +3 -1
- data/vendored/puppet/lib/puppet/pops/evaluator/runtime3_support.rb +2 -7
- data/vendored/puppet/lib/puppet/pops/issues.rb +4 -0
- data/vendored/puppet/lib/puppet/pops/loader/loader_paths.rb +2 -2
- data/vendored/puppet/lib/puppet/pops/loader/module_loaders.rb +17 -12
- data/vendored/puppet/lib/puppet/pops/loader/task_instantiator.rb +73 -45
- data/vendored/puppet/lib/puppet/pops/lookup/lookup_adapter.rb +55 -6
- data/vendored/puppet/lib/puppet/pops/model/model_label_provider.rb +2 -0
- data/vendored/puppet/lib/puppet/pops/parser/epp_parser.rb +1 -1
- data/vendored/puppet/lib/puppet/pops/parser/epp_support.rb +6 -2
- data/vendored/puppet/lib/puppet/pops/parser/lexer2.rb +1 -1
- data/vendored/puppet/lib/puppet/pops/pcore.rb +7 -7
- data/vendored/puppet/lib/puppet/pops/puppet_stack.rb +15 -1
- data/vendored/puppet/lib/puppet/pops/serialization.rb +2 -2
- data/vendored/puppet/lib/puppet/pops/serialization/from_data_converter.rb +2 -2
- data/vendored/puppet/lib/puppet/pops/serialization/json.rb +7 -7
- data/vendored/puppet/lib/puppet/pops/serialization/to_data_converter.rb +5 -5
- data/vendored/puppet/lib/puppet/pops/types/types.rb +8 -4
- data/vendored/puppet/lib/puppet/pops/validation/checker4_0.rb +73 -0
- data/vendored/puppet/lib/puppet/pops/validation/validator_factory_4_0.rb +4 -3
- data/vendored/puppet/lib/puppet/provider/augeas/augeas.rb +7 -0
- data/vendored/puppet/lib/puppet/provider/service/systemd.rb +1 -1
- data/vendored/puppet/lib/puppet/provider/user/aix.rb +2 -2
- data/vendored/puppet/lib/puppet/provider/yumrepo/inifile.rb +21 -9
- data/vendored/puppet/lib/puppet/reference/providers.rb +1 -1
- data/vendored/puppet/lib/puppet/reference/report.rb +1 -1
- data/vendored/puppet/lib/puppet/resource.rb +1 -1
- data/vendored/puppet/lib/puppet/resource/capability_finder.rb +4 -4
- data/vendored/puppet/lib/puppet/resource/catalog.rb +6 -3
- data/vendored/puppet/lib/puppet/resource/type.rb +6 -2
- data/vendored/puppet/lib/puppet/rest/client.rb +79 -0
- data/vendored/puppet/lib/puppet/rest/errors.rb +14 -0
- data/vendored/puppet/lib/puppet/rest/response.rb +29 -0
- data/vendored/puppet/lib/puppet/rest/route.rb +102 -0
- data/vendored/puppet/lib/puppet/rest/routes.rb +31 -0
- data/vendored/puppet/lib/puppet/settings.rb +9 -5
- data/vendored/puppet/lib/puppet/settings/config_file.rb +1 -1
- data/vendored/puppet/lib/puppet/settings/environment_conf.rb +10 -1
- data/vendored/puppet/lib/puppet/ssl.rb +0 -1
- data/vendored/puppet/lib/puppet/ssl/certificate.rb +6 -2
- data/vendored/puppet/lib/puppet/ssl/certificate_authority.rb +3 -3
- data/vendored/puppet/lib/puppet/ssl/host.rb +258 -19
- data/vendored/puppet/lib/puppet/ssl/validator/default_validator.rb +33 -19
- data/vendored/puppet/lib/puppet/syntax_checkers/json.rb +1 -1
- data/vendored/puppet/lib/puppet/transaction/event.rb +34 -7
- data/vendored/puppet/lib/puppet/transaction/report.rb +17 -14
- data/vendored/puppet/lib/puppet/type.rb +20 -12
- data/vendored/puppet/lib/puppet/type/file.rb +1 -1
- data/vendored/puppet/lib/puppet/type/file/content.rb +15 -2
- data/vendored/puppet/lib/puppet/type/file/ensure.rb +1 -1
- data/vendored/puppet/lib/puppet/type/schedule.rb +1 -1
- data/vendored/puppet/lib/puppet/type/stage.rb +1 -1
- data/vendored/puppet/lib/puppet/type/tidy.rb +5 -1
- data/vendored/puppet/lib/puppet/type/user.rb +35 -18
- data/vendored/puppet/lib/puppet/type/yumrepo.rb +8 -17
- data/vendored/puppet/lib/puppet/util.rb +0 -1
- data/vendored/puppet/lib/puppet/util/autoload.rb +1 -6
- data/vendored/puppet/lib/puppet/util/checksums.rb +0 -2
- data/vendored/puppet/lib/puppet/util/classgen.rb +0 -6
- data/vendored/puppet/lib/puppet/util/fileparsing.rb +27 -5
- data/vendored/puppet/lib/puppet/util/instance_loader.rb +3 -3
- data/vendored/puppet/lib/puppet/util/json.rb +77 -0
- data/vendored/puppet/lib/puppet/util/json_lockfile.rb +3 -3
- data/vendored/puppet/lib/puppet/util/ldap/connection.rb +7 -7
- data/vendored/puppet/lib/puppet/util/log/destinations.rb +2 -2
- data/vendored/puppet/lib/puppet/util/logging.rb +1 -1
- data/vendored/puppet/lib/puppet/util/plist.rb +1 -1
- data/vendored/puppet/lib/puppet/util/provider_features.rb +2 -5
- data/vendored/puppet/lib/puppet/util/reference.rb +5 -4
- data/vendored/puppet/lib/puppet/util/tagging.rb +16 -3
- data/vendored/puppet/lib/puppet/version.rb +1 -1
- metadata +44 -26
- data/vendored/puppet/lib/puppet/application/master.rb +0 -317
- data/vendored/puppet/lib/puppet/feature/rack.rb +0 -19
- data/vendored/puppet/lib/puppet/network/http/api/ca.rb +0 -2
- data/vendored/puppet/lib/puppet/network/http/api/ca/v1.rb +0 -11
- data/vendored/puppet/lib/puppet/network/http/rack.rb +0 -33
- data/vendored/puppet/lib/puppet/network/http/rack/rest.rb +0 -162
- data/vendored/puppet/lib/puppet/network/http/webrick.rb +0 -124
- data/vendored/puppet/lib/puppet/network/http/webrick/rest.rb +0 -114
- data/vendored/puppet/lib/puppet/network/server.rb +0 -39
- data/vendored/puppet/lib/puppet/ssl/configuration.rb +0 -61
- data/vendored/puppet/lib/puppet/util/methodhelper.rb +0 -32
- data/vendored/puppet/lib/puppet/vendor/load_semantic.rb +0 -1
- data/vendored/puppet/lib/puppet/vendor/load_semantic_puppet.rb +0 -1
- data/vendored/puppet/lib/puppet/vendor/semantic/lib/semantic.rb +0 -5
- data/vendored/puppet/lib/puppet/vendor/semantic_puppet/lib/semantic_puppet.rb +0 -11
- data/vendored/puppet/lib/puppet/vendor/semantic_puppet/lib/semantic_puppet/dependency.rb +0 -181
- data/vendored/puppet/lib/puppet/vendor/semantic_puppet/lib/semantic_puppet/dependency/graph.rb +0 -60
- data/vendored/puppet/lib/puppet/vendor/semantic_puppet/lib/semantic_puppet/dependency/graph_node.rb +0 -117
- data/vendored/puppet/lib/puppet/vendor/semantic_puppet/lib/semantic_puppet/dependency/module_release.rb +0 -58
- data/vendored/puppet/lib/puppet/vendor/semantic_puppet/lib/semantic_puppet/dependency/source.rb +0 -25
- data/vendored/puppet/lib/puppet/vendor/semantic_puppet/lib/semantic_puppet/dependency/unsatisfiable_graph.rb +0 -31
- data/vendored/puppet/lib/puppet/vendor/semantic_puppet/lib/semantic_puppet/gem_version.rb +0 -3
- data/vendored/puppet/lib/puppet/vendor/semantic_puppet/lib/semantic_puppet/version.rb +0 -203
- data/vendored/puppet/lib/puppet/vendor/semantic_puppet/lib/semantic_puppet/version_range.rb +0 -758
@@ -151,7 +151,7 @@ You can provide multiple lookup keys to this command, but it only returns a
|
|
151
151
|
value for the first found key, omitting the rest.
|
152
152
|
|
153
153
|
For more details about how Hiera works, see the Hiera documentation:
|
154
|
-
https://
|
154
|
+
https://puppet.com/docs/puppet/latest/hiera_intro.html
|
155
155
|
|
156
156
|
OPTIONS
|
157
157
|
-------
|
@@ -351,7 +351,7 @@ Copyright (c) 2015 Puppet Inc., LLC Licensed under the Apache 2.0 License
|
|
351
351
|
|
352
352
|
if fact_file
|
353
353
|
if fact_file.end_with?("json")
|
354
|
-
given_facts =
|
354
|
+
given_facts = Puppet::Util::Json.load(Puppet::FileSystem.read(fact_file, :encoding => 'utf-8'))
|
355
355
|
else
|
356
356
|
given_facts = YAML.load(Puppet::FileSystem.read(fact_file, :encoding => 'utf-8'))
|
357
357
|
end
|
@@ -21,7 +21,7 @@ class Puppet::Application::Resource < Puppet::Application
|
|
21
21
|
types << t.name.to_s
|
22
22
|
end
|
23
23
|
puts types.sort
|
24
|
-
exit
|
24
|
+
exit(0)
|
25
25
|
end
|
26
26
|
|
27
27
|
option("--param PARAM", "-p") do |arg|
|
@@ -76,7 +76,7 @@ setting, so you can specify '--ssldir <directory>' as an
|
|
76
76
|
argument.
|
77
77
|
|
78
78
|
See the configuration file documentation at
|
79
|
-
https://
|
79
|
+
https://puppet.com/docs/puppet/latest/configuration.html for the
|
80
80
|
full list of acceptable parameters. A commented list of all
|
81
81
|
configuration options can also be generated by running puppet with
|
82
82
|
'--genconfig'.
|
@@ -55,7 +55,7 @@ valid setting, so you can specify '--environment mytest'
|
|
55
55
|
as an argument.
|
56
56
|
|
57
57
|
See the configuration file documentation at
|
58
|
-
https://
|
58
|
+
https://puppet.com/docs/puppet/latest/configuration.html for the
|
59
59
|
full list of acceptable parameters. A commented list of all
|
60
60
|
configuration options can also be generated by running puppet with
|
61
61
|
'--genconfig'.
|
@@ -102,22 +102,31 @@ class Puppet::Configurer
|
|
102
102
|
end
|
103
103
|
|
104
104
|
# Convert a plain resource catalog into our full host catalog.
|
105
|
-
def convert_catalog(result, duration)
|
106
|
-
catalog =
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
105
|
+
def convert_catalog(result, duration, options = {})
|
106
|
+
catalog = nil
|
107
|
+
|
108
|
+
catalog_conversion_time = thinmark do
|
109
|
+
catalog = result.to_ral
|
110
|
+
catalog.finalize
|
111
|
+
catalog.retrieval_duration = duration
|
112
|
+
catalog.write_class_file
|
113
|
+
catalog.write_resource_file
|
114
|
+
end
|
115
|
+
options[:report].add_times(:convert_catalog, catalog_conversion_time) if options[:report]
|
116
|
+
|
111
117
|
catalog
|
112
118
|
end
|
113
119
|
|
114
120
|
def get_facts(options)
|
115
121
|
if options[:pluginsync]
|
116
|
-
|
117
|
-
|
122
|
+
plugin_sync_time = thinmark do
|
123
|
+
remote_environment_for_plugins = Puppet::Node::Environment.remote(@environment)
|
124
|
+
download_plugins(remote_environment_for_plugins)
|
118
125
|
|
119
|
-
|
120
|
-
|
126
|
+
Puppet::GettextConfig.reset_text_domain('agent')
|
127
|
+
Puppet::ModuleTranslations.load_from_vardir(Puppet[:vardir])
|
128
|
+
end
|
129
|
+
options[:report].add_times(:plugin_sync, plugin_sync_time) if options[:report]
|
121
130
|
end
|
122
131
|
|
123
132
|
facts_hash = {}
|
@@ -127,7 +136,10 @@ class Puppet::Configurer
|
|
127
136
|
# get a hash with both of these pieces of information.
|
128
137
|
#
|
129
138
|
# facts_for_uploading may set Puppet[:node_name_value] as a side effect
|
130
|
-
|
139
|
+
facter_time = thinmark do
|
140
|
+
facts_hash = facts_for_uploading
|
141
|
+
end
|
142
|
+
options[:report].add_times(:fact_generation, facter_time) if options[:report]
|
131
143
|
end
|
132
144
|
facts_hash
|
133
145
|
end
|
@@ -149,17 +161,17 @@ class Puppet::Configurer
|
|
149
161
|
|
150
162
|
# retrieve_catalog returns json catalog
|
151
163
|
catalog = retrieve_catalog(query_options)
|
152
|
-
return convert_catalog(catalog, @duration) if catalog
|
164
|
+
return convert_catalog(catalog, @duration, options) if catalog
|
153
165
|
|
154
166
|
Puppet.err _("Could not retrieve catalog; skipping run")
|
155
167
|
nil
|
156
168
|
end
|
157
169
|
|
158
|
-
def prepare_and_retrieve_catalog_from_cache
|
170
|
+
def prepare_and_retrieve_catalog_from_cache(options = {})
|
159
171
|
result = retrieve_catalog_from_cache({:transaction_uuid => @transaction_uuid, :static_catalog => @static_catalog})
|
160
172
|
if result
|
161
173
|
Puppet.info _("Using cached catalog from environment '%{catalog_env}'") % { catalog_env: result.environment }
|
162
|
-
return convert_catalog(result, @duration)
|
174
|
+
return convert_catalog(result, @duration, options)
|
163
175
|
end
|
164
176
|
nil
|
165
177
|
end
|
@@ -167,15 +179,15 @@ class Puppet::Configurer
|
|
167
179
|
# Apply supplied catalog and return associated application report
|
168
180
|
def apply_catalog(catalog, options)
|
169
181
|
report = options[:report]
|
170
|
-
|
171
|
-
report.configuration_version = catalog.version
|
182
|
+
report.configuration_version = catalog.version
|
172
183
|
|
173
|
-
|
184
|
+
benchmark(:notice, _("Applied catalog in %{seconds} seconds")) do
|
185
|
+
apply_catalog_time = thinmark do
|
174
186
|
catalog.apply(options)
|
175
187
|
end
|
176
|
-
|
177
|
-
report.finalize_report
|
188
|
+
options[:report].add_times(:catalog_application, apply_catalog_time)
|
178
189
|
end
|
190
|
+
|
179
191
|
report
|
180
192
|
end
|
181
193
|
|
@@ -194,6 +206,7 @@ class Puppet::Configurer
|
|
194
206
|
|
195
207
|
Puppet::Util::Log.newdestination(report)
|
196
208
|
|
209
|
+
completed = nil
|
197
210
|
begin
|
198
211
|
Puppet.override(:http_pool => pool) do
|
199
212
|
|
@@ -218,18 +231,21 @@ class Puppet::Configurer
|
|
218
231
|
report.master_used = "#{server[0]}:#{server[1]}"
|
219
232
|
end
|
220
233
|
|
221
|
-
run_internal(options.merge(:node => found[:node]))
|
234
|
+
completed = run_internal(options.merge(:node => found[:node]))
|
222
235
|
end
|
223
236
|
else
|
224
|
-
run_internal(options)
|
237
|
+
completed = run_internal(options)
|
225
238
|
end
|
226
239
|
end
|
227
240
|
ensure
|
228
241
|
pool.close
|
229
242
|
end
|
243
|
+
|
244
|
+
completed ? report.exit_status : nil
|
230
245
|
end
|
231
246
|
|
232
247
|
def run_internal(options)
|
248
|
+
start = Time.now
|
233
249
|
report = options[:report]
|
234
250
|
|
235
251
|
# If a cached catalog is explicitly requested, attempt to retrieve it. Skip the node request,
|
@@ -238,7 +254,7 @@ class Puppet::Configurer
|
|
238
254
|
Puppet::GettextConfig.reset_text_domain('agent')
|
239
255
|
Puppet::ModuleTranslations.load_from_vardir(Puppet[:vardir])
|
240
256
|
|
241
|
-
if catalog = prepare_and_retrieve_catalog_from_cache
|
257
|
+
if catalog = prepare_and_retrieve_catalog_from_cache(options)
|
242
258
|
options[:catalog] = catalog
|
243
259
|
@cached_catalog_status = 'explicitly_requested'
|
244
260
|
|
@@ -267,13 +283,18 @@ class Puppet::Configurer
|
|
267
283
|
# We only need to find out the environment to run in if we don't already have a catalog
|
268
284
|
unless (options[:catalog] || Puppet[:strict_environment_mode])
|
269
285
|
begin
|
270
|
-
|
286
|
+
node = nil
|
287
|
+
node_retr_time = thinmark do
|
288
|
+
node = options[:node] || Puppet::Node.indirection.find(Puppet[:node_name_value],
|
271
289
|
:environment => Puppet::Node::Environment.remote(@environment),
|
272
290
|
:configured_environment => configured_environment,
|
273
291
|
:ignore_cache => true,
|
274
292
|
:transaction_uuid => @transaction_uuid,
|
275
293
|
:fail_on_404 => true)
|
294
|
+
end
|
295
|
+
options[:report].add_times(:node_retrieval, node_retr_time)
|
276
296
|
|
297
|
+
if node
|
277
298
|
# If we have deserialized a node from a rest call, we want to set
|
278
299
|
# an environment instance as a simple 'remote' environment reference.
|
279
300
|
if !node.has_environment_instance? && node.environment_name
|
@@ -346,7 +367,7 @@ class Puppet::Configurer
|
|
346
367
|
options[:report].catalog_uuid = catalog.catalog_uuid
|
347
368
|
options[:report].cached_catalog_status = @cached_catalog_status
|
348
369
|
apply_catalog(catalog, options)
|
349
|
-
|
370
|
+
true
|
350
371
|
rescue => detail
|
351
372
|
Puppet.log_exception(detail, _("Failed to apply catalog: %{detail}") % { detail: detail })
|
352
373
|
return nil
|
@@ -355,6 +376,8 @@ class Puppet::Configurer
|
|
355
376
|
end
|
356
377
|
ensure
|
357
378
|
report.cached_catalog_status ||= @cached_catalog_status
|
379
|
+
report.add_times(:total, Time.now - start)
|
380
|
+
report.finalize_report
|
358
381
|
Puppet::Util::Log.close(report)
|
359
382
|
send_report(report)
|
360
383
|
Puppet.pop_context
|
@@ -21,7 +21,7 @@ class Puppet::Confine
|
|
21
21
|
end
|
22
22
|
|
23
23
|
def self.test(name)
|
24
|
-
unless @tests
|
24
|
+
unless @tests.include?(name)
|
25
25
|
begin
|
26
26
|
require "puppet/confine/#{name}"
|
27
27
|
rescue LoadError => detail
|
@@ -29,6 +29,9 @@ class Puppet::Confine
|
|
29
29
|
warn "Could not load confine test '#{name}': #{detail}"
|
30
30
|
end
|
31
31
|
# Could not find file
|
32
|
+
if !Puppet[:always_retry_plugins]
|
33
|
+
@tests[name] = nil
|
34
|
+
end
|
32
35
|
end
|
33
36
|
end
|
34
37
|
@tests[name]
|
@@ -52,7 +52,7 @@ class Puppet::Context
|
|
52
52
|
elsif block
|
53
53
|
block.call
|
54
54
|
else
|
55
|
-
raise UndefinedBindingError, _("
|
55
|
+
raise UndefinedBindingError, _("Unable to lookup '%{name}'") % { name: name }
|
56
56
|
end
|
57
57
|
end
|
58
58
|
|
@@ -201,7 +201,7 @@ module Puppet
|
|
201
201
|
:static_catalogs => {
|
202
202
|
:default => true,
|
203
203
|
:type => :boolean,
|
204
|
-
:desc => "Whether to compile a [static catalog](https://
|
204
|
+
:desc => "Whether to compile a [static catalog](https://puppet.com/docs/puppet/latest/static_catalogs.html#enabling-or-disabling-static-catalogs),
|
205
205
|
which occurs only on a Puppet Server master when the `code-id-command` and
|
206
206
|
`code-content-command` settings are configured in its `puppetserver.conf` file.",
|
207
207
|
},
|
@@ -352,7 +352,7 @@ module Puppet
|
|
352
352
|
|
353
353
|
This setting must have a value set to enable **directory environments.** The
|
354
354
|
recommended value is `$codedir/environments`. For more details, see
|
355
|
-
<https://
|
355
|
+
<https://puppet.com/docs/puppet/latest/environments_about.html>",
|
356
356
|
:type => :path,
|
357
357
|
},
|
358
358
|
:always_retry_plugins => {
|
@@ -441,7 +441,7 @@ module Puppet
|
|
441
441
|
|
442
442
|
* `plain` --- Returns no data, so that the main manifest controls all node configuration.
|
443
443
|
* `exec` --- Uses an
|
444
|
-
[external node classifier (ENC)](https://
|
444
|
+
[external node classifier (ENC)](https://puppet.com/docs/puppet/latest/nodes_external.html),
|
445
445
|
configured by the `external_nodes` setting. This lets you pull a list of Puppet classes
|
446
446
|
from any external system, using a small glue script to perform the request and format the
|
447
447
|
result as YAML.
|
@@ -709,15 +709,15 @@ module Puppet
|
|
709
709
|
`certname` setting as its requested Subject CN.
|
710
710
|
|
711
711
|
This is the name used when managing a node's permissions in
|
712
|
-
[auth.conf](https://
|
712
|
+
[auth.conf](https://puppet.com/docs/puppet/latest/config_file_auth.html).
|
713
713
|
In most cases, it is also used as the node's name when matching
|
714
|
-
[node definitions](https://
|
714
|
+
[node definitions](https://puppet.com/docs/puppet/latest/lang_node_definitions.html)
|
715
715
|
and requesting data from an ENC. (This can be changed with the `node_name_value`
|
716
716
|
and `node_name_fact` settings, although you should only do so if you have
|
717
717
|
a compelling reason.)
|
718
718
|
|
719
719
|
A node's certname is available in Puppet manifests as `$trusted['certname']`. (See
|
720
|
-
[Facts and Built-In Variables](https://
|
720
|
+
[Facts and Built-In Variables](https://puppet.com/docs/puppet/latest/lang_facts_and_builtin_vars.html)
|
721
721
|
for more details.)
|
722
722
|
|
723
723
|
* For best compatibility, you should limit the value of `certname` to
|
@@ -752,7 +752,7 @@ change this setting; you also need to:
|
|
752
752
|
* On the server: Stop Puppet Server.
|
753
753
|
* On the CA server: Revoke and clean the server's old certificate. (`puppet cert clean <NAME>`)
|
754
754
|
* On the server: Delete the old certificate (and any old certificate signing requests)
|
755
|
-
from the [ssldir](https://
|
755
|
+
from the [ssldir](https://puppet.com/docs/puppet/latest/dirs_ssldir.html).
|
756
756
|
* On the server: Run `puppet agent -t --ca_server <CA HOSTNAME>` to request a new certificate
|
757
757
|
* On the CA server: Sign the certificate request, explicitly allowing alternate names
|
758
758
|
(`puppet cert sign --allow-dns-alt-names <NAME>`).
|
@@ -924,25 +924,26 @@ EOT
|
|
924
924
|
:certificate_revocation => {
|
925
925
|
:default => 'chain',
|
926
926
|
:type => :certificate_revocation,
|
927
|
-
:desc =>
|
928
|
-
Whether certificate revocation checking should be enabled, and what level of
|
927
|
+
:desc => <<-'EOT'
|
928
|
+
Whether certificate revocation checking should be enabled, and what level of
|
929
|
+
checking should be performed.
|
929
930
|
|
930
|
-
When
|
931
|
-
|
931
|
+
When certificate revocation is enabled Puppet expects the contents of its CRL
|
932
|
+
to be one or more PEM encoded CRLs concatenated together. When using a cert
|
933
|
+
bundle CRLs for all CAs in the chain of trust must be included in the crl file
|
934
|
+
with the first CRL listed being for the root of the chain, the last being for
|
935
|
+
the leaf CA.
|
932
936
|
|
933
|
-
|
934
|
-
|
935
|
-
a certificate signed by an intermediate CA then verification will fail as Puppet will be unable to load the multiple
|
936
|
-
CRLs required for full chain checking. As such the 'chain' setting is limited in functionality and is meant as a stand
|
937
|
-
in pending the implementation of full chain checking.
|
937
|
+
When certificate_revocation is set to 'true' or 'chain', Puppet will ensure
|
938
|
+
that each CA in the chain of trust has not been revoked by its issuing CA.
|
938
939
|
|
939
|
-
When certificate_revocation is set to 'leaf', Puppet will
|
940
|
-
|
941
|
-
|
940
|
+
When certificate_revocation is set to 'leaf', Puppet will verify certs against
|
941
|
+
the issuing CA's revocation list but not verify the revocation status of the
|
942
|
+
issuing CA or any CA above it within the chain of trust.
|
942
943
|
|
943
|
-
When certificate_revocation is set to 'false', Puppet will disable all
|
944
|
-
attempt to download the CRL.
|
945
|
-
EOT
|
944
|
+
When certificate_revocation is set to 'false', Puppet will disable all
|
945
|
+
certificate revocation checking and will not attempt to download the CRL.
|
946
|
+
EOT
|
946
947
|
},
|
947
948
|
:digest_algorithm => {
|
948
949
|
:default => lambda { default_digest_algorithm },
|
@@ -1084,7 +1085,7 @@ EOT
|
|
1084
1085
|
the request.
|
1085
1086
|
|
1086
1087
|
For info on autosign configuration files, see
|
1087
|
-
[the guide to Puppet's config files](https://
|
1088
|
+
[the guide to Puppet's config files](https://puppet.com/docs/puppet/latest/config_about_settings.html).",
|
1088
1089
|
},
|
1089
1090
|
:allow_duplicate_certs => {
|
1090
1091
|
:default => false,
|
@@ -1157,7 +1158,7 @@ EOT
|
|
1157
1158
|
directory environments instead. If you need to use something other than the
|
1158
1159
|
environment's `manifests` directory as the main manifest, you can set
|
1159
1160
|
`manifest` in environment.conf. For more info, see
|
1160
|
-
<https://
|
1161
|
+
<https://puppet.com/docs/puppet/latest/environments_about.html>",
|
1161
1162
|
},
|
1162
1163
|
:modulepath => {
|
1163
1164
|
:default => "",
|
@@ -1171,7 +1172,7 @@ EOT
|
|
1171
1172
|
directory environments instead. If you need to use something other than the
|
1172
1173
|
default modulepath of `<ACTIVE ENVIRONMENT'S MODULES DIR>:$basemodulepath`,
|
1173
1174
|
you can set `modulepath` in environment.conf. For more info, see
|
1174
|
-
<https://
|
1175
|
+
<https://puppet.com/docs/puppet/latest/environments_about.html>",
|
1175
1176
|
},
|
1176
1177
|
:config_version => {
|
1177
1178
|
:default => "",
|
@@ -1183,7 +1184,7 @@ EOT
|
|
1183
1184
|
Setting a global value for config_version in puppet.conf is not allowed
|
1184
1185
|
(but it can be overridden from the commandline). Please set a
|
1185
1186
|
per-environment value in environment.conf instead. For more info, see
|
1186
|
-
<https://
|
1187
|
+
<https://puppet.com/docs/puppet/latest/environments_about.html>",
|
1187
1188
|
}
|
1188
1189
|
)
|
1189
1190
|
|
@@ -1295,7 +1296,7 @@ EOT
|
|
1295
1296
|
These are the modules that will be used by _all_ environments. Note that
|
1296
1297
|
the `modules` directory of the active environment will have priority over
|
1297
1298
|
any global directories. For more info, see
|
1298
|
-
<https://
|
1299
|
+
<https://puppet.com/docs/puppet/latest/environments_about.html>",
|
1299
1300
|
},
|
1300
1301
|
:ssl_client_header => {
|
1301
1302
|
:default => "HTTP_X_CLIENT_DN",
|
@@ -1481,7 +1482,7 @@ EOT
|
|
1481
1482
|
For control over logging destinations, see the `--logdest` command line
|
1482
1483
|
option in the manual pages for puppet master, puppet agent, and puppet
|
1483
1484
|
apply. You can see man pages by running `puppet <SUBCOMMAND> --help`,
|
1484
|
-
or read them online at https://
|
1485
|
+
or read them online at https://puppet.com/docs/puppet/latest/man/."
|
1485
1486
|
},
|
1486
1487
|
:server => {
|
1487
1488
|
:default => "puppet",
|
@@ -1550,7 +1551,7 @@ EOT
|
|
1550
1551
|
event _would_ have been sent.
|
1551
1552
|
|
1552
1553
|
**Important note:**
|
1553
|
-
[The `noop` metaparameter](https://
|
1554
|
+
[The `noop` metaparameter](https://puppet.com/docs/puppet/latest/metaparameter.html#noop)
|
1554
1555
|
allows you to apply individual resources in noop mode, and will override
|
1555
1556
|
the global value of the `noop` setting. This means a resource with
|
1556
1557
|
`noop => false` _will_ be changed if necessary, even when running puppet
|
@@ -1667,19 +1668,6 @@ EOT
|
|
1667
1668
|
:mode => "0750",
|
1668
1669
|
:desc => "Where FileBucket files are stored locally."
|
1669
1670
|
},
|
1670
|
-
:configtimeout => {
|
1671
|
-
:default => "2m",
|
1672
|
-
:type => :duration,
|
1673
|
-
:desc => "How long the client should wait for the configuration to be retrieved
|
1674
|
-
before considering it a failure. This setting is deprecated and has been replaced
|
1675
|
-
by http_connect_timeout and http_read_timeout.
|
1676
|
-
#{AS_DURATION}",
|
1677
|
-
:deprecated => :completely,
|
1678
|
-
:hook => proc do |value|
|
1679
|
-
Puppet[:http_connect_timeout] = value
|
1680
|
-
Puppet[:http_read_timeout] = value
|
1681
|
-
end
|
1682
|
-
},
|
1683
1671
|
:report_server => {
|
1684
1672
|
:default => "$server",
|
1685
1673
|
:desc => "The server to send transaction reports to.",
|
@@ -1893,7 +1881,7 @@ EOT
|
|
1893
1881
|
|
1894
1882
|
Generally, an ENC script makes requests to an external data source.
|
1895
1883
|
|
1896
|
-
For more info, see [the ENC documentation](https://
|
1884
|
+
For more info, see [the ENC documentation](https://puppet.com/docs/puppet/latest/nodes_external.html).",
|
1897
1885
|
}
|
1898
1886
|
)
|
1899
1887
|
|
@@ -2061,7 +2049,7 @@ EOT
|
|
2061
2049
|
end,
|
2062
2050
|
:desc => <<-'EOT'
|
2063
2051
|
Enables having extended data in the catalog by storing them as a hash with the special key
|
2064
|
-
`
|
2052
|
+
`__ptype`. When enabled, resource containing values of the data types `Binary`, `Regexp`,
|
2065
2053
|
`SemVer`, `SemVerRange`, `Timespan` and `Timestamp`, as well as instances of types derived
|
2066
2054
|
from `Object` retain their data type.
|
2067
2055
|
EOT
|
@@ -72,13 +72,8 @@ module Puppet
|
|
72
72
|
end
|
73
73
|
|
74
74
|
def self.from_issue_and_stack(issue, args = {})
|
75
|
-
|
76
|
-
|
77
|
-
filename, line = stacktrace[0]
|
78
|
-
else
|
79
|
-
filename = nil
|
80
|
-
line = nil
|
81
|
-
end
|
75
|
+
filename, line = Puppet::Pops::PuppetStack.top_of_stack
|
76
|
+
|
82
77
|
self.new(
|
83
78
|
issue.format(args),
|
84
79
|
filename,
|
@@ -107,4 +102,16 @@ module Puppet
|
|
107
102
|
class LockError < Puppet::Error
|
108
103
|
end
|
109
104
|
|
105
|
+
# An Error suitable for raising an error with details in a Puppet::Datatypes::Error
|
106
|
+
# that can be used as a value in the Puppet Language
|
107
|
+
#
|
108
|
+
class ErrorWithData < Puppet::Error
|
109
|
+
include ExternalFileError
|
110
|
+
attr_reader :error_data
|
111
|
+
|
112
|
+
def initialize(error_data, message, file: nil, line: nil, pos: nil, original:nil)
|
113
|
+
super(message, file, line, pos, original)
|
114
|
+
@error_data = error_data
|
115
|
+
end
|
116
|
+
end
|
110
117
|
end
|