puppet 5.5.16-x86-mingw32 → 5.5.21-x86-mingw32
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of puppet might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/CODEOWNERS +10 -10
- data/Gemfile +2 -3
- data/Gemfile.lock +57 -52
- data/ext/build_defaults.yaml +1 -0
- data/ext/cert_inspector +3 -3
- data/ext/project_data.yaml +2 -2
- data/ext/puppet-test +2 -2
- data/ext/regexp_nodes/regexp_nodes.rb +4 -4
- data/ext/windows/service/daemon.rb +54 -8
- data/install.rb +6 -24
- data/lib/puppet.rb +5 -2
- data/lib/puppet/agent.rb +5 -13
- data/lib/puppet/application.rb +1 -1
- data/lib/puppet/application/agent.rb +15 -1
- data/lib/puppet/application/apply.rb +2 -2
- data/lib/puppet/application/describe.rb +3 -9
- data/lib/puppet/application/device.rb +4 -4
- data/lib/puppet/application/doc.rb +1 -1
- data/lib/puppet/application/filebucket.rb +13 -0
- data/lib/puppet/application/lookup.rb +1 -1
- data/lib/puppet/application/resource.rb +4 -4
- data/lib/puppet/application/script.rb +2 -2
- data/lib/puppet/configurer.rb +86 -28
- data/lib/puppet/configurer/downloader.rb +2 -6
- data/lib/puppet/daemon.rb +1 -1
- data/lib/puppet/defaults.rb +82 -38
- data/lib/puppet/error.rb +9 -1
- data/lib/puppet/external/nagios/base.rb +1 -1
- data/lib/puppet/face/ca.rb +1 -1
- data/lib/puppet/face/config.rb +10 -48
- data/lib/puppet/face/facts.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/plugin.rb +9 -2
- data/lib/puppet/file_serving/http_metadata.rb +1 -1
- data/lib/puppet/file_system.rb +0 -8
- data/lib/puppet/file_system/memory_file.rb +1 -1
- data/lib/puppet/file_system/posix.rb +3 -2
- data/lib/puppet/file_system/uniquefile.rb +4 -0
- data/lib/puppet/forge.rb +3 -3
- data/lib/puppet/functions/epp.rb +4 -4
- data/lib/puppet/functions/inline_epp.rb +5 -5
- data/lib/puppet/functions/reduce.rb +2 -4
- data/lib/puppet/gettext/module_translations.rb +1 -1
- data/lib/puppet/graph/rb_tree_map.rb +2 -2
- data/lib/puppet/graph/simple_graph.rb +6 -5
- data/lib/puppet/indirector/catalog/compiler.rb +8 -0
- data/lib/puppet/indirector/file_bucket_file/file.rb +1 -1
- data/lib/puppet/indirector/hiera.rb +2 -0
- data/lib/puppet/indirector/resource/ral.rb +1 -3
- data/lib/puppet/indirector/resource/validator.rb +1 -1
- data/lib/puppet/interface.rb +2 -1
- data/lib/puppet/loaders.rb +0 -1
- data/lib/puppet/metatype/manager.rb +1 -1
- data/lib/puppet/module.rb +1 -1
- data/lib/puppet/module_tool/applications/builder.rb +1 -1
- data/lib/puppet/module_tool/applications/installer.rb +1 -1
- data/lib/puppet/module_tool/applications/uninstaller.rb +3 -3
- data/lib/puppet/module_tool/metadata.rb +1 -1
- data/lib/puppet/module_tool/shared_behaviors.rb +4 -4
- data/lib/puppet/module_tool/tar/mini.rb +12 -2
- data/lib/puppet/network/http/api/indirected_routes.rb +13 -12
- data/lib/puppet/network/http/api/master/v3/environment.rb +3 -0
- data/lib/puppet/network/http/connection.rb +14 -12
- data/lib/puppet/network/http/factory.rb +1 -11
- data/lib/puppet/network/http/pool.rb +7 -1
- data/lib/puppet/network/http/rack/rest.rb +2 -2
- data/lib/puppet/network/http/site.rb +1 -1
- data/lib/puppet/network/resolver.rb +2 -2
- data/lib/puppet/node/environment.rb +4 -2
- data/lib/puppet/parameter.rb +8 -0
- data/lib/puppet/parser/ast.rb +1 -1
- data/lib/puppet/parser/ast/resourceparam.rb +1 -1
- data/lib/puppet/parser/compiler/catalog_validator/env_relationship_validator.rb +2 -0
- data/lib/puppet/parser/compiler/catalog_validator/site_validator.rb +2 -0
- data/lib/puppet/parser/environment_compiler.rb +3 -0
- data/lib/puppet/parser/functions.rb +1 -1
- data/lib/puppet/parser/functions/epp.rb +3 -3
- data/lib/puppet/parser/functions/inline_epp.rb +5 -5
- data/lib/puppet/parser/resource.rb +3 -2
- data/lib/puppet/parser/resource/param.rb +6 -0
- data/lib/puppet/pops/evaluator/access_operator.rb +2 -2
- 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/evaluator_impl.rb +1 -1
- data/lib/puppet/pops/evaluator/external_syntax_support.rb +3 -2
- data/lib/puppet/pops/evaluator/runtime3_support.rb +4 -4
- data/lib/puppet/pops/issues.rb +5 -0
- data/lib/puppet/pops/loaders.rb +1 -1
- data/lib/puppet/pops/lookup/hiera_config.rb +1 -0
- data/lib/puppet/pops/lookup/sub_lookup.rb +1 -1
- data/lib/puppet/pops/merge_strategy.rb +22 -18
- data/lib/puppet/pops/parser/heredoc_support.rb +1 -1
- data/lib/puppet/pops/parser/interpolation_support.rb +4 -4
- data/lib/puppet/pops/parser/locator.rb +1 -1
- data/lib/puppet/pops/parser/pn_parser.rb +17 -16
- data/lib/puppet/pops/puppet_stack.rb +51 -48
- data/lib/puppet/pops/resource/resource_type_impl.rb +2 -0
- 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/type_calculator.rb +24 -0
- data/lib/puppet/pops/types/types.rb +3 -3
- data/lib/puppet/pops/validation/checker4_0.rb +10 -0
- data/lib/puppet/pops/validation/validator_factory_4_0.rb +1 -0
- data/lib/puppet/property.rb +1 -1
- data/lib/puppet/property/ensure.rb +1 -1
- data/lib/puppet/provider/augeas/augeas.rb +1 -1
- data/lib/puppet/provider/cron/crontab.rb +1 -1
- data/lib/puppet/provider/exec.rb +6 -2
- data/lib/puppet/provider/file/posix.rb +5 -0
- data/lib/puppet/provider/group/groupadd.rb +19 -19
- data/lib/puppet/provider/group/windows_adsi.rb +3 -3
- data/lib/puppet/provider/mailalias/aliases.rb +1 -1
- data/lib/puppet/provider/mount.rb +1 -1
- data/lib/puppet/provider/mount/parsed.rb +8 -8
- data/lib/puppet/provider/nameservice.rb +10 -3
- data/lib/puppet/provider/nameservice/directoryservice.rb +1 -1
- data/lib/puppet/provider/nameservice/pw.rb +2 -2
- data/lib/puppet/provider/package/aix.rb +17 -2
- data/lib/puppet/provider/package/apt.rb +14 -3
- data/lib/puppet/provider/package/dnf.rb +1 -1
- data/lib/puppet/provider/package/dnfmodule.rb +141 -0
- data/lib/puppet/provider/package/dpkg.rb +16 -18
- data/lib/puppet/provider/package/fink.rb +20 -3
- data/lib/puppet/provider/package/openbsd.rb +14 -2
- data/lib/puppet/provider/package/pip.rb +37 -10
- data/lib/puppet/provider/package/pkg.rb +18 -5
- data/lib/puppet/provider/package/pkgdmg.rb +1 -1
- data/lib/puppet/provider/package/pkgng.rb +16 -4
- data/lib/puppet/provider/package/portage.rb +4 -4
- data/lib/puppet/provider/package/rpm.rb +57 -19
- data/lib/puppet/provider/package/windows/package.rb +1 -1
- data/lib/puppet/provider/package/yum.rb +35 -24
- data/lib/puppet/provider/package/zypper.rb +1 -0
- data/lib/puppet/provider/package_targetable.rb +5 -4
- data/lib/puppet/provider/parsedfile.rb +1 -1
- data/lib/puppet/provider/scheduled_task/win32_taskscheduler.rb +3 -3
- data/lib/puppet/provider/selmodule/semodule.rb +43 -26
- data/lib/puppet/provider/service/daemontools.rb +9 -9
- data/lib/puppet/provider/service/launchd.rb +20 -5
- data/lib/puppet/provider/service/openbsd.rb +1 -1
- data/lib/puppet/provider/service/rcng.rb +2 -2
- data/lib/puppet/provider/service/runit.rb +2 -8
- data/lib/puppet/provider/service/systemd.rb +35 -22
- data/lib/puppet/provider/service/windows.rb +8 -0
- data/lib/puppet/provider/user/directoryservice.rb +31 -6
- data/lib/puppet/provider/user/hpux.rb +1 -1
- data/lib/puppet/provider/user/pw.rb +12 -3
- data/lib/puppet/provider/user/user_role_add.rb +5 -1
- data/lib/puppet/provider/user/useradd.rb +62 -27
- data/lib/puppet/provider/user/windows_adsi.rb +4 -5
- data/lib/puppet/provider/yumrepo/inifile.rb +2 -2
- data/lib/puppet/reference/indirection.rb +2 -2
- data/lib/puppet/reference/metaparameter.rb +1 -3
- data/lib/puppet/reference/providers.rb +1 -1
- data/lib/puppet/reference/type.rb +3 -9
- data/lib/puppet/reports.rb +1 -1
- data/lib/puppet/resource.rb +18 -1
- data/lib/puppet/resource/catalog.rb +1 -1
- data/lib/puppet/resource/type.rb +8 -0
- data/lib/puppet/settings.rb +43 -3
- data/lib/puppet/settings/environment_conf.rb +1 -0
- data/lib/puppet/ssl/certificate.rb +2 -1
- data/lib/puppet/ssl/certificate_authority.rb +6 -5
- data/lib/puppet/ssl/certificate_authority/interface.rb +1 -1
- data/lib/puppet/ssl/certificate_factory.rb +2 -2
- data/lib/puppet/ssl/host.rb +3 -3
- data/lib/puppet/ssl/oids.rb +1 -1
- data/lib/puppet/test/test_helper.rb +15 -10
- data/lib/puppet/transaction/report.rb +1 -1
- data/lib/puppet/transaction/resource_harness.rb +1 -1
- data/lib/puppet/type.rb +15 -4
- data/lib/puppet/type/cron.rb +1 -1
- data/lib/puppet/type/exec.rb +21 -9
- data/lib/puppet/type/file.rb +14 -2
- data/lib/puppet/type/file/data_sync.rb +5 -1
- data/lib/puppet/type/group.rb +4 -2
- data/lib/puppet/type/interface.rb +1 -1
- data/lib/puppet/type/notify.rb +3 -2
- data/lib/puppet/type/package.rb +107 -8
- data/lib/puppet/type/schedule.rb +1 -1
- data/lib/puppet/type/selboolean.rb +17 -3
- data/lib/puppet/type/service.rb +9 -10
- data/lib/puppet/type/user.rb +6 -24
- data/lib/puppet/type/yumrepo.rb +3 -7
- data/lib/puppet/util.rb +47 -25
- data/lib/puppet/util/command_line/trollop.rb +1 -1
- data/lib/puppet/util/execution.rb +4 -3
- data/lib/puppet/util/http_proxy.rb +24 -16
- data/lib/puppet/util/instance_loader.rb +1 -1
- data/lib/puppet/util/log.rb +1 -1
- data/lib/puppet/util/log/destinations.rb +3 -12
- data/lib/puppet/util/logging.rb +30 -18
- data/lib/puppet/util/metric.rb +2 -2
- data/lib/puppet/util/monkey_patches.rb +1 -1
- data/lib/puppet/util/nagios_maker.rb +2 -2
- data/lib/puppet/util/network_device/cisco/device.rb +1 -1
- data/lib/puppet/util/network_device/cisco/interface.rb +2 -2
- data/lib/puppet/util/network_device/transport/ssh.rb +1 -1
- data/lib/puppet/util/pidlock.rb +12 -6
- data/lib/puppet/util/plist.rb +6 -0
- data/lib/puppet/util/provider_features.rb +2 -4
- data/lib/puppet/util/rdoc.rb +1 -1
- data/lib/puppet/util/reference.rb +1 -1
- data/lib/puppet/util/resource_template.rb +1 -1
- data/lib/puppet/util/selinux.rb +8 -2
- data/lib/puppet/util/windows/adsi.rb +60 -30
- data/lib/puppet/util/windows/api_types.rb +45 -32
- data/lib/puppet/util/windows/eventlog.rb +1 -6
- data/lib/puppet/util/windows/principal.rb +8 -6
- data/lib/puppet/util/windows/process.rb +16 -15
- data/lib/puppet/util/windows/registry.rb +17 -15
- data/lib/puppet/util/windows/security.rb +3 -0
- data/lib/puppet/util/windows/service.rb +149 -4
- data/lib/puppet/util/windows/sid.rb +4 -3
- data/lib/puppet/vendor.rb +1 -1
- data/lib/puppet/version.rb +1 -1
- data/lib/puppet_pal.rb +2 -2
- data/locales/puppet.pot +479 -443
- data/man/man5/puppet.conf.5 +38 -8
- data/man/man8/puppet-agent.8 +2 -2
- data/man/man8/puppet-apply.8 +1 -1
- data/man/man8/puppet-ca.8 +1 -1
- data/man/man8/puppet-catalog.8 +1 -1
- data/man/man8/puppet-cert.8 +1 -1
- data/man/man8/puppet-certificate.8 +1 -1
- data/man/man8/puppet-certificate_request.8 +1 -1
- data/man/man8/puppet-certificate_revocation_list.8 +1 -1
- data/man/man8/puppet-config.8 +1 -1
- data/man/man8/puppet-describe.8 +1 -1
- data/man/man8/puppet-device.8 +1 -1
- data/man/man8/puppet-doc.8 +1 -1
- data/man/man8/puppet-epp.8 +1 -1
- data/man/man8/puppet-facts.8 +1 -1
- data/man/man8/puppet-filebucket.8 +16 -1
- data/man/man8/puppet-generate.8 +1 -1
- data/man/man8/puppet-help.8 +1 -1
- data/man/man8/puppet-key.8 +1 -1
- data/man/man8/puppet-lookup.8 +1 -1
- data/man/man8/puppet-man.8 +1 -1
- data/man/man8/puppet-master.8 +1 -1
- data/man/man8/puppet-module.8 +1 -1
- data/man/man8/puppet-node.8 +1 -1
- data/man/man8/puppet-parser.8 +1 -1
- data/man/man8/puppet-plugin.8 +1 -1
- data/man/man8/puppet-report.8 +1 -1
- data/man/man8/puppet-resource.8 +1 -1
- data/man/man8/puppet-script.8 +1 -1
- data/man/man8/puppet-status.8 +1 -1
- data/man/man8/puppet.8 +2 -2
- data/spec/fixtures/integration/provider/mailalias/aliases/test1 +1 -0
- data/spec/fixtures/unit/provider/package/dnfmodule/dnf-module-list.txt +19 -0
- data/spec/fixtures/unit/provider/package/pkgng/pkg.version +2 -0
- data/spec/fixtures/unit/provider/package/yum/yum-check-update-subscription-manager.txt +9 -0
- data/spec/fixtures/unit/provider/service/systemd/list_unit_files_services +9 -0
- data/spec/integration/configurer_spec.rb +52 -0
- data/spec/integration/defaults_spec.rb +1 -2
- data/spec/integration/indirector/facts/facter_spec.rb +4 -0
- data/spec/integration/parser/compiler_spec.rb +11 -0
- data/spec/integration/provider/service/systemd_spec.rb +8 -5
- data/spec/integration/type/file_spec.rb +28 -0
- data/spec/integration/type/notify_spec.rb +46 -0
- data/spec/integration/util/execution_spec.rb +27 -0
- data/spec/integration/util/windows/adsi_spec.rb +6 -1
- data/spec/integration/util/windows/registry_spec.rb +7 -7
- data/spec/unit/agent_spec.rb +34 -26
- data/spec/unit/application/agent_spec.rb +18 -0
- data/spec/unit/application/apply_spec.rb +2 -12
- data/spec/unit/application/device_spec.rb +1 -1
- data/spec/unit/configurer/fact_handler_spec.rb +0 -4
- data/spec/unit/configurer_spec.rb +377 -397
- data/spec/unit/daemon_spec.rb +0 -1
- data/spec/unit/face/facts_spec.rb +9 -0
- data/spec/unit/face/plugin_spec.rb +8 -0
- data/spec/unit/file_system/uniquefile_spec.rb +11 -0
- data/spec/unit/forge/forge_spec.rb +1 -3
- data/spec/unit/forge/repository_spec.rb +1 -3
- data/spec/unit/indirector/catalog/compiler_spec.rb +45 -26
- 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 +28 -11
- data/spec/unit/network/http/connection_spec.rb +43 -1
- data/spec/unit/network/http/factory_spec.rb +27 -5
- data/spec/unit/network/http/pool_spec.rb +32 -0
- data/spec/unit/node_spec.rb +7 -4
- data/spec/unit/parser/environment_compiler_spec.rb +7 -0
- data/spec/unit/pops/evaluator/evaluating_parser_spec.rb +8 -3
- data/spec/unit/pops/validator/validator_spec.rb +7 -0
- data/spec/unit/provider/exec_spec.rb +209 -0
- data/spec/unit/provider/group/groupadd_spec.rb +30 -1
- data/spec/unit/provider/group/windows_adsi_spec.rb +43 -10
- data/spec/unit/provider/package/aix_spec.rb +29 -0
- data/spec/unit/provider/package/apt_spec.rb +13 -2
- data/spec/unit/provider/package/aptitude_spec.rb +1 -0
- data/spec/unit/provider/package/aptrpm_spec.rb +1 -1
- data/spec/unit/provider/package/dnf_spec.rb +7 -0
- data/spec/unit/provider/package/dnfmodule_spec.rb +247 -0
- data/spec/unit/provider/package/dpkg_spec.rb +35 -7
- data/spec/unit/provider/package/openbsd_spec.rb +17 -0
- data/spec/unit/provider/package/pip_spec.rb +93 -22
- data/spec/unit/provider/package/pkg_spec.rb +13 -1
- data/spec/unit/provider/package/pkgdmg_spec.rb +1 -1
- data/spec/unit/provider/package/pkgng_spec.rb +36 -0
- data/spec/unit/provider/package/portage_spec.rb +4 -4
- data/spec/unit/provider/package/rpm_spec.rb +150 -16
- data/spec/unit/provider/package/yum_spec.rb +66 -0
- data/spec/unit/provider/package/zypper_spec.rb +13 -0
- data/spec/unit/provider/package_targetable_spec.rb +60 -0
- data/spec/unit/provider/selmodule_spec.rb +118 -47
- data/spec/unit/provider/service/daemontools_spec.rb +24 -0
- data/spec/unit/provider/service/launchd_spec.rb +28 -0
- data/spec/unit/provider/service/runit_spec.rb +24 -0
- data/spec/unit/provider/service/systemd_spec.rb +109 -36
- data/spec/unit/provider/service/windows_spec.rb +20 -0
- data/spec/unit/provider/user/directoryservice_spec.rb +41 -0
- data/spec/unit/provider/user/hpux_spec.rb +2 -2
- data/spec/unit/provider/user/openbsd_spec.rb +1 -0
- data/spec/unit/provider/user/pw_spec.rb +37 -0
- data/spec/unit/provider/user/useradd_spec.rb +122 -15
- data/spec/unit/provider/user/windows_adsi_spec.rb +3 -3
- data/spec/unit/puppet_pal_2pec.rb +3 -0
- data/spec/unit/resource_spec.rb +26 -1
- data/spec/unit/ssl/certificate_authority_spec.rb +2 -3
- data/spec/unit/ssl/certificate_spec.rb +7 -0
- data/spec/unit/test/test_helper_spec.rb +17 -0
- data/spec/unit/transaction_spec.rb +18 -0
- data/spec/unit/type/exec_spec.rb +15 -12
- data/spec/unit/type/file/content_spec.rb +9 -3
- data/spec/unit/type/file/source_spec.rb +4 -4
- data/spec/unit/type/file_spec.rb +9 -4
- data/spec/unit/type/package_spec.rb +8 -0
- data/spec/unit/type/schedule_spec.rb +3 -1
- data/spec/unit/type/selboolean_spec.rb +4 -6
- data/spec/unit/type/service_spec.rb +25 -8
- data/spec/unit/type/user_spec.rb +32 -26
- data/spec/unit/type/yumrepo_spec.rb +30 -0
- data/spec/unit/type_spec.rb +40 -0
- data/spec/unit/util/execution_spec.rb +16 -0
- data/spec/unit/util/http_proxy_spec.rb +121 -1
- data/spec/unit/util/log/destinations_spec.rb +2 -26
- data/spec/unit/util/log_spec.rb +0 -112
- data/spec/unit/util/logging_spec.rb +200 -0
- data/spec/unit/util/pidlock_spec.rb +67 -40
- data/spec/unit/util/plist_spec.rb +20 -0
- data/spec/unit/util/windows/adsi_spec.rb +55 -4
- data/spec/unit/util/windows/api_types_spec.rb +104 -40
- data/spec/unit/util/windows/service_spec.rb +9 -0
- data/spec/unit/util/windows/sid_spec.rb +2 -2
- data/tasks/manpages.rake +1 -0
- metadata +18 -13
- data/ext/windows/eventlog/Rakefile +0 -32
- data/ext/windows/eventlog/puppetres.dll +0 -0
- data/ext/windows/eventlog/puppetres.mc +0 -18
- data/lib/puppet/pops/loader/null_loader.rb +0 -60
- data/locales/ja/puppet.po +0 -12114
- data/spec/integration/test/test_helper_spec.rb +0 -31
@@ -103,7 +103,7 @@ module Puppet::ModuleTool
|
|
103
103
|
|
104
104
|
contents = data.keys.map do |k|
|
105
105
|
value = (Puppet::Util::Json.dump(data[k], :pretty => true) rescue data[k].to_json)
|
106
|
-
%Q("#{k
|
106
|
+
%Q("#{k}": #{value})
|
107
107
|
end
|
108
108
|
|
109
109
|
"{\n" + contents.join(",\n").gsub(/^/, ' ') + "\n}\n"
|
@@ -8,12 +8,12 @@ module Puppet::ModuleTool::Shared
|
|
8
8
|
@installed = Hash.new { |h,k| h[k] = [] }
|
9
9
|
|
10
10
|
@environment.modules_by_path.values.flatten.each do |mod|
|
11
|
-
mod_name = (mod.forge_name || mod.name).
|
11
|
+
mod_name = (mod.forge_name || mod.name).tr('/', '-')
|
12
12
|
@installed[mod_name] << mod
|
13
13
|
d = @local["#{mod_name}@#{mod.version}"]
|
14
14
|
(mod.dependencies || []).each do |hash|
|
15
15
|
name, conditions = hash['name'], hash['version_requirement']
|
16
|
-
name = name.
|
16
|
+
name = name.tr('/', '-')
|
17
17
|
d[name] = conditions
|
18
18
|
@conditions[name] << {
|
19
19
|
:module => mod_name,
|
@@ -34,7 +34,7 @@ module Puppet::ModuleTool::Shared
|
|
34
34
|
info = forge.remote_dependency_info(author, modname, @options[:version])
|
35
35
|
info.each do |pair|
|
36
36
|
mod_name, releases = pair
|
37
|
-
mod_name = mod_name.
|
37
|
+
mod_name = mod_name.tr('/', '-')
|
38
38
|
releases.each do |rel|
|
39
39
|
semver = SemanticPuppet::Version.parse(rel['version']) rescue SemanticPuppet::Version::MIN
|
40
40
|
@versions[mod_name] << { :vstring => rel['version'], :semver => semver }
|
@@ -42,7 +42,7 @@ module Puppet::ModuleTool::Shared
|
|
42
42
|
@urls["#{mod_name}@#{rel['version']}"] = rel['file']
|
43
43
|
d = @remote["#{mod_name}@#{rel['version']}"]
|
44
44
|
(rel['dependencies'] || []).each do |name, conditions|
|
45
|
-
d[name.
|
45
|
+
d[name.tr('/', '-')] = conditions
|
46
46
|
end
|
47
47
|
end
|
48
48
|
end
|
@@ -1,7 +1,17 @@
|
|
1
1
|
class Puppet::ModuleTool::Tar::Mini
|
2
2
|
def unpack(sourcefile, destdir, _)
|
3
3
|
Zlib::GzipReader.open(sourcefile) do |reader|
|
4
|
-
|
4
|
+
# puppet doesn't have a hard dependency on minitar, so we
|
5
|
+
# can't be certain which version is installed. If it's 0.9
|
6
|
+
# or above then we can prevent minitar from fsync'ing each
|
7
|
+
# extracted file and directory, otherwise fallback to the
|
8
|
+
# old behavior
|
9
|
+
args = [reader, destdir, find_valid_files(reader)]
|
10
|
+
spec = Gem::Specification.find_by_name('minitar')
|
11
|
+
if spec && spec.version >= Gem::Version.new('0.9')
|
12
|
+
args << {:fsync => false}
|
13
|
+
end
|
14
|
+
Archive::Tar::Minitar.unpack(*args) do |action, name, stats|
|
5
15
|
case action
|
6
16
|
when :dir
|
7
17
|
validate_entry(destdir, name)
|
@@ -83,7 +93,7 @@ class Puppet::ModuleTool::Tar::Mini
|
|
83
93
|
def find_valid_files(tarfile)
|
84
94
|
Archive::Tar::Minitar.open(tarfile).collect do |entry|
|
85
95
|
flag = entry.typeflag
|
86
|
-
if flag.nil? || flag =~ /[[:digit:]]/ && (0..7).
|
96
|
+
if flag.nil? || flag =~ /[[:digit:]]/ && (0..7).cover?(flag.to_i)
|
87
97
|
entry.full_name
|
88
98
|
else
|
89
99
|
Puppet.debug "Invalid tar flag '#{flag}' will not be extracted: #{entry.name}"
|
@@ -114,6 +114,17 @@ class Puppet::Network::HTTP::API::IndirectedRoutes
|
|
114
114
|
[indirection, method, key, params]
|
115
115
|
end
|
116
116
|
|
117
|
+
def self.request_to_uri(request)
|
118
|
+
uri, body = request_to_uri_and_body(request)
|
119
|
+
"#{uri}?#{body}"
|
120
|
+
end
|
121
|
+
|
122
|
+
def self.request_to_uri_and_body(request)
|
123
|
+
url_prefix = IndirectionType.url_prefix_for(request.indirection_name.to_s)
|
124
|
+
indirection = request.method == :search ? pluralize(request.indirection_name.to_s) : request.indirection_name.to_s
|
125
|
+
["#{url_prefix}/#{indirection}/#{Puppet::Util.uri_encode(request.key)}", "environment=#{request.environment.name}&#{request.query_string}"]
|
126
|
+
end
|
127
|
+
|
117
128
|
private
|
118
129
|
|
119
130
|
# Execute our find.
|
@@ -199,7 +210,7 @@ class Puppet::Network::HTTP::API::IndirectedRoutes
|
|
199
210
|
return formatter if formatter
|
200
211
|
|
201
212
|
raise Puppet::Network::HTTP::Error::HTTPNotAcceptableError.new(
|
202
|
-
_("No supported formats are acceptable (Accept: %{accepted_formats})") % { accepted_formats: formats },
|
213
|
+
_("No supported formats are acceptable (Accept: %{accepted_formats})") % { accepted_formats: formats.map(&:mime).join(', ') },
|
203
214
|
Puppet::Network::HTTP::Issues::UNSUPPORTED_FORMAT)
|
204
215
|
end
|
205
216
|
|
@@ -246,20 +257,10 @@ class Puppet::Network::HTTP::API::IndirectedRoutes
|
|
246
257
|
method
|
247
258
|
end
|
248
259
|
|
249
|
-
def self.request_to_uri(request)
|
250
|
-
uri, body = request_to_uri_and_body(request)
|
251
|
-
"#{uri}?#{body}"
|
252
|
-
end
|
253
|
-
|
254
|
-
def self.request_to_uri_and_body(request)
|
255
|
-
url_prefix = IndirectionType.url_prefix_for(request.indirection_name.to_s)
|
256
|
-
indirection = request.method == :search ? pluralize(request.indirection_name.to_s) : request.indirection_name.to_s
|
257
|
-
["#{url_prefix}/#{indirection}/#{Puppet::Util.uri_encode(request.key)}", "environment=#{request.environment.name}&#{request.query_string}"]
|
258
|
-
end
|
259
|
-
|
260
260
|
def self.pluralize(indirection)
|
261
261
|
return(indirection == "status" ? "statuses" : indirection + "s")
|
262
262
|
end
|
263
|
+
private_class_method :pluralize
|
263
264
|
|
264
265
|
def plurality(indirection)
|
265
266
|
# NOTE These specific hooks for paths are ridiculous, but it's a *many*-line
|
@@ -1,8 +1,11 @@
|
|
1
1
|
require 'puppet/util/json'
|
2
2
|
require 'puppet/parser/environment_compiler'
|
3
3
|
|
4
|
+
# @deprecated application orchestration will be removed in puppet 7
|
4
5
|
class Puppet::Network::HTTP::API::Master::V3::Environment
|
5
6
|
def call(request, response)
|
7
|
+
Puppet.deprecation_warning("Application orchestration is deprecated. See https://puppet.com/docs/puppet/5.5/deprecated_language.html")
|
8
|
+
|
6
9
|
env_name = request.routing_path.split('/').last
|
7
10
|
env = Puppet.lookup(:environments).get(env_name)
|
8
11
|
code_id = request.params[:code_id]
|
@@ -198,6 +198,10 @@ module Puppet::Network::HTTP
|
|
198
198
|
current_request[header] = value
|
199
199
|
end
|
200
200
|
when 429, 503
|
201
|
+
if connection.started?
|
202
|
+
Puppet.debug("Closing connection for #{current_site}")
|
203
|
+
connection.finish
|
204
|
+
end
|
201
205
|
response = handle_retry_after(current_response)
|
202
206
|
else
|
203
207
|
response = current_response
|
@@ -311,19 +315,17 @@ module Puppet::Network::HTTP
|
|
311
315
|
rescue => exception
|
312
316
|
elapsed = (Time.now - start).to_f.round(3)
|
313
317
|
uri = [@site.addr, request.path.split('?')[0]].join('/')
|
314
|
-
eclass = exception.class
|
315
|
-
|
316
|
-
err = case exception
|
317
|
-
when EOFError
|
318
|
-
eclass.new(_('request %{uri} interrupted after %{elapsed} seconds') % {uri: uri, elapsed: elapsed})
|
319
|
-
when Timeout::Error
|
320
|
-
eclass.new(_('request %{uri} timed out after %{elapsed} seconds') % {uri: uri, elapsed: elapsed})
|
321
|
-
else
|
322
|
-
eclass.new(_('request %{uri} failed: %{msg}') % {uri: uri, msg: exception.message})
|
323
|
-
end
|
324
318
|
|
325
|
-
|
326
|
-
|
319
|
+
case exception
|
320
|
+
when EOFError
|
321
|
+
Puppet.log_exception(exception, _('request %{uri} interrupted after %{elapsed} seconds') % {uri: uri, elapsed: elapsed})
|
322
|
+
when Timeout::Error
|
323
|
+
Puppet.log_exception(exception, _('request %{uri} timed out after %{elapsed} seconds') % {uri: uri, elapsed: elapsed})
|
324
|
+
else
|
325
|
+
Puppet.log_exception(exception, _('request %{uri} failed: %{msg}') % {uri: uri, msg: exception.message})
|
326
|
+
end
|
327
|
+
|
328
|
+
raise exception
|
327
329
|
end
|
328
330
|
|
329
331
|
def with_connection(site, &block)
|
@@ -25,17 +25,7 @@ class Puppet::Network::HTTP::Factory
|
|
25
25
|
def create_connection(site)
|
26
26
|
Puppet.debug("Creating new connection for #{site}")
|
27
27
|
|
28
|
-
|
29
|
-
|
30
|
-
unless Puppet::Util::HttpProxy.no_proxy?(site)
|
31
|
-
if Puppet[:http_proxy_host] == "none"
|
32
|
-
args << nil << nil
|
33
|
-
else
|
34
|
-
args << Puppet[:http_proxy_host] << Puppet[:http_proxy_port]
|
35
|
-
end
|
36
|
-
end
|
37
|
-
|
38
|
-
http = Net::HTTP.new(*args)
|
28
|
+
http = Puppet::Util::HttpProxy.proxy(URI(site.addr))
|
39
29
|
http.use_ssl = site.use_ssl?
|
40
30
|
http.read_timeout = Puppet[:http_read_timeout]
|
41
31
|
http.open_timeout = Puppet[:http_connect_timeout]
|
@@ -33,7 +33,7 @@ class Puppet::Network::HTTP::Pool
|
|
33
33
|
reuse = false
|
34
34
|
raise detail
|
35
35
|
ensure
|
36
|
-
if reuse
|
36
|
+
if reuse && http.started?
|
37
37
|
release(site, http)
|
38
38
|
else
|
39
39
|
close_connection(site, http)
|
@@ -56,13 +56,17 @@ class Puppet::Network::HTTP::Pool
|
|
56
56
|
end
|
57
57
|
|
58
58
|
# Safely close a persistent connection.
|
59
|
+
# Don't try to close a connection that's already closed.
|
59
60
|
#
|
60
61
|
# @api private
|
61
62
|
def close_connection(site, http)
|
63
|
+
return false unless http.started?
|
62
64
|
Puppet.debug("Closing connection for #{site}")
|
63
65
|
http.finish
|
66
|
+
true
|
64
67
|
rescue => detail
|
65
68
|
Puppet.log_exception(detail, _("Failed to close connection for %{site}: %{detail}") % { site: site, detail: detail })
|
69
|
+
nil
|
66
70
|
end
|
67
71
|
|
68
72
|
# Borrow and take ownership of a persistent connection. If a new
|
@@ -90,6 +94,8 @@ class Puppet::Network::HTTP::Pool
|
|
90
94
|
#
|
91
95
|
# @api private
|
92
96
|
def setsockopts(netio)
|
97
|
+
return unless netio
|
98
|
+
|
93
99
|
socket = netio.io
|
94
100
|
socket.setsockopt(Socket::SOL_SOCKET, Socket::SO_KEEPALIVE, true)
|
95
101
|
end
|
@@ -52,7 +52,7 @@ class Puppet::Network::HTTP::RackREST
|
|
52
52
|
# Retrieve all headers from the http request, as a map.
|
53
53
|
def headers(request)
|
54
54
|
headers = request.env.select {|k,v| k.start_with? 'HTTP_'}.inject({}) do |m, (k,v)|
|
55
|
-
m[k.sub(/^HTTP_/, '').
|
55
|
+
m[k.sub(/^HTTP_/, '').tr('_','-').downcase] = v
|
56
56
|
m
|
57
57
|
end
|
58
58
|
headers['content-type'] = request.content_type
|
@@ -113,7 +113,7 @@ class Puppet::Network::HTTP::RackREST
|
|
113
113
|
# in contrast to the environment variable, the client cert is passed in
|
114
114
|
# as single string, therefore restore the certificate to a valid pem
|
115
115
|
# encoded certificate
|
116
|
-
cert.
|
116
|
+
cert.tr!(' ', "\n")
|
117
117
|
cert.gsub!(/BEGIN\nCERT/, "BEGIN CERT")
|
118
118
|
cert.gsub!(/END\nCERT/, "END CERT")
|
119
119
|
cert = Puppet::SSL::Certificate.from_instance(OpenSSL::X509::Certificate.new(cert))
|
@@ -18,7 +18,7 @@ module Puppet::Network::Resolver
|
|
18
18
|
when :ca then service = '_x-puppet-ca'
|
19
19
|
when :report then service = '_x-puppet-report'
|
20
20
|
when :file then service = '_x-puppet-fileserver'
|
21
|
-
else service = "_x-puppet-#{service_name
|
21
|
+
else service = "_x-puppet-#{service_name}"
|
22
22
|
end
|
23
23
|
srv_record = "#{service}._tcp.#{domain}"
|
24
24
|
|
@@ -33,7 +33,7 @@ module Puppet::Network::Resolver
|
|
33
33
|
else
|
34
34
|
each_priority(records) do |priority, recs|
|
35
35
|
while next_rr = recs.delete(find_weighted_server(recs))
|
36
|
-
Puppet.debug "Yielding next server of #{next_rr.target
|
36
|
+
Puppet.debug "Yielding next server of #{next_rr.target}:#{next_rr.port}"
|
37
37
|
yield next_rr.target.to_s, next_rr.port
|
38
38
|
end
|
39
39
|
end
|
@@ -507,8 +507,7 @@ class Puppet::Node::Environment
|
|
507
507
|
[self.class, name, full_modulepath, manifest].hash
|
508
508
|
end
|
509
509
|
|
510
|
-
private
|
511
|
-
|
510
|
+
# not private so it can be called in tests
|
512
511
|
def self.extralibs()
|
513
512
|
if Puppet::Util.get_env('PUPPETLIB')
|
514
513
|
split_path(Puppet::Util.get_env('PUPPETLIB'))
|
@@ -517,11 +516,14 @@ class Puppet::Node::Environment
|
|
517
516
|
end
|
518
517
|
end
|
519
518
|
|
519
|
+
private
|
520
|
+
|
520
521
|
def self.expand_dirs(dirs)
|
521
522
|
dirs.collect do |dir|
|
522
523
|
Puppet::FileSystem.expand_path(dir)
|
523
524
|
end
|
524
525
|
end
|
526
|
+
private_class_method :expand_dirs
|
525
527
|
|
526
528
|
# Reparse the manifests for the given environment
|
527
529
|
#
|
data/lib/puppet/parameter.rb
CHANGED
@@ -93,6 +93,14 @@ class Puppet::Parameter
|
|
93
93
|
end
|
94
94
|
end
|
95
95
|
|
96
|
+
def sensitive(value = nil, &block)
|
97
|
+
if block
|
98
|
+
define_method(:is_sensitive, &block)
|
99
|
+
else
|
100
|
+
define_method(:is_sensitive) do value end
|
101
|
+
end
|
102
|
+
end
|
103
|
+
|
96
104
|
# Produces a documentation string.
|
97
105
|
# If an enumeration of _valid values_ has been defined, it is appended to the documentation
|
98
106
|
# for this parameter specified with the {desc} method.
|
data/lib/puppet/parser/ast.rb
CHANGED
@@ -12,7 +12,7 @@ class Puppet::Parser::AST
|
|
12
12
|
attr_accessor :parent, :scope, :file, :line, :pos
|
13
13
|
|
14
14
|
def inspect
|
15
|
-
"( #{self.class} #{self
|
15
|
+
"( #{self.class} #{self} #{@children.inspect} )"
|
16
16
|
end
|
17
17
|
|
18
18
|
# Evaluate the current object. Just a stub method, since the subclass
|
@@ -1,6 +1,8 @@
|
|
1
1
|
class Puppet::Parser::Compiler
|
2
2
|
# Validator that asserts that all capability resources that are referenced by 'consume' or 'require' has
|
3
3
|
# been exported by some other resource in the environment
|
4
|
+
#
|
5
|
+
# @deprecated application orchestration will be removed in puppet 7
|
4
6
|
class CatalogValidator::EnvironmentRelationshipValidator < CatalogValidator
|
5
7
|
|
6
8
|
def validate
|
@@ -1,5 +1,7 @@
|
|
1
1
|
class Puppet::Parser::Compiler
|
2
2
|
# Validator that asserts that only application components can appear inside a site.
|
3
|
+
#
|
4
|
+
# @deprecated application orchestration will be removed in puppet 7
|
3
5
|
class CatalogValidator::SiteValidator < CatalogValidator
|
4
6
|
def self.validation_stage?(stage)
|
5
7
|
PRE_FINISH.equal?(stage)
|
@@ -1,5 +1,6 @@
|
|
1
1
|
require 'puppet/parser/compiler'
|
2
2
|
|
3
|
+
# @deprecated application orchestration will be removed in puppet 7
|
3
4
|
class Puppet::Parser::EnvironmentCompiler < Puppet::Parser::Compiler
|
4
5
|
def self.compile(env, code_id=nil)
|
5
6
|
begin
|
@@ -54,6 +55,8 @@ class Puppet::Parser::EnvironmentCompiler < Puppet::Parser::Compiler
|
|
54
55
|
end
|
55
56
|
|
56
57
|
def compile
|
58
|
+
Puppet.deprecation_warning("Application orchestration is deprecated. See https://puppet.com/docs/puppet/5.5/deprecated_language.html")
|
59
|
+
|
57
60
|
add_function_overrides
|
58
61
|
begin
|
59
62
|
Puppet.override(@context_overrides, _("For compiling environment catalog %{env}") % { env: environment.name }) do
|
@@ -24,7 +24,7 @@ module Puppet::Parser::Functions
|
|
24
24
|
Puppet::Util::Log.levels.each do |level|
|
25
25
|
newfunction(level,
|
26
26
|
:environment => root_env,
|
27
|
-
:doc => "Log a message on the server at level #{level
|
27
|
+
:doc => "Log a message on the server at level #{level}.") do |vals|
|
28
28
|
send(level, vals.join(" "))
|
29
29
|
end
|
30
30
|
end
|
@@ -7,12 +7,12 @@ result as a String.
|
|
7
7
|
The first argument to this function should be a `<MODULE NAME>/<TEMPLATE FILE>`
|
8
8
|
reference, which loads `<TEMPLATE FILE>` from `<MODULE NAME>`'s `templates`
|
9
9
|
directory. In most cases, the last argument is optional; if used, it should be a
|
10
|
-
[hash](/puppet/latest/
|
10
|
+
[hash](https://puppet.com/docs/puppet/latest/lang_data_hash.html) that contains parameters to
|
11
11
|
pass to the template.
|
12
12
|
|
13
|
-
- See the [template](/puppet/latest/
|
13
|
+
- See the [template](https://puppet.com/docs/puppet/latest/lang_template.html) documentation
|
14
14
|
for general template usage information.
|
15
|
-
- See the [EPP syntax](/puppet/latest/
|
15
|
+
- See the [EPP syntax](https://puppet.com/docs/puppet/latest/lang_template_epp.html)
|
16
16
|
documentation for examples of EPP.
|
17
17
|
|
18
18
|
For example, to call the apache module's `templates/vhost/_docroot.epp`
|
@@ -6,12 +6,12 @@ text result as a String.
|
|
6
6
|
|
7
7
|
The first argument to this function should be a string containing an EPP
|
8
8
|
template. In most cases, the last argument is optional; if used, it should be a
|
9
|
-
[hash](/puppet/latest/
|
9
|
+
[hash](https://puppet.com/docs/puppet/latest/lang_data_hash.html) that contains parameters to
|
10
10
|
pass to the template.
|
11
11
|
|
12
|
-
- See the [template](/puppet/latest/
|
12
|
+
- See the [template](https://puppet.com/docs/puppet/latest/lang_template.html) documentation
|
13
13
|
for general template usage information.
|
14
|
-
- See the [EPP syntax](/puppet/latest/
|
14
|
+
- See the [EPP syntax](https://puppet.com/docs/puppet/latest/lang_template_epp.html)
|
15
15
|
documentation for examples of EPP.
|
16
16
|
|
17
17
|
For example, to evaluate an inline EPP template and pass it the `docroot` and
|
@@ -29,7 +29,7 @@ parameter tag without default values. Puppet produces an error if the
|
|
29
29
|
`inline_epp` function fails to pass any required parameter.
|
30
30
|
|
31
31
|
An inline EPP template should be written as a single-quoted string or
|
32
|
-
[heredoc](/puppet/latest/
|
32
|
+
[heredoc](https://puppet.com/docs/puppet/latest/lang_data_string.html#heredocs).
|
33
33
|
A double-quoted string is subject to expression interpolation before the string
|
34
34
|
is parsed as an EPP template.
|
35
35
|
|
@@ -45,7 +45,7 @@ END
|
|
45
45
|
~~~
|
46
46
|
|
47
47
|
- Since 3.5
|
48
|
-
- Requires [future parser](/puppet/3.8/
|
48
|
+
- Requires [future parser](https://puppet.com/docs/puppet/3.8/experiments_future.html) in Puppet 3.5 to 3.8") do |arguments|
|
49
49
|
|
50
50
|
Puppet::Parser::Functions::Error.is4x('inline_epp')
|
51
51
|
end
|
@@ -337,10 +337,11 @@ class Puppet::Parser::Resource < Puppet::Resource
|
|
337
337
|
end
|
338
338
|
|
339
339
|
def replace_sensitive_data
|
340
|
-
parameters.
|
340
|
+
parameters.keys.each do |name|
|
341
|
+
param = parameters[name]
|
341
342
|
if param.value.is_a?(Puppet::Pops::Types::PSensitiveType::Sensitive)
|
342
343
|
@sensitive_parameters << name
|
343
|
-
|
344
|
+
parameters[name] = Puppet::Parser::Resource::Param.from_param(param, param.value.unwrap)
|
344
345
|
end
|
345
346
|
end
|
346
347
|
end
|