puppet 6.4.5-x64-mingw32 → 6.5.0-x64-mingw32
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of puppet might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/CODEOWNERS +10 -10
- data/Gemfile +6 -6
- data/Gemfile.lock +46 -52
- data/ext/build_defaults.yaml +0 -1
- data/ext/project_data.yaml +3 -3
- data/ext/regexp_nodes/regexp_nodes.rb +4 -4
- data/ext/solaris/smf/puppet.xml +0 -2
- data/ext/windows/eventlog/Rakefile +32 -0
- data/ext/windows/eventlog/puppetres.dll +0 -0
- data/ext/windows/eventlog/puppetres.mc +18 -0
- data/ext/windows/service/daemon.rb +8 -38
- data/install.rb +24 -6
- data/lib/puppet.rb +3 -1
- data/lib/puppet/application.rb +1 -1
- data/lib/puppet/application/agent.rb +11 -34
- data/lib/puppet/application/apply.rb +6 -6
- data/lib/puppet/application/describe.rb +9 -3
- data/lib/puppet/application/device.rb +4 -14
- data/lib/puppet/application/doc.rb +1 -1
- data/lib/puppet/application/lookup.rb +2 -2
- data/lib/puppet/application/resource.rb +4 -4
- data/lib/puppet/application/script.rb +2 -2
- data/lib/puppet/application/ssl.rb +10 -9
- data/lib/puppet/configurer.rb +30 -86
- data/lib/puppet/configurer/downloader.rb +6 -2
- data/lib/puppet/defaults.rb +50 -44
- data/lib/puppet/error.rb +14 -9
- data/lib/puppet/face/catalog.rb +20 -1
- data/lib/puppet/face/config.rb +48 -10
- data/lib/puppet/face/facts.rb +1 -1
- data/lib/puppet/face/help.rb +1 -1
- data/lib/puppet/face/module/list.rb +5 -5
- data/lib/puppet/face/module/search.rb +1 -1
- data/lib/puppet/face/module/uninstall.rb +1 -1
- data/lib/puppet/face/module/upgrade.rb +1 -1
- data/lib/puppet/face/parser.rb +48 -9
- data/lib/puppet/face/plugin.rb +2 -9
- data/lib/puppet/file_serving/http_metadata.rb +1 -1
- data/lib/puppet/file_system.rb +12 -2
- data/lib/puppet/file_system/file_impl.rb +6 -3
- data/lib/puppet/file_system/memory_file.rb +1 -1
- data/lib/puppet/file_system/posix.rb +2 -3
- data/lib/puppet/forge.rb +3 -3
- data/lib/puppet/functions.rb +2 -1
- 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/functions/regsubst.rb +6 -8
- 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 +3 -4
- data/lib/puppet/indirector/catalog/compiler.rb +5 -11
- data/lib/puppet/indirector/file_bucket_file/file.rb +1 -1
- data/lib/puppet/indirector/hiera.rb +0 -2
- data/lib/puppet/indirector/resource/ral.rb +3 -1
- data/lib/puppet/indirector/resource/validator.rb +1 -1
- data/lib/puppet/interface.rb +1 -2
- data/lib/puppet/loaders.rb +1 -0
- data/lib/puppet/metatype/manager.rb +1 -1
- data/lib/puppet/module.rb +1 -1
- data/lib/puppet/module/task.rb +4 -20
- 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 +2 -12
- data/lib/puppet/network/http/api/indirected_routes.rb +11 -12
- data/lib/puppet/network/http/connection.rb +12 -10
- data/lib/puppet/network/http/factory.rb +11 -1
- data/lib/puppet/network/http/pool.rb +0 -2
- data/lib/puppet/network/http/site.rb +1 -1
- data/lib/puppet/network/resolver.rb +2 -2
- data/lib/puppet/node/environment.rb +2 -4
- 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/fail.rb +8 -1
- data/lib/puppet/parser/functions/inline_epp.rb +5 -5
- data/lib/puppet/parser/scope.rb +7 -8
- 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 +2 -3
- data/lib/puppet/pops/evaluator/runtime3_support.rb +4 -4
- data/lib/puppet/pops/loader/null_loader.rb +60 -0
- data/lib/puppet/pops/loader/ruby_legacy_function_instantiator.rb +6 -4
- data/lib/puppet/pops/loader/task_instantiator.rb +0 -4
- data/lib/puppet/pops/loaders.rb +1 -1
- data/lib/puppet/pops/lookup/hiera_config.rb +0 -1
- data/lib/puppet/pops/lookup/sub_lookup.rb +1 -1
- data/lib/puppet/pops/merge_strategy.rb +18 -22
- 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 +16 -17
- data/lib/puppet/pops/puppet_stack.rb +49 -51
- 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 +6 -5
- data/lib/puppet/property.rb +1 -1
- data/lib/puppet/property/ensure.rb +1 -1
- data/lib/puppet/provider/exec.rb +2 -6
- data/lib/puppet/provider/file/posix.rb +0 -5
- data/lib/puppet/provider/nameservice.rb +3 -10
- data/lib/puppet/provider/nameservice/directoryservice.rb +1 -1
- data/lib/puppet/provider/nameservice/pw.rb +2 -2
- data/lib/puppet/provider/package.rb +0 -2
- data/lib/puppet/provider/package/apt.rb +1 -5
- data/lib/puppet/provider/package/dnf.rb +1 -1
- data/lib/puppet/provider/package/dpkg.rb +18 -34
- data/lib/puppet/provider/package/openbsd.rb +1 -1
- data/lib/puppet/provider/package/pip.rb +13 -37
- data/lib/puppet/provider/package/portage.rb +4 -4
- data/lib/puppet/provider/package/puppet_gem.rb +1 -1
- data/lib/puppet/provider/package/rpm.rb +18 -56
- data/lib/puppet/provider/package/windows/package.rb +1 -1
- data/lib/puppet/provider/package/yum.rb +5 -9
- data/lib/puppet/provider/package_targetable.rb +4 -7
- data/lib/puppet/provider/parsedfile.rb +1 -1
- data/lib/puppet/provider/service/daemontools.rb +9 -9
- data/lib/puppet/provider/service/launchd.rb +5 -20
- 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 +8 -2
- data/lib/puppet/provider/service/systemd.rb +19 -14
- data/lib/puppet/provider/service/windows.rb +0 -8
- data/lib/puppet/provider/user/directoryservice.rb +1 -1
- data/lib/puppet/provider/user/hpux.rb +1 -1
- data/lib/puppet/provider/user/pw.rb +3 -12
- data/lib/puppet/provider/user/user_role_add.rb +1 -5
- data/lib/puppet/provider/user/useradd.rb +20 -45
- data/lib/puppet/provider/user/windows_adsi.rb +5 -4
- data/lib/puppet/reference/configuration.rb +3 -3
- data/lib/puppet/reference/indirection.rb +2 -2
- data/lib/puppet/reference/metaparameter.rb +3 -1
- data/lib/puppet/reference/providers.rb +3 -1
- data/lib/puppet/reference/type.rb +9 -3
- data/lib/puppet/reports.rb +1 -1
- data/lib/puppet/resource.rb +1 -18
- data/lib/puppet/resource/catalog.rb +1 -1
- data/lib/puppet/rest/routes.rb +30 -17
- data/lib/puppet/settings.rb +3 -43
- data/lib/puppet/settings/environment_conf.rb +0 -1
- data/lib/puppet/ssl/certificate_request.rb +12 -2
- data/lib/puppet/ssl/host.rb +2 -2
- data/lib/puppet/ssl/oids.rb +1 -1
- data/lib/puppet/ssl/ssl_provider.rb +11 -5
- data/lib/puppet/ssl/state_machine.rb +102 -98
- data/lib/puppet/test/test_helper.rb +1 -0
- data/lib/puppet/transaction.rb +11 -33
- data/lib/puppet/transaction/report.rb +1 -1
- data/lib/puppet/type.rb +4 -2
- data/lib/puppet/type/exec.rb +17 -23
- data/lib/puppet/type/file.rb +39 -11
- data/lib/puppet/type/file/data_sync.rb +1 -5
- data/lib/puppet/type/group.rb +2 -4
- data/lib/puppet/type/notify.rb +3 -4
- data/lib/puppet/type/package.rb +3 -20
- data/lib/puppet/type/schedule.rb +1 -1
- data/lib/puppet/type/service.rb +3 -8
- data/lib/puppet/type/user.rb +2 -4
- data/lib/puppet/util.rb +29 -39
- data/lib/puppet/util/command_line/trollop.rb +1 -1
- data/lib/puppet/util/execution.rb +3 -4
- data/lib/puppet/util/http_proxy.rb +19 -27
- data/lib/puppet/util/log.rb +2 -2
- data/lib/puppet/util/log/destinations.rb +2 -2
- data/lib/puppet/util/logging.rb +20 -32
- data/lib/puppet/util/metric.rb +2 -2
- data/lib/puppet/util/monkey_patches.rb +33 -0
- data/lib/puppet/util/pidlock.rb +2 -3
- data/lib/puppet/util/provider_features.rb +4 -2
- 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 +2 -8
- data/lib/puppet/util/skip_tags.rb +4 -0
- data/lib/puppet/util/windows/adsi.rb +18 -48
- data/lib/puppet/util/windows/process.rb +8 -8
- data/lib/puppet/util/windows/registry.rb +5 -7
- data/lib/puppet/util/windows/security.rb +0 -2
- data/lib/puppet/util/windows/service.rb +4 -149
- data/lib/puppet/util/windows/sid.rb +0 -1
- data/lib/puppet/vendor.rb +1 -1
- data/lib/puppet/version.rb +1 -1
- data/lib/puppet/x509/cert_provider.rb +81 -24
- data/locales/puppet.pot +462 -482
- data/man/man5/puppet.conf.5 +43 -44
- data/man/man8/puppet-agent.8 +1 -1
- data/man/man8/puppet-apply.8 +3 -3
- data/man/man8/puppet-catalog.8 +31 -3
- 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 +3 -3
- data/spec/fixtures/ssl/127.0.0.1-key.pem +56 -56
- data/spec/fixtures/ssl/127.0.0.1.pem +27 -27
- data/spec/fixtures/ssl/bad-basic-constraints.pem +32 -32
- data/spec/fixtures/ssl/bad-int-basic-constraints.pem +30 -30
- data/spec/fixtures/ssl/ca.pem +30 -30
- data/spec/fixtures/ssl/crl.pem +15 -15
- data/spec/fixtures/ssl/ec-key.pem +18 -0
- data/spec/fixtures/ssl/ec.pem +40 -0
- data/spec/fixtures/ssl/encrypted-ec-key.pem +21 -0
- data/spec/fixtures/ssl/encrypted-key.pem +57 -57
- data/spec/fixtures/ssl/intermediate-agent-crl.pem +16 -16
- data/spec/fixtures/ssl/intermediate-agent.pem +33 -33
- data/spec/fixtures/ssl/intermediate-crl.pem +17 -17
- data/spec/fixtures/ssl/intermediate.pem +31 -31
- data/spec/fixtures/ssl/pluto-key.pem +56 -56
- data/spec/fixtures/ssl/pluto.pem +28 -28
- data/spec/fixtures/ssl/request-key.pem +56 -56
- data/spec/fixtures/ssl/request.pem +24 -24
- data/spec/fixtures/ssl/revoked-key.pem +56 -56
- data/spec/fixtures/ssl/revoked.pem +25 -25
- data/spec/fixtures/ssl/signed-key.pem +56 -56
- data/spec/fixtures/ssl/signed.pem +25 -25
- data/spec/fixtures/ssl/tampered-cert.pem +27 -27
- data/spec/fixtures/ssl/tampered-csr.pem +24 -24
- data/spec/fixtures/unit/pops/loaders/loaders/mix_4x_and_3x_functions/usee/lib/puppet/parser/functions/func_with_syntax_error.rb +9 -0
- data/spec/fixtures/vcr/cassettes/Puppet_Network_HTTP_Connection/when_handling_requests/_request_get/should_yield_to_the_block.yml +24 -0
- data/spec/fixtures/vcr/cassettes/Puppet_Network_HTTP_Connection/when_handling_requests/_request_head/should_yield_to_the_block.yml +24 -0
- data/spec/fixtures/vcr/cassettes/Puppet_Network_HTTP_Connection/when_handling_requests/_request_post/should_yield_to_the_block.yml +24 -0
- data/spec/integration/configurer_spec.rb +0 -52
- data/spec/integration/provider/service/init_spec.rb +1 -0
- data/spec/integration/provider/service/systemd_spec.rb +5 -8
- data/spec/integration/type/file_spec.rb +38 -28
- data/spec/integration/util/execution_spec.rb +0 -27
- data/spec/lib/puppet/certificate_factory.rb +2 -2
- data/spec/lib/puppet/test_ca.rb +17 -4
- data/spec/lib/puppet_spec/fixtures.rb +4 -0
- data/spec/spec_helper.rb +0 -28
- data/spec/unit/application/agent_spec.rb +34 -67
- data/spec/unit/application/device_spec.rb +1 -27
- data/spec/unit/application/ssl_spec.rb +60 -35
- data/spec/unit/configurer_spec.rb +399 -395
- data/spec/unit/defaults_spec.rb +4 -4
- data/spec/unit/face/facts_spec.rb +0 -9
- data/spec/unit/face/parser_spec.rb +69 -22
- data/spec/unit/face/plugin_spec.rb +0 -8
- data/spec/unit/file_system_spec.rb +30 -1
- data/spec/unit/forge/forge_spec.rb +3 -1
- data/spec/unit/forge/repository_spec.rb +3 -1
- data/spec/unit/indirector/catalog/compiler_spec.rb +5 -62
- data/spec/unit/indirector/resource/ral_spec.rb +4 -4
- data/spec/unit/module_tool/tar/mini_spec.rb +1 -1
- data/spec/unit/network/http/api/indirected_routes_spec.rb +10 -25
- data/spec/unit/network/http/connection_spec.rb +145 -119
- data/spec/unit/network/http/factory_spec.rb +5 -27
- data/spec/unit/parser/scope_spec.rb +0 -10
- data/spec/unit/pops/evaluator/evaluating_parser_spec.rb +3 -8
- data/spec/unit/pops/loaders/loaders_spec.rb +4 -0
- data/spec/unit/pops/loaders/module_loaders_spec.rb +0 -37
- data/spec/unit/pops/types/types_spec.rb +27 -0
- data/spec/unit/provider/exec_spec.rb +0 -209
- data/spec/unit/provider/package/aptrpm_spec.rb +1 -1
- data/spec/unit/provider/package/dnf_spec.rb +0 -7
- data/spec/unit/provider/package/dpkg_spec.rb +80 -240
- data/spec/unit/provider/package/pip_spec.rb +8 -61
- data/spec/unit/provider/package/portage_spec.rb +4 -4
- data/spec/unit/provider/package/rpm_spec.rb +16 -150
- data/spec/unit/provider/package/yum_spec.rb +0 -7
- data/spec/unit/provider/service/daemontools_spec.rb +0 -24
- data/spec/unit/provider/service/launchd_spec.rb +0 -28
- data/spec/unit/provider/service/runit_spec.rb +0 -24
- data/spec/unit/provider/service/systemd_spec.rb +25 -39
- data/spec/unit/provider/service/windows_spec.rb +0 -20
- data/spec/unit/provider/user/hpux_spec.rb +2 -2
- data/spec/unit/provider/user/pw_spec.rb +0 -37
- data/spec/unit/provider/user/useradd_spec.rb +0 -88
- data/spec/unit/resource_spec.rb +1 -26
- data/spec/unit/ssl/host_spec.rb +5 -0
- data/spec/unit/ssl/ssl_provider_spec.rb +36 -11
- data/spec/unit/ssl/state_machine_spec.rb +233 -158
- data/spec/unit/transaction_spec.rb +0 -64
- data/spec/unit/type/exec_spec.rb +12 -15
- data/spec/unit/type/file/content_spec.rb +3 -9
- data/spec/unit/type/file/source_spec.rb +4 -4
- data/spec/unit/type/file_spec.rb +15 -11
- data/spec/unit/type/package_spec.rb +0 -5
- data/spec/unit/type/schedule_spec.rb +1 -3
- data/spec/unit/type/service_spec.rb +0 -16
- data/spec/unit/util/execution_spec.rb +0 -16
- data/spec/unit/util/http_proxy_spec.rb +21 -151
- data/spec/unit/util/ldap/manager_spec.rb +0 -15
- data/spec/unit/util/log/destinations_spec.rb +3 -7
- data/spec/unit/util/log_spec.rb +138 -0
- data/spec/unit/util/logging_spec.rb +0 -200
- data/spec/unit/util/pidlock_spec.rb +0 -26
- data/spec/unit/util/skip_tags_spec.rb +14 -0
- data/spec/unit/util/windows/adsi_spec.rb +0 -51
- data/spec/unit/util/windows/service_spec.rb +0 -9
- data/spec/unit/util_spec.rb +10 -0
- data/spec/unit/x509/cert_provider_spec.rb +82 -43
- data/tasks/generate_cert_fixtures.rake +13 -1
- data/tasks/manpages.rake +0 -1
- metadata +28 -22
- data/ext/cert_inspector +0 -140
- data/ext/envpuppet +0 -139
- data/ext/envpuppet.bat +0 -14
- data/ext/puppet-test +0 -476
- data/ext/pure_ruby_dsl/dsl_test.rb +0 -7
- data/ext/upload_facts.rb +0 -119
- data/lib/puppet/provider/package/dnfmodule.rb +0 -87
- data/spec/fixtures/unit/provider/package/dnfmodule/dnf-module-list-installed.txt +0 -11
- data/spec/integration/type/notify_spec.rb +0 -46
- data/spec/unit/provider/package/dnfmodule_spec.rb +0 -186
- data/spec/unit/provider/package_targetable_spec.rb +0 -60
data/install.rb
CHANGED
@@ -62,6 +62,24 @@ def do_configs(configs, target, strip = 'conf/')
|
|
62
62
|
ocf = File.join(InstallOptions.config_dir, cf.gsub(/#{strip}/, ''))
|
63
63
|
FileUtils.install(cf, ocf, {:mode => 0644, :preserve => true, :verbose => true})
|
64
64
|
end
|
65
|
+
|
66
|
+
if $operatingsystem == 'windows'
|
67
|
+
src_dll = 'ext/windows/eventlog/puppetres.dll'
|
68
|
+
dst_dll = File.join(InstallOptions.bin_dir, 'puppetres.dll')
|
69
|
+
FileUtils.install(src_dll, dst_dll, {:mode => 0644, :preserve => true, :verbose => true})
|
70
|
+
|
71
|
+
require 'win32/registry'
|
72
|
+
include Win32::Registry::Constants
|
73
|
+
|
74
|
+
begin
|
75
|
+
Win32::Registry::HKEY_LOCAL_MACHINE.create('SYSTEM\CurrentControlSet\services\eventlog\Application\Puppet', KEY_ALL_ACCESS | 0x0100) do |reg|
|
76
|
+
reg.write_s('EventMessageFile', dst_dll.tr('/', '\\'))
|
77
|
+
reg.write_i('TypesSupported', 0x7)
|
78
|
+
end
|
79
|
+
rescue Win32::Registry::Error => e
|
80
|
+
warn "Failed to create puppet eventlog registry key: #{e}"
|
81
|
+
end
|
82
|
+
end
|
65
83
|
end
|
66
84
|
|
67
85
|
def do_bins(bins, target, strip = 's?bin/')
|
@@ -122,12 +140,12 @@ def check_prereqs
|
|
122
140
|
facter_version = Facter.version.to_f
|
123
141
|
if facter_version < MIN_FACTER_VERSION
|
124
142
|
puts "Facter version: #{facter_version}; minimum required: #{MIN_FACTER_VERSION}; cannot install"
|
125
|
-
exit
|
143
|
+
exit -1
|
126
144
|
end
|
127
145
|
end
|
128
146
|
rescue LoadError
|
129
147
|
puts "Could not load #{pre}; cannot install"
|
130
|
-
exit
|
148
|
+
exit -1
|
131
149
|
end
|
132
150
|
}
|
133
151
|
end
|
@@ -248,7 +266,7 @@ def prepare_installation
|
|
248
266
|
require 'win32/dir'
|
249
267
|
rescue LoadError => e
|
250
268
|
puts "Cannot run on Microsoft Windows without the win32-process, win32-dir & win32-service gems: #{e}"
|
251
|
-
exit
|
269
|
+
exit -1
|
252
270
|
end
|
253
271
|
end
|
254
272
|
|
@@ -437,13 +455,13 @@ def install_binfile(from, op_file, target)
|
|
437
455
|
if $operatingsystem == "windows" && InstallOptions.batch_files
|
438
456
|
installed_wrapper = false
|
439
457
|
|
440
|
-
unless File.extname(from)
|
441
|
-
if File.
|
458
|
+
unless File.extname(from).match(/\.(cmd|bat)/)
|
459
|
+
if File.exists?("#{from}.bat")
|
442
460
|
FileUtils.install("#{from}.bat", File.join(target, "#{op_file}.bat"), :mode => 0755, :preserve => true, :verbose => true)
|
443
461
|
installed_wrapper = true
|
444
462
|
end
|
445
463
|
|
446
|
-
if File.
|
464
|
+
if File.exists?("#{from}.cmd")
|
447
465
|
FileUtils.install("#{from}.cmd", File.join(target, "#{op_file}.cmd"), :mode => 0755, :preserve => true, :verbose => true)
|
448
466
|
installed_wrapper = true
|
449
467
|
end
|
data/lib/puppet.rb
CHANGED
@@ -209,8 +209,10 @@ module Puppet
|
|
209
209
|
},
|
210
210
|
:ssl_context => proc {
|
211
211
|
begin
|
212
|
+
cert = Puppet::X509::CertProvider.new
|
213
|
+
password = cert.load_private_key_password
|
212
214
|
ssl = Puppet::SSL::SSLProvider.new
|
213
|
-
ssl.load_context(certname: Puppet[:certname])
|
215
|
+
ssl.load_context(certname: Puppet[:certname], password: password)
|
214
216
|
rescue => e
|
215
217
|
# TRANSLATORS: `message` is an already translated string of why SSL failed to initialize
|
216
218
|
Puppet.log_exception(e, _("Failed to initialize SSL: %{message}") % { message: e.message })
|
data/lib/puppet/application.rb
CHANGED
@@ -183,7 +183,7 @@ class Application
|
|
183
183
|
|
184
184
|
# used to declare code that handle an option
|
185
185
|
def option(*options, &block)
|
186
|
-
long = options.find { |opt| opt =~ /^--/ }.gsub(/^--(?:\[no-\])?([^ =]+).*$/, '\1' ).
|
186
|
+
long = options.find { |opt| opt =~ /^--/ }.gsub(/^--(?:\[no-\])?([^ =]+).*$/, '\1' ).gsub('-','_')
|
187
187
|
fname = "handle_#{long}".intern
|
188
188
|
if (block_given?)
|
189
189
|
define_method(fname, &block)
|
@@ -347,45 +347,22 @@ Copyright (c) 2011 Puppet Inc., LLC Licensed under the Apache 2.0 License
|
|
347
347
|
# Setup signal traps immediately after daemonization so we clean up the daemon
|
348
348
|
daemon.set_signal_traps
|
349
349
|
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
else
|
357
|
-
main(daemon)
|
350
|
+
Puppet.override(ssl_context: wait_for_certificates) do
|
351
|
+
if Puppet[:onetime]
|
352
|
+
onetime(daemon)
|
353
|
+
else
|
354
|
+
main(daemon)
|
355
|
+
end
|
358
356
|
end
|
359
357
|
end
|
360
358
|
end
|
361
359
|
|
362
|
-
def log_config
|
363
|
-
#skip also config reading and parsing if debug is not enabled
|
364
|
-
return unless Puppet::Util::Log.sendlevel?(:debug)
|
365
|
-
|
366
|
-
Puppet.settings.stringify_settings(:agent, :all).each_pair do |k,v|
|
367
|
-
next if k.include?("password") || v.to_s.empty?
|
368
|
-
Puppet.debug("Using setting: #{k}=#{v}")
|
369
|
-
end
|
370
|
-
end
|
371
|
-
|
372
360
|
def fingerprint
|
373
|
-
Puppet::
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
else
|
379
|
-
csr = cert_provider.load_request(Puppet[:certname])
|
380
|
-
if csr
|
381
|
-
puts Puppet::SSL::Digest.new(options[:digest].to_s, csr.to_der).to_s
|
382
|
-
else
|
383
|
-
$stderr.puts _("Fingerprint asked but neither the certificate, nor the certificate request have been issued")
|
384
|
-
exit(1)
|
385
|
-
end
|
386
|
-
end
|
387
|
-
rescue => e
|
388
|
-
Puppet.log_exception(e, _("Failed to generate fingerprint: %{message}") % {message: e.message})
|
361
|
+
sm = Puppet::SSL::StateMachine.new(onetime: true)
|
362
|
+
ssl_context = sm.ensure_client_certificate
|
363
|
+
puts Puppet::SSL::Digest.new(options[:digest].to_s, ssl_context.client_cert.to_der).to_s
|
364
|
+
rescue
|
365
|
+
$stderr.puts _("Fingerprint asked but no certificate nor certificate request have yet been issued")
|
389
366
|
exit(1)
|
390
367
|
end
|
391
368
|
|
@@ -72,15 +72,15 @@ manifests.
|
|
72
72
|
|
73
73
|
OPTIONS
|
74
74
|
-------
|
75
|
-
|
76
|
-
file is
|
75
|
+
Any setting that's valid in the configuration
|
76
|
+
file is a valid long argument for puppet apply. For example, 'tags' is a
|
77
77
|
valid setting, so you can specify '--tags <class>,<tag>'
|
78
78
|
as an argument.
|
79
79
|
|
80
80
|
See the configuration file documentation at
|
81
81
|
https://puppet.com/docs/puppet/latest/configuration.html for the
|
82
|
-
full list of acceptable parameters.
|
83
|
-
configuration options
|
82
|
+
full list of acceptable parameters. You can generate a commented list of all
|
83
|
+
configuration options by running puppet with
|
84
84
|
'--genconfig'.
|
85
85
|
|
86
86
|
* --debug:
|
@@ -230,8 +230,8 @@ Copyright (c) 2011 Puppet Inc., LLC Licensed under the Apache 2.0 License
|
|
230
230
|
catalog =
|
231
231
|
begin
|
232
232
|
Puppet::Resource::Catalog.indirection.find(node.name, :use_node => node)
|
233
|
-
rescue Puppet::Error
|
234
|
-
# already logged and handled by the compiler
|
233
|
+
rescue Puppet::ParseErrorWithIssue, Puppet::Error
|
234
|
+
# already logged and handled by the compiler for these two cases
|
235
235
|
exit(1)
|
236
236
|
end
|
237
237
|
|
@@ -64,7 +64,9 @@ class TypeDoc
|
|
64
64
|
|
65
65
|
def list_types
|
66
66
|
puts "These are the types known to puppet:\n"
|
67
|
-
@types.keys.
|
67
|
+
@types.keys.sort { |a, b|
|
68
|
+
a.to_s <=> b.to_s
|
69
|
+
}.each do |name|
|
68
70
|
type = @types[name]
|
69
71
|
s = type.doc.gsub(/\s+/, " ")
|
70
72
|
n = s.index(". ")
|
@@ -147,14 +149,18 @@ class TypeDoc
|
|
147
149
|
end
|
148
150
|
|
149
151
|
def format_providers(type)
|
150
|
-
type.providers.
|
152
|
+
type.providers.sort { |a,b|
|
153
|
+
a.to_s <=> b.to_s
|
154
|
+
}.each { |prov|
|
151
155
|
puts "\n- **#{prov}**"
|
152
156
|
puts @format.wrap(type.provider(prov).doc, :indent => 4, :scrub => true)
|
153
157
|
}
|
154
158
|
end
|
155
159
|
|
156
160
|
def list_providers(type)
|
157
|
-
list = type.providers.
|
161
|
+
list = type.providers.sort { |a,b|
|
162
|
+
a.to_s <=> b.to_s
|
163
|
+
}.join(", ")
|
158
164
|
puts @format.wrap(list, :indent => 4)
|
159
165
|
end
|
160
166
|
|
@@ -238,7 +238,6 @@ Licensed under the Apache 2.0 License
|
|
238
238
|
libdir = Puppet[:libdir]
|
239
239
|
vardir = Puppet[:vardir]
|
240
240
|
confdir = Puppet[:confdir]
|
241
|
-
ssldir = Puppet[:ssldir]
|
242
241
|
certname = Puppet[:certname]
|
243
242
|
|
244
243
|
env = Puppet::Node::Environment.remote(Puppet[:environment])
|
@@ -268,23 +267,15 @@ Licensed under the Apache 2.0 License
|
|
268
267
|
port = ":#{device_url.port}" if device_url.port
|
269
268
|
|
270
269
|
# override local $vardir and $certname
|
271
|
-
Puppet[:ssldir] = ::File.join(Puppet[:deviceconfdir], device.name, 'ssl')
|
272
270
|
Puppet[:confdir] = ::File.join(Puppet[:devicedir], device.name)
|
273
271
|
Puppet[:libdir] = options[:libdir] || ::File.join(Puppet[:devicedir], device.name, 'lib')
|
274
272
|
Puppet[:vardir] = ::File.join(Puppet[:devicedir], device.name)
|
275
273
|
Puppet[:certname] = device.name
|
276
274
|
ssl_context = nil
|
277
275
|
|
278
|
-
# create device directory under $deviceconfdir
|
279
|
-
Puppet::FileSystem.dir_mkpath(Puppet[:ssldir]) unless Puppet::FileSystem.dir_exist?(Puppet[:ssldir])
|
280
|
-
|
281
276
|
# this will reload and recompute default settings and create device-specific sub vardir
|
282
277
|
Puppet.settings.use :main, :agent, :ssl
|
283
278
|
|
284
|
-
# Workaround for PUP-8736: store ssl certs outside the cache directory to prevent accidental removal and keep the old path as symlink
|
285
|
-
optssldir = File.join(Puppet[:confdir], 'ssl')
|
286
|
-
Puppet::FileSystem.symlink(Puppet[:ssldir], optssldir) unless Puppet::FileSystem.exist?(optssldir)
|
287
|
-
|
288
279
|
unless options[:resource] || options[:facts] || options[:apply]
|
289
280
|
# Since it's too complicated to fix properly in the default settings, we workaround for PUP-9642 here.
|
290
281
|
# See https://github.com/puppetlabs/puppet/pull/7483#issuecomment-483455997 for details.
|
@@ -315,10 +306,10 @@ Licensed under the Apache 2.0 License
|
|
315
306
|
Puppet.info _("retrieving resource: %{resource} from %{target} at %{scheme}%{url_host}%{port}%{url_path}") % { resource: type, target: device.name, scheme: scheme, url_host: device_url.host, port: port, url_path: device_url.path }
|
316
307
|
resources = find_resources(type, name)
|
317
308
|
if options[:to_yaml]
|
318
|
-
|
319
|
-
resource.prune_parameters(:parameters_to_include => @extra_params).
|
320
|
-
end.
|
321
|
-
text
|
309
|
+
text = resources.map do |resource|
|
310
|
+
resource.prune_parameters(:parameters_to_include => @extra_params).to_hierayaml.force_encoding(Encoding.default_external)
|
311
|
+
end.join("\n")
|
312
|
+
text.prepend("#{type.downcase}:\n")
|
322
313
|
else
|
323
314
|
text = resources.map do |resource|
|
324
315
|
resource.prune_parameters(:parameters_to_include => @extra_params).to_manifest.force_encoding(Encoding.default_external)
|
@@ -368,7 +359,6 @@ Licensed under the Apache 2.0 License
|
|
368
359
|
Puppet[:libdir] = libdir
|
369
360
|
Puppet[:vardir] = vardir
|
370
361
|
Puppet[:confdir] = confdir
|
371
|
-
Puppet[:ssldir] = ssldir
|
372
362
|
Puppet[:certname] = certname
|
373
363
|
end
|
374
364
|
end
|
@@ -155,7 +155,7 @@ HELP
|
|
155
155
|
with_contents = options[:references].length <= 1
|
156
156
|
exit_code = 0
|
157
157
|
require 'puppet/util/reference'
|
158
|
-
options[:references].
|
158
|
+
options[:references].sort { |a,b| a.to_s <=> b.to_s }.each do |name|
|
159
159
|
raise _("Could not find reference %{name}") % { name: name } unless section = Puppet::Util::Reference.reference(name)
|
160
160
|
|
161
161
|
begin
|
@@ -33,7 +33,7 @@ class Puppet::Application::Lookup < Puppet::Application
|
|
33
33
|
options[:prefix] = arg
|
34
34
|
end
|
35
35
|
|
36
|
-
option('--sort-
|
36
|
+
option('--sort-merged-arrays')
|
37
37
|
|
38
38
|
option('--merge-hash-arrays')
|
39
39
|
|
@@ -283,7 +283,7 @@ Copyright (c) 2015 Puppet Inc., LLC Licensed under the Apache 2.0 License
|
|
283
283
|
'merge_hash_arrays' => !options[:merge_hash_arrays].nil?}
|
284
284
|
|
285
285
|
if options[:prefix]
|
286
|
-
merge_options
|
286
|
+
merge_options.merge!({'knockout_prefix' => options[:prefix]})
|
287
287
|
end
|
288
288
|
|
289
289
|
else
|
@@ -142,10 +142,10 @@ Copyright (c) 2011 Puppet Inc., LLC Licensed under the Apache 2.0 License
|
|
142
142
|
resources = find_or_save_resources(type, name, params)
|
143
143
|
|
144
144
|
if options[:to_yaml]
|
145
|
-
|
146
|
-
resource.prune_parameters(:parameters_to_include => @extra_params).
|
147
|
-
end.
|
148
|
-
text
|
145
|
+
text = resources.map do |resource|
|
146
|
+
resource.prune_parameters(:parameters_to_include => @extra_params).to_hierayaml.force_encoding(Encoding.default_external)
|
147
|
+
end.join("\n")
|
148
|
+
text.prepend("#{type.downcase}:\n")
|
149
149
|
else
|
150
150
|
text = resources.map do |resource|
|
151
151
|
resource.prune_parameters(:parameters_to_include => @extra_params).to_manifest.force_encoding(Encoding.default_external)
|
@@ -212,8 +212,8 @@ Copyright (c) 2017 Puppet Inc., LLC Licensed under the Apache 2.0 License
|
|
212
212
|
|
213
213
|
compiler.compile()
|
214
214
|
|
215
|
-
rescue Puppet::Error
|
216
|
-
# already logged and handled by the compiler
|
215
|
+
rescue Puppet::ParseErrorWithIssue, Puppet::Error
|
216
|
+
# already logged and handled by the compiler for these two cases
|
217
217
|
exit(1)
|
218
218
|
end
|
219
219
|
|
@@ -112,8 +112,6 @@ HELP
|
|
112
112
|
Puppet.settings.use(:main, :agent)
|
113
113
|
end
|
114
114
|
|
115
|
-
Puppet::SSL::Oids.register_puppet_oids
|
116
|
-
|
117
115
|
certname = Puppet[:certname]
|
118
116
|
action = command_line.args.first
|
119
117
|
case action
|
@@ -149,8 +147,13 @@ HELP
|
|
149
147
|
def submit_request(ssl_context)
|
150
148
|
key = @cert_provider.load_private_key(Puppet[:certname])
|
151
149
|
unless key
|
152
|
-
|
153
|
-
|
150
|
+
if Puppet[:key_type] == 'ec'
|
151
|
+
Puppet.info _("Creating a new EC SSL key for %{name} using curve %{curve}") % { name: Puppet[:certname], curve: Puppet[:named_curve] }
|
152
|
+
key = OpenSSL::PKey::EC.generate(Puppet[:named_curve])
|
153
|
+
else
|
154
|
+
Puppet.info _("Creating a new SSL key for %{name}") % { name: Puppet[:certname] }
|
155
|
+
key = OpenSSL::PKey::RSA.new(Puppet[:keylength].to_i)
|
156
|
+
end
|
154
157
|
@cert_provider.save_private_key(Puppet[:certname], key)
|
155
158
|
end
|
156
159
|
|
@@ -203,7 +206,8 @@ HELP
|
|
203
206
|
end
|
204
207
|
|
205
208
|
def verify(certname)
|
206
|
-
|
209
|
+
password = @cert_provider.load_private_key_password
|
210
|
+
ssl_context = @ssl_provider.load_context(certname: certname, password: password)
|
207
211
|
|
208
212
|
# print from root to client
|
209
213
|
ssl_context.client_chain.reverse.each_with_index do |cert, i|
|
@@ -249,10 +253,7 @@ END
|
|
249
253
|
'certificate' => Puppet[:hostcert],
|
250
254
|
'private key password file' => Puppet[:passfile]
|
251
255
|
}
|
252
|
-
if options[:localca]
|
253
|
-
paths['local CA certificate'] = Puppet[:localcacert]
|
254
|
-
paths['local CRL'] = Puppet[:hostcrl]
|
255
|
-
end
|
256
|
+
paths.merge!('local CA certificate' => Puppet[:localcacert], 'local CRL' => Puppet[:hostcrl]) if options[:localca]
|
256
257
|
paths.each_pair do |label, path|
|
257
258
|
if Puppet::FileSystem.exist?(path)
|
258
259
|
Puppet::FileSystem.unlink(path)
|
data/lib/puppet/configurer.rb
CHANGED
@@ -148,10 +148,9 @@ class Puppet::Configurer
|
|
148
148
|
facts_hash
|
149
149
|
end
|
150
150
|
|
151
|
-
def prepare_and_retrieve_catalog(
|
151
|
+
def prepare_and_retrieve_catalog(options, query_options)
|
152
152
|
# set report host name now that we have the fact
|
153
153
|
options[:report].host = Puppet[:node_name_value]
|
154
|
-
|
155
154
|
query_options[:transaction_uuid] = @transaction_uuid
|
156
155
|
query_options[:job_id] = @job_id
|
157
156
|
query_options[:static_catalog] = @static_catalog
|
@@ -161,19 +160,26 @@ class Puppet::Configurer
|
|
161
160
|
query_options[:checksum_type] = @checksum_type.join('.')
|
162
161
|
|
163
162
|
# apply passes in ral catalog
|
164
|
-
catalog =
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
163
|
+
catalog = options.delete(:catalog)
|
164
|
+
return catalog if catalog
|
165
|
+
|
166
|
+
# retrieve_catalog returns json catalog
|
167
|
+
catalog = retrieve_catalog(query_options)
|
168
|
+
return convert_catalog(catalog, @duration, options) if catalog
|
169
|
+
|
170
|
+
Puppet.err _("Could not retrieve catalog; skipping run")
|
171
|
+
nil
|
171
172
|
end
|
172
173
|
|
173
174
|
def prepare_and_retrieve_catalog_from_cache(options = {})
|
174
175
|
result = retrieve_catalog_from_cache({:transaction_uuid => @transaction_uuid, :static_catalog => @static_catalog})
|
175
|
-
|
176
|
-
|
176
|
+
if result
|
177
|
+
Puppet.info _("Using cached catalog from environment '%{catalog_env}'") % { catalog_env: result.environment }
|
178
|
+
# get facts now so that the convert_catalog method can resolve deferred values
|
179
|
+
get_facts(options)
|
180
|
+
return convert_catalog(result, @duration, options)
|
181
|
+
end
|
182
|
+
nil
|
177
183
|
end
|
178
184
|
|
179
185
|
# Apply supplied catalog and return associated application report
|
@@ -251,12 +257,13 @@ class Puppet::Configurer
|
|
251
257
|
Puppet::GettextConfig.reset_text_domain('agent')
|
252
258
|
Puppet::ModuleTranslations.load_from_vardir(Puppet[:vardir])
|
253
259
|
|
254
|
-
if
|
260
|
+
if catalog = prepare_and_retrieve_catalog_from_cache(options)
|
261
|
+
options[:catalog] = catalog
|
255
262
|
@cached_catalog_status = 'explicitly_requested'
|
256
263
|
|
257
|
-
if @environment !=
|
258
|
-
Puppet.notice _("Local environment: '%{local_env}' doesn't match the environment of the cached catalog '%{catalog_env}', switching agent to '%{catalog_env}'.") % { local_env: @environment, catalog_env:
|
259
|
-
@environment =
|
264
|
+
if @environment != catalog.environment && !Puppet[:strict_environment_mode]
|
265
|
+
Puppet.notice _("Local environment: '%{local_env}' doesn't match the environment of the cached catalog '%{catalog_env}', switching agent to '%{catalog_env}'.") % { local_env: @environment, catalog_env: catalog.environment }
|
266
|
+
@environment = catalog.environment
|
260
267
|
end
|
261
268
|
|
262
269
|
report.environment = @environment
|
@@ -277,7 +284,7 @@ class Puppet::Configurer
|
|
277
284
|
configured_environment = Puppet[:environment] if Puppet.settings.set_by_config?(:environment)
|
278
285
|
|
279
286
|
# We only need to find out the environment to run in if we don't already have a catalog
|
280
|
-
unless (
|
287
|
+
unless (options[:catalog] || Puppet[:strict_environment_mode])
|
281
288
|
begin
|
282
289
|
node = nil
|
283
290
|
node_retr_time = thinmark do
|
@@ -332,7 +339,7 @@ class Puppet::Configurer
|
|
332
339
|
query_options[:configured_environment] = configured_environment
|
333
340
|
options[:convert_for_node] = node
|
334
341
|
|
335
|
-
unless catalog = prepare_and_retrieve_catalog(
|
342
|
+
unless catalog = prepare_and_retrieve_catalog(options, query_options)
|
336
343
|
return nil
|
337
344
|
end
|
338
345
|
|
@@ -357,37 +364,16 @@ class Puppet::Configurer
|
|
357
364
|
query_options = get_facts(options)
|
358
365
|
query_options[:configured_environment] = configured_environment
|
359
366
|
|
360
|
-
|
361
|
-
return nil unless catalog = prepare_and_retrieve_catalog(nil, options, query_options)
|
367
|
+
return nil unless catalog = prepare_and_retrieve_catalog(options, query_options)
|
362
368
|
tries += 1
|
363
369
|
end
|
364
370
|
|
365
|
-
# now that environment has converged, convert resource catalog into ral catalog
|
366
|
-
# unless we were given a RAL catalog
|
367
|
-
if !cached_catalog && options[:catalog]
|
368
|
-
ral_catalog = options[:catalog]
|
369
|
-
else
|
370
|
-
# REMIND @duration is the time spent loading the last catalog, and doesn't
|
371
|
-
# account for things like we failed to download and fell back to the cache
|
372
|
-
ral_catalog = convert_catalog(catalog, @duration, options)
|
373
|
-
|
374
|
-
# If not noop, commit the cached resource catalog (not ral catalog). Ideally
|
375
|
-
# we'd just copy the downloaded response body, instead of serializing the
|
376
|
-
# in-memory catalog, but that's hard due to the indirector.
|
377
|
-
indirection = Puppet::Resource::Catalog.indirection
|
378
|
-
if !Puppet[:noop] && indirection.cache?
|
379
|
-
request = indirection.request(:save, nil, catalog, environment: Puppet::Node::Environment.remote(catalog.environment))
|
380
|
-
Puppet.info("Caching catalog for #{request.key}")
|
381
|
-
indirection.cache.save(request)
|
382
|
-
end
|
383
|
-
end
|
384
|
-
|
385
371
|
execute_prerun_command or return nil
|
386
372
|
|
387
|
-
options[:report].code_id =
|
388
|
-
options[:report].catalog_uuid =
|
373
|
+
options[:report].code_id = catalog.code_id
|
374
|
+
options[:report].catalog_uuid = catalog.catalog_uuid
|
389
375
|
options[:report].cached_catalog_status = @cached_catalog_status
|
390
|
-
apply_catalog(
|
376
|
+
apply_catalog(catalog, options)
|
391
377
|
true
|
392
378
|
rescue => detail
|
393
379
|
Puppet.log_exception(detail, _("Failed to apply catalog: %{detail}") % { detail: detail })
|
@@ -396,14 +382,6 @@ class Puppet::Configurer
|
|
396
382
|
execute_postrun_command or return nil
|
397
383
|
end
|
398
384
|
ensure
|
399
|
-
if Puppet[:resubmit_facts]
|
400
|
-
# TODO: Should mark the report as "failed" if an error occurs and
|
401
|
-
# resubmit_facts returns false. There is currently no API for this.
|
402
|
-
resubmit_facts_time = thinmark { resubmit_facts }
|
403
|
-
|
404
|
-
report.add_times(:resubmit_facts, resubmit_facts_time)
|
405
|
-
end
|
406
|
-
|
407
385
|
report.cached_catalog_status ||= @cached_catalog_status
|
408
386
|
report.add_times(:total, Time.now - start)
|
409
387
|
report.finalize_report
|
@@ -451,40 +429,6 @@ class Puppet::Configurer
|
|
451
429
|
Puppet.log_exception(detail, _("Could not save last run local report: %{detail}") % { detail: detail })
|
452
430
|
end
|
453
431
|
|
454
|
-
# Submit updated facts to the Puppet Server
|
455
|
-
#
|
456
|
-
# This method will clear all current fact values, load a fresh set of
|
457
|
-
# fact data, and then submit it to the Puppet Server.
|
458
|
-
#
|
459
|
-
# @return [true] If fact submission succeeds.
|
460
|
-
# @return [false] If an exception is raised during fact generation or
|
461
|
-
# submission.
|
462
|
-
def resubmit_facts
|
463
|
-
::Facter.clear
|
464
|
-
facts = find_facts
|
465
|
-
|
466
|
-
saved_fact_terminus = Puppet::Node::Facts.indirection.terminus_class
|
467
|
-
begin
|
468
|
-
Puppet::Node::Facts.indirection.terminus_class = :rest
|
469
|
-
|
470
|
-
server = Puppet::Node::Facts::Rest.server
|
471
|
-
Puppet.info(_("Uploading facts for %{node} to %{server}") % {
|
472
|
-
node: facts.name,
|
473
|
-
server: server})
|
474
|
-
|
475
|
-
Puppet::Node::Facts.indirection.save(facts, nil, :environment => Puppet::Node::Environment.remote(@environment))
|
476
|
-
|
477
|
-
return true
|
478
|
-
ensure
|
479
|
-
Puppet::Node::Facts.indirection.terminus_class = saved_fact_terminus
|
480
|
-
end
|
481
|
-
rescue => detail
|
482
|
-
Puppet.log_exception(detail, _("Failed to submit facts: %{detail}") %
|
483
|
-
{ detail: detail })
|
484
|
-
|
485
|
-
return false
|
486
|
-
end
|
487
|
-
|
488
432
|
private
|
489
433
|
|
490
434
|
def execute_from_setting(setting)
|
@@ -523,8 +467,8 @@ class Puppet::Configurer
|
|
523
467
|
Puppet[:node_name_value],
|
524
468
|
query_options.merge(
|
525
469
|
:ignore_cache => true,
|
526
|
-
#
|
527
|
-
:ignore_cache_save =>
|
470
|
+
# We never want to update the cached Catalog if we're running in noop mode.
|
471
|
+
:ignore_cache_save => Puppet[:noop],
|
528
472
|
:environment => Puppet::Node::Environment.remote(@environment),
|
529
473
|
:fail_on_404 => true
|
530
474
|
)
|