puppet 5.3.7-x86-mingw32 → 5.4.0-x86-mingw32
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of puppet might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/CONTRIBUTING.md +42 -29
- data/README.md +8 -6
- data/ext/cert_inspector +2 -2
- data/ext/envpuppet +1 -1
- data/ext/gentoo/init.d/puppetmaster +4 -4
- data/ext/ips/puppet-agent +11 -11
- data/ext/ips/puppet-master +11 -11
- data/ext/puppet-test +1 -2
- data/ext/redhat/client.init +2 -2
- data/ext/redhat/logrotate +1 -1
- data/ext/solaris/smf/puppet +11 -11
- data/ext/solaris/smf/svc-puppetd +5 -5
- data/ext/solaris/smf/svc-puppetmasterd +5 -5
- data/ext/windows/service/daemon.rb +1 -1
- data/install.rb +2 -3
- data/lib/puppet/agent.rb +1 -1
- data/lib/puppet/application/cert.rb +1 -3
- data/lib/puppet/application/describe.rb +0 -1
- data/lib/puppet/application/device.rb +12 -99
- data/lib/puppet/application/filebucket.rb +32 -11
- data/lib/puppet/application/lookup.rb +1 -11
- data/lib/puppet/application/script.rb +261 -0
- data/lib/puppet/configurer.rb +3 -4
- data/lib/puppet/configurer/plugin_handler.rb +26 -9
- data/lib/puppet/context.rb +1 -1
- data/lib/puppet/datatypes.rb +213 -0
- data/lib/puppet/datatypes/error.rb +21 -0
- data/lib/puppet/datatypes/impl/error.rb +40 -0
- data/lib/puppet/defaults.rb +51 -20
- data/lib/puppet/environments.rb +17 -0
- data/lib/puppet/error.rb +17 -0
- data/lib/puppet/etc.rb +2 -2
- data/lib/puppet/external/pson/pure/generator.rb +1 -1
- data/lib/puppet/external/pson/pure/parser.rb +1 -1
- data/lib/puppet/face/config.rb +45 -0
- data/lib/puppet/face/epp.rb +3 -3
- data/lib/puppet/face/help/action.erb +3 -0
- data/lib/puppet/face/module/build.rb +1 -0
- data/lib/puppet/face/module/generate.rb +5 -0
- data/lib/puppet/face/module/install.rb +1 -0
- data/lib/puppet/face/module/search.rb +6 -2
- data/lib/puppet/face/module/uninstall.rb +1 -0
- data/lib/puppet/face/module/upgrade.rb +1 -0
- data/lib/puppet/face/parser.rb +0 -1
- data/lib/puppet/face/plugin.rb +1 -3
- data/lib/puppet/feature/base.rb +1 -1
- data/lib/puppet/feature/bolt.rb +3 -0
- data/lib/puppet/file_bucket/dipper.rb +1 -2
- data/lib/puppet/file_serving/http_metadata.rb +1 -1
- data/lib/puppet/file_system/uniquefile.rb +2 -2
- data/lib/puppet/forge.rb +6 -0
- data/lib/puppet/functions.rb +70 -88
- data/lib/puppet/functions/all.rb +6 -2
- data/lib/puppet/functions/annotate.rb +1 -1
- data/lib/puppet/functions/any.rb +7 -3
- data/lib/puppet/functions/contain.rb +6 -0
- data/lib/puppet/functions/convert_to.rb +32 -0
- data/lib/puppet/functions/defined.rb +0 -3
- data/lib/puppet/functions/each.rb +10 -6
- data/lib/puppet/functions/filter.rb +16 -10
- data/lib/puppet/functions/find_file.rb +0 -1
- data/lib/puppet/functions/include.rb +6 -0
- data/lib/puppet/functions/map.rb +12 -9
- data/lib/puppet/functions/module_directory.rb +41 -0
- data/lib/puppet/functions/new.rb +1 -4
- data/lib/puppet/functions/regsubst.rb +1 -1
- data/lib/puppet/functions/require.rb +6 -0
- data/lib/puppet/generate/type.rb +1 -1
- data/lib/puppet/gettext/config.rb +2 -2
- data/lib/puppet/gettext/stubs.rb +1 -1
- data/lib/puppet/indirector/catalog/compiler.rb +0 -1
- data/lib/puppet/indirector/file_bucket_file/file.rb +6 -2
- data/lib/puppet/indirector/file_server.rb +1 -1
- data/lib/puppet/indirector/node/ldap.rb +19 -3
- data/lib/puppet/indirector/request.rb +10 -6
- data/lib/puppet/indirector/rest.rb +11 -12
- data/lib/puppet/info_service/class_information_service.rb +1 -1
- data/lib/puppet/interface/action.rb +11 -0
- data/lib/puppet/interface/action_builder.rb +8 -0
- data/lib/puppet/interface/option_manager.rb +1 -1
- data/lib/puppet/loaders.rb +2 -0
- data/lib/puppet/module.rb +6 -2
- data/lib/puppet/module_tool/applications/builder.rb +4 -0
- data/lib/puppet/module_tool/applications/installer.rb +3 -0
- data/lib/puppet/module_tool/applications/uninstaller.rb +3 -0
- data/lib/puppet/module_tool/applications/unpacker.rb +1 -1
- data/lib/puppet/module_tool/applications/upgrader.rb +3 -0
- data/lib/puppet/module_tool/installed_modules.rb +1 -1
- data/lib/puppet/module_tool/metadata.rb +0 -1
- data/lib/puppet/network/authstore.rb +1 -1
- data/lib/puppet/network/http/api/indirected_routes.rb +1 -1
- data/lib/puppet/network/http/connection.rb +1 -9
- data/lib/puppet/network/http/factory.rb +0 -3
- data/lib/puppet/network/http/webrick.rb +1 -0
- data/lib/puppet/network/rights.rb +1 -1
- data/lib/puppet/node.rb +53 -0
- data/lib/puppet/node/environment.rb +1 -1
- data/lib/puppet/parameter/boolean.rb +1 -1
- data/lib/puppet/parser.rb +1 -0
- data/lib/puppet/parser/abstract_compiler.rb +36 -0
- data/lib/puppet/parser/ast/branch.rb +1 -1
- data/lib/puppet/parser/ast/pops_bridge.rb +8 -52
- data/lib/puppet/parser/compiler.rb +4 -54
- data/lib/puppet/parser/functions.rb +0 -1
- data/lib/puppet/parser/functions/create_resources.rb +6 -0
- data/lib/puppet/parser/functions/fqdn_rand.rb +6 -2
- data/lib/puppet/parser/functions/inline_template.rb +6 -0
- data/lib/puppet/parser/functions/new.rb +47 -32
- data/lib/puppet/parser/functions/realize.rb +6 -0
- data/lib/puppet/parser/functions/return.rb +1 -22
- data/lib/puppet/parser/functions/reverse_each.rb +1 -1
- data/lib/puppet/parser/functions/scanf.rb +1 -1
- data/lib/puppet/parser/functions/sha256.rb +5 -0
- data/lib/puppet/parser/functions/tag.rb +6 -0
- data/lib/puppet/parser/functions/tagged.rb +6 -0
- data/lib/puppet/parser/functions/template.rb +5 -0
- data/lib/puppet/parser/scope.rb +28 -4
- data/lib/puppet/parser/script_compiler.rb +118 -0
- data/lib/puppet/parser/type_loader.rb +1 -1
- data/lib/puppet/pops.rb +1 -1
- data/lib/puppet/pops/evaluator/access_operator.rb +38 -4
- data/lib/puppet/pops/evaluator/closure.rb +12 -4
- data/lib/puppet/pops/evaluator/compare_operator.rb +4 -4
- data/lib/puppet/pops/evaluator/epp_evaluator.rb +13 -0
- data/lib/puppet/pops/evaluator/evaluator_impl.rb +38 -10
- data/lib/puppet/pops/evaluator/literal_evaluator.rb +1 -1
- data/lib/puppet/pops/evaluator/runtime3_converter.rb +1 -1
- data/lib/puppet/pops/evaluator/runtime3_support.rb +2 -3
- data/lib/puppet/pops/functions/dispatch.rb +6 -5
- data/lib/puppet/pops/functions/function.rb +2 -2
- data/lib/puppet/pops/issues.rb +34 -2
- data/lib/puppet/pops/loader/base_loader.rb +10 -0
- data/lib/puppet/pops/loader/dependency_loader.rb +7 -0
- data/lib/puppet/pops/loader/loader.rb +21 -2
- data/lib/puppet/pops/loader/loader_paths.rb +180 -30
- data/lib/puppet/pops/loader/module_loaders.rb +202 -33
- data/lib/puppet/pops/loader/puppet_plan_instantiator.rb +84 -0
- data/lib/puppet/pops/loader/puppet_resource_type_impl_instantiator.rb +9 -9
- data/lib/puppet/pops/loader/ruby_data_type_instantiator.rb +40 -0
- data/lib/puppet/pops/loader/runtime3_type_loader.rb +6 -1
- data/lib/puppet/pops/loader/static_loader.rb +23 -8
- data/lib/puppet/pops/loader/task_instantiator.rb +69 -0
- data/lib/puppet/pops/loader/type_definition_instantiator.rb +4 -0
- data/lib/puppet/pops/loaders.rb +122 -11
- data/lib/puppet/pops/lookup/data_dig_function_provider.rb +1 -1
- data/lib/puppet/pops/lookup/interpolation.rb +1 -1
- data/lib/puppet/pops/lookup/lookup_adapter.rb +0 -1
- data/lib/puppet/pops/model/ast.pp +3 -0
- data/lib/puppet/pops/model/ast.rb +34 -1
- data/lib/puppet/pops/model/factory.rb +30 -3
- data/lib/puppet/pops/model/model_label_provider.rb +1 -0
- data/lib/puppet/pops/model/model_tree_dumper.rb +12 -1
- data/lib/puppet/pops/model/tree_dumper.rb +1 -1
- data/lib/puppet/pops/parser/code_merger.rb +2 -2
- data/lib/puppet/pops/parser/egrammar.ra +44 -15
- data/lib/puppet/pops/parser/eparser.rb +1687 -1571
- data/lib/puppet/pops/parser/epp_support.rb +1 -3
- data/lib/puppet/pops/parser/evaluating_parser.rb +1 -1
- data/lib/puppet/pops/parser/interpolation_support.rb +2 -2
- data/lib/puppet/pops/parser/lexer2.rb +4 -4
- data/lib/puppet/pops/parser/lexer_support.rb +2 -2
- data/lib/puppet/pops/parser/locatable.rb +1 -1
- data/lib/puppet/pops/parser/locator.rb +7 -13
- data/lib/puppet/pops/parser/parser_support.rb +3 -3
- data/lib/puppet/pops/parser/slurp_support.rb +0 -3
- data/lib/puppet/pops/pcore.rb +45 -0
- data/lib/puppet/pops/resource/param.rb +1 -1
- data/lib/puppet/pops/resource/resource_type_impl.rb +1 -1
- data/lib/puppet/pops/serialization/abstract_reader.rb +4 -0
- data/lib/puppet/pops/serialization/abstract_writer.rb +6 -0
- data/lib/puppet/pops/serialization/extension.rb +1 -0
- data/lib/puppet/pops/serialization/from_data_converter.rb +64 -10
- data/lib/puppet/pops/serialization/json_path.rb +2 -1
- data/lib/puppet/pops/serialization/object.rb +3 -4
- data/lib/puppet/pops/serialization/serializer.rb +2 -1
- data/lib/puppet/pops/serialization/to_data_converter.rb +7 -3
- data/lib/puppet/pops/time/timespan.rb +1 -1
- data/lib/puppet/pops/types/iterable.rb +38 -9
- data/lib/puppet/pops/types/p_init_type.rb +1 -1
- data/lib/puppet/pops/types/p_meta_type.rb +4 -0
- data/lib/puppet/pops/types/p_object_type.rb +146 -14
- data/lib/puppet/pops/types/p_object_type_extension.rb +218 -0
- data/lib/puppet/pops/types/p_sem_ver_range_type.rb +0 -1
- data/lib/puppet/pops/types/p_sem_ver_type.rb +10 -2
- data/lib/puppet/pops/types/p_type_set_type.rb +0 -1
- data/lib/puppet/pops/types/p_uri_type.rb +190 -0
- data/lib/puppet/pops/types/puppet_object.rb +15 -1
- data/lib/puppet/pops/types/ruby_generator.rb +46 -54
- data/lib/puppet/pops/types/string_converter.rb +22 -1
- data/lib/puppet/pops/types/type_acceptor.rb +1 -1
- data/lib/puppet/pops/types/type_calculator.rb +13 -4
- data/lib/puppet/pops/types/type_factory.rb +29 -5
- data/lib/puppet/pops/types/type_formatter.rb +67 -4
- data/lib/puppet/pops/types/type_parser.rb +92 -4
- data/lib/puppet/pops/types/type_with_members.rb +43 -0
- data/lib/puppet/pops/types/types.rb +212 -80
- data/lib/puppet/pops/validation/checker4_0.rb +10 -6
- data/lib/puppet/pops/validation/tasks_checker.rb +60 -0
- data/lib/puppet/pops/validation/validator_factory_4_0.rb +6 -1
- data/lib/puppet/property.rb +1 -1
- data/lib/puppet/provider.rb +18 -8
- data/lib/puppet/provider/augeas/augeas.rb +3 -4
- data/lib/puppet/provider/exec.rb +0 -2
- data/lib/puppet/provider/group/groupadd.rb +25 -1
- data/lib/puppet/provider/group/windows_adsi.rb +7 -4
- data/lib/puppet/provider/mount.rb +25 -8
- data/lib/puppet/provider/nameservice.rb +9 -4
- data/lib/puppet/provider/nameservice/directoryservice.rb +3 -3
- data/lib/puppet/provider/nameservice/objectadd.rb +13 -24
- data/lib/puppet/provider/nameservice/pw.rb +14 -14
- data/lib/puppet/provider/package/appdmg.rb +0 -1
- data/lib/puppet/provider/package/apple.rb +0 -1
- data/lib/puppet/provider/package/gem.rb +2 -2
- data/lib/puppet/provider/package/macports.rb +2 -2
- data/lib/puppet/provider/package/pkg.rb +3 -0
- data/lib/puppet/provider/package/pkgdmg.rb +0 -1
- data/lib/puppet/provider/package/portage.rb +0 -1
- data/lib/puppet/provider/package/yum.rb +23 -8
- data/lib/puppet/provider/package/zypper.rb +2 -2
- data/lib/puppet/provider/scheduled_task/win32_taskscheduler.rb +2 -2
- data/lib/puppet/provider/service/init.rb +1 -0
- data/lib/puppet/provider/service/launchd.rb +6 -7
- data/lib/puppet/provider/service/redhat.rb +3 -2
- data/lib/puppet/provider/service/systemd.rb +2 -2
- data/lib/puppet/provider/ssh_authorized_key/parsed.rb +1 -1
- data/lib/puppet/provider/user/aix.rb +3 -2
- data/lib/puppet/provider/user/openbsd.rb +1 -1
- data/lib/puppet/provider/user/pw.rb +1 -1
- data/lib/puppet/provider/user/user_role_add.rb +7 -1
- data/lib/puppet/provider/user/useradd.rb +36 -6
- data/lib/puppet/provider/user/windows_adsi.rb +1 -1
- data/lib/puppet/provider/yumrepo/inifile.rb +2 -4
- data/lib/puppet/provider/zfs/zfs.rb +23 -3
- data/lib/puppet/provider/zpool/zpool.rb +1 -1
- data/lib/puppet/reference/configuration.rb +0 -2
- data/lib/puppet/reference/type.rb +0 -1
- data/lib/puppet/resource.rb +1 -2
- data/lib/puppet/resource/catalog.rb +1 -1
- data/lib/puppet/resource/status.rb +0 -1
- data/lib/puppet/resource/type.rb +4 -4
- data/lib/puppet/resource/type_collection.rb +1 -1
- data/lib/puppet/settings/base_setting.rb +1 -1
- data/lib/puppet/settings/environment_conf.rb +0 -1
- data/lib/puppet/settings/ini_file.rb +66 -12
- data/lib/puppet/ssl/certificate_authority.rb +1 -1
- data/lib/puppet/ssl/certificate_request.rb +2 -2
- data/lib/puppet/ssl/certificate_revocation_list.rb +2 -1
- data/lib/puppet/ssl/certificate_signer.rb +11 -0
- data/lib/puppet/ssl/host.rb +2 -2
- data/lib/puppet/syntax_checkers/base64.rb +1 -1
- data/lib/puppet/transaction.rb +37 -14
- data/lib/puppet/transaction/report.rb +3 -1
- data/lib/puppet/type.rb +17 -4
- data/lib/puppet/type/cron.rb +1 -1
- data/lib/puppet/type/exec.rb +5 -4
- data/lib/puppet/type/file.rb +3 -3
- data/lib/puppet/type/file/checksum.rb +7 -1
- data/lib/puppet/type/file/checksum_value.rb +4 -3
- data/lib/puppet/type/group.rb +3 -0
- data/lib/puppet/type/k5login.rb +101 -0
- data/lib/puppet/type/macauthorization.rb +1 -1
- data/lib/puppet/type/mount.rb +6 -2
- data/lib/puppet/type/tidy.rb +6 -4
- data/lib/puppet/type/user.rb +26 -39
- data/lib/puppet/type/yumrepo.rb +9 -0
- data/lib/puppet/type/zfs.rb +4 -0
- data/lib/puppet/util.rb +8 -15
- data/lib/puppet/util/character_encoding.rb +2 -2
- data/lib/puppet/util/checksums.rb +82 -1
- data/lib/puppet/util/errors.rb +0 -2
- data/lib/puppet/util/filetype.rb +2 -2
- data/lib/puppet/util/json_lockfile.rb +1 -1
- data/lib/puppet/util/log.rb +1 -1
- data/lib/puppet/util/log/destinations.rb +10 -1
- data/lib/puppet/util/monkey_patches.rb +1 -1
- data/lib/puppet/util/network_device/cisco/device.rb +5 -5
- data/lib/puppet/util/network_device/config.rb +2 -3
- data/lib/puppet/util/platform.rb +13 -0
- data/lib/puppet/util/plist.rb +4 -4
- data/lib/puppet/util/rdoc/generators/puppet_generator.rb +2 -2
- data/lib/puppet/util/rdoc/parser/puppet_parser_rdoc2.rb +1 -1
- data/lib/puppet/util/reference.rb +8 -1
- data/lib/puppet/util/windows/adsi.rb +18 -15
- data/lib/puppet/util/windows/principal.rb +6 -7
- data/lib/puppet/util/windows/process.rb +1 -1
- data/lib/puppet/util/windows/registry.rb +2 -2
- data/lib/puppet/util/windows/sid.rb +7 -62
- data/lib/puppet/vendor/deep_merge/README.md +2 -2
- data/lib/puppet/vendor/pathspec/lib/pathspec/gitignorespec.rb +18 -18
- data/lib/puppet/vendor/semantic_puppet/lib/semantic_puppet/version.rb +2 -2
- data/lib/puppet/vendor/semantic_puppet/lib/semantic_puppet/version_range.rb +5 -5
- data/lib/puppet/vendor/semantic_puppet/locales/config.yaml +1 -1
- data/lib/puppet/version.rb +1 -1
- data/lib/puppet_pal.rb +874 -0
- data/locales/ja/puppet.po +140 -163
- data/locales/puppet.pot +940 -597
- data/man/man5/puppet.conf.5 +16 -91
- data/man/man8/puppet-agent.8 +2 -6
- data/man/man8/puppet-apply.8 +2 -2
- 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 +11 -33
- 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 +4 -22
- 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 +2 -11
- 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-status.8 +1 -1
- data/man/man8/puppet.8 +2 -2
- data/spec/integration/application/lookup_spec.rb +0 -21
- data/spec/integration/parser/compiler_spec.rb +18 -0
- data/spec/integration/parser/script_compiler_spec.rb +113 -0
- data/spec/integration/provider/mount_spec.rb +2 -0
- data/spec/integration/type/file_spec.rb +11 -3
- data/spec/integration/util/windows/adsi_spec.rb +1 -86
- data/spec/integration/util/windows/principal_spec.rb +1 -10
- data/spec/shared_contexts/checksum.rb +4 -1
- data/spec/shared_contexts/digests.rb +46 -1
- data/spec/shared_contexts/types_setup.rb +8 -3
- data/spec/unit/agent_spec.rb +2 -2
- data/spec/unit/application/cert_spec.rb +5 -17
- data/spec/unit/application/device_spec.rb +2 -96
- data/spec/unit/application/filebucket_spec.rb +18 -4
- data/spec/unit/configurer/plugin_handler_spec.rb +5 -32
- data/spec/unit/configurer_spec.rb +3 -3
- data/spec/unit/datatypes_spec.rb +304 -0
- data/spec/unit/defaults_spec.rb +41 -20
- data/spec/unit/face/config_spec.rb +46 -1
- data/spec/unit/face/epp_face_spec.rb +7 -3
- data/spec/unit/face/module/search_spec.rb +11 -0
- data/spec/unit/face/parser_spec.rb +2 -2
- data/spec/unit/file_bucket/dipper_spec.rb +12 -1
- data/spec/unit/forge/module_release_spec.rb +70 -0
- data/spec/unit/functions/break_spec.rb +34 -2
- data/spec/unit/functions/contain_spec.rb +1 -0
- data/spec/unit/functions/convert_to_spec.rb +22 -0
- data/spec/unit/functions/epp_spec.rb +5 -0
- data/spec/unit/functions/include_spec.rb +15 -0
- data/spec/unit/functions/module_directory_spec.rb +43 -0
- data/spec/unit/functions/new_spec.rb +14 -14
- data/spec/unit/functions/require_spec.rb +2 -0
- data/spec/unit/functions/shared.rb +12 -0
- data/spec/unit/functions/step_spec.rb +1 -1
- data/spec/unit/functions4_spec.rb +49 -4
- data/spec/unit/indirector/catalog/compiler_spec.rb +3 -3
- data/spec/unit/indirector/file_bucket_file/file_spec.rb +148 -94
- data/spec/unit/indirector/node/ldap_spec.rb +15 -12
- data/spec/unit/indirector/rest_spec.rb +0 -43
- data/spec/unit/interface/action_spec.rb +33 -0
- data/spec/unit/module_tool/applications/builder_spec.rb +7 -0
- data/spec/unit/module_tool/applications/installer_spec.rb +8 -0
- data/spec/unit/module_tool/applications/uninstaller_spec.rb +8 -0
- data/spec/unit/module_tool/applications/upgrader_spec.rb +6 -0
- data/spec/unit/network/http/connection_spec.rb +1 -1
- data/spec/unit/network/http/factory_spec.rb +28 -35
- data/spec/unit/parser/compiler_spec.rb +0 -8
- data/spec/unit/parser/environment_compiler_spec.rb +36 -0
- data/spec/unit/parser/functions/create_resources_spec.rb +9 -0
- data/spec/unit/parser/functions/inline_template_spec.rb +7 -0
- data/spec/unit/parser/functions/realize_spec.rb +9 -0
- data/spec/unit/parser/functions/tag_spec.rb +7 -0
- data/spec/unit/parser/functions/tagged_spec.rb +25 -0
- data/spec/unit/parser/functions/template_spec.rb +8 -0
- data/spec/unit/parser/scope_spec.rb +19 -0
- data/spec/unit/pops/evaluator/conditionals_spec.rb +1 -1
- data/spec/unit/pops/loaders/loader_spec.rb +516 -0
- data/spec/unit/pops/loaders/loaders_spec.rb +11 -0
- data/spec/unit/pops/loaders/module_loaders_spec.rb +43 -0
- data/spec/unit/pops/loaders/static_loader_spec.rb +15 -7
- data/spec/unit/pops/model/model_spec.rb +5 -0
- data/spec/unit/pops/parser/lexer2_spec.rb +15 -0
- data/spec/unit/pops/parser/locator_spec.rb +20 -0
- data/spec/unit/pops/parser/parse_basic_expressions_spec.rb +33 -0
- data/spec/unit/pops/parser/parse_calls_spec.rb +28 -0
- data/spec/unit/pops/parser/parse_conditionals_spec.rb +12 -0
- data/spec/unit/pops/parser/parse_plan_spec.rb +48 -0
- data/spec/unit/pops/serialization/packer_spec.rb +8 -0
- data/spec/unit/pops/serialization/serialization_spec.rb +30 -0
- data/spec/unit/pops/serialization/to_from_hr_spec.rb +31 -0
- data/spec/unit/pops/types/error_spec.rb +207 -0
- data/spec/unit/pops/types/p_init_type_spec.rb +98 -0
- data/spec/unit/pops/types/p_object_type_spec.rb +275 -10
- data/spec/unit/pops/types/p_uri_type_spec.rb +191 -0
- data/spec/unit/pops/types/ruby_generator_spec.rb +82 -44
- data/spec/unit/pops/types/task_spec.rb +353 -0
- data/spec/unit/pops/types/type_calculator_spec.rb +76 -5
- data/spec/unit/pops/types/type_formatter_spec.rb +31 -13
- data/spec/unit/pops/types/type_parser_spec.rb +13 -1
- data/spec/unit/pops/types/types_spec.rb +60 -0
- data/spec/unit/pops/validator/validator_spec.rb +76 -0
- data/spec/unit/provider/group/groupadd_spec.rb +77 -1
- data/spec/unit/provider/group/pw_spec.rb +4 -4
- data/spec/unit/provider/group/windows_adsi_spec.rb +22 -79
- data/spec/unit/provider/mount_spec.rb +18 -5
- data/spec/unit/provider/nameservice_spec.rb +5 -5
- data/spec/unit/provider/package/dnf_spec.rb +2 -2
- data/spec/unit/provider/package/gem_spec.rb +1 -1
- data/spec/unit/provider/package/pkg_spec.rb +3 -0
- data/spec/unit/provider/package/yum_spec.rb +40 -0
- data/spec/unit/provider/service/launchd_spec.rb +2 -1
- data/spec/unit/provider/service/redhat_spec.rb +5 -0
- data/spec/unit/provider/service/systemd_spec.rb +1 -1
- data/spec/unit/provider/user/hpux_spec.rb +2 -2
- data/spec/unit/provider/user/openbsd_spec.rb +2 -2
- data/spec/unit/provider/user/pw_spec.rb +14 -14
- data/spec/unit/provider/user/user_role_add_spec.rb +19 -2
- data/spec/unit/provider/user/useradd_spec.rb +188 -22
- data/spec/unit/provider/user/windows_adsi_spec.rb +4 -4
- data/spec/unit/provider/zfs/zfs_spec.rb +55 -1
- data/spec/unit/provider_spec.rb +48 -0
- data/spec/unit/puppet_pal_2pec.rb +1005 -0
- data/spec/unit/puppet_pal_spec.rb +11 -0
- data/spec/unit/settings/ini_file_spec.rb +313 -2
- data/spec/unit/ssl/certificate_request_spec.rb +42 -1
- data/spec/unit/ssl/certificate_revocation_list_spec.rb +2 -1
- data/spec/unit/transaction/report_spec.rb +1 -0
- data/spec/unit/transaction_spec.rb +112 -21
- data/spec/unit/type/file/checksum_spec.rb +20 -0
- data/spec/unit/type/file_spec.rb +8 -0
- data/spec/unit/type/group_spec.rb +8 -0
- data/spec/unit/type/k5login_spec.rb +22 -1
- data/spec/unit/type/scheduled_task_spec.rb +15 -0
- data/spec/unit/type/user_spec.rb +11 -1
- data/spec/unit/type/yumrepo_spec.rb +5 -0
- data/spec/unit/util/checksums_spec.rb +3 -3
- data/spec/unit/util/log/destinations_spec.rb +14 -0
- data/spec/unit/util/network_device/cisco/device_spec.rb +1 -1
- data/spec/unit/util/plist_spec.rb +3 -3
- data/spec/unit/util/windows/adsi_spec.rb +27 -31
- data/spec/unit/util/windows/sid_spec.rb +15 -86
- data/spec/unit/util_spec.rb +17 -3
- data/tasks/manpages.rake +1 -1
- metadata +220 -182
- data/lib/puppet/bindings.rb +0 -148
- data/lib/puppet/configurer/downloader_factory.rb +0 -44
- data/spec/unit/configurer/downloader_factory_spec.rb +0 -129
data/lib/puppet/bindings.rb
DELETED
@@ -1,148 +0,0 @@
|
|
1
|
-
# This class allows registration of named bindings that are later contributed to a layer via
|
2
|
-
# a binding scheme.
|
3
|
-
#
|
4
|
-
# The intended use is for a .rb file to be placed in confdir's or module's `lib/bindings` directory structure, with a
|
5
|
-
# name corresponding to the symbolic bindings name.
|
6
|
-
#
|
7
|
-
# Here are two equivalent examples, the first using chained methods (which is compact for simple cases), and the
|
8
|
-
# second which uses a block.
|
9
|
-
#
|
10
|
-
# @example MyModule's lib/bindings/mymodule/default.rb
|
11
|
-
# Puppet::Bindings.newbindings('mymodule::default') do
|
12
|
-
# bind.integer.named('meaning of life').to(42)
|
13
|
-
# end
|
14
|
-
#
|
15
|
-
# @example Using blocks
|
16
|
-
# Puppet::Bindings.newbindings('mymodule::default') do
|
17
|
-
# bind do
|
18
|
-
# integer
|
19
|
-
# name 'meaning of life'
|
20
|
-
# to 42
|
21
|
-
# end
|
22
|
-
# end
|
23
|
-
#
|
24
|
-
# If access is needed to the scope, this can be declared as a block parameter.
|
25
|
-
# @example MyModule's lib/bindings/mymodule/default.rb with scope
|
26
|
-
# Puppet::Bindings.newbindings('mymodule::default') do |scope|
|
27
|
-
# bind.integer.named('meaning of life').to("#{scope['::fqdn']} also think it is 42")
|
28
|
-
# end
|
29
|
-
#
|
30
|
-
# If late evaluation is wanted, this can be achieved by binding a puppet expression.
|
31
|
-
# @example binding a puppet expression
|
32
|
-
# Puppet::Bindings.newbindings('mymodule::default') do |scope|
|
33
|
-
# bind.integer.named('meaning of life').to(puppet_string("${::fqdn} also think it is 42")
|
34
|
-
# end
|
35
|
-
#
|
36
|
-
# It is allowed to define methods in the block given to `newbindings`, these can be used when
|
37
|
-
# producing bindings. (Care should naturally be taken to not override any of the already defined methods).
|
38
|
-
# @example defining method to be used while creating bindings
|
39
|
-
# Puppet::Bindings.newbindings('mymodule::default') do
|
40
|
-
# def square(x)
|
41
|
-
# x * x
|
42
|
-
# end
|
43
|
-
# bind.integer.named('meaning of life squared').to(square(42))
|
44
|
-
# end
|
45
|
-
#
|
46
|
-
# For all details see {Puppet::Pops::Binder::BindingsFactory}, which is used behind the scenes.
|
47
|
-
# @api public
|
48
|
-
#
|
49
|
-
class Puppet::Bindings
|
50
|
-
extend Enumerable
|
51
|
-
|
52
|
-
Environment = Puppet::Node::Environment
|
53
|
-
|
54
|
-
# Constructs and registers a {Puppet::Pops::Binder::Bindings::NamedBindings NamedBindings} that later can be contributed
|
55
|
-
# to a bindings layer in a bindings configuration via a URI. The name is symbolic, fully qualified with module name, and at least one
|
56
|
-
# more qualifying name (where the name `default` is used in the default bindings configuration.
|
57
|
-
#
|
58
|
-
# The given block is called with a `self` bound to an instance of {Puppet::Pops::Binder::BindingsFactory::BindingsContainerBuilder}
|
59
|
-
# which most notably has a `#bind` method which it turn calls a block bound to an instance of
|
60
|
-
# {Puppet::Pops::Binder::BindingsFactory::BindingsBuilder}.
|
61
|
-
# Depending on the use-case a direct chaining method calls or nested blocks may be used.
|
62
|
-
#
|
63
|
-
# @example simple bindings
|
64
|
-
# Puppet::Bindings.newbindings('mymodule::default') do
|
65
|
-
# bind.name('meaning of life').to(42)
|
66
|
-
# bind.integer.named('port').to(8080)
|
67
|
-
# bind.integer.named('apache::port').to(8080)
|
68
|
-
# end
|
69
|
-
#
|
70
|
-
# The block form is more suitable for longer, more complex forms of bindings.
|
71
|
-
#
|
72
|
-
def self.newbindings(name, &block)
|
73
|
-
register_proc(name, block)
|
74
|
-
end
|
75
|
-
|
76
|
-
def self.register_proc(name, block)
|
77
|
-
adapter = NamedBindingsAdapter.adapt(Puppet.lookup(:current_environment))
|
78
|
-
adapter[name] = block
|
79
|
-
end
|
80
|
-
|
81
|
-
# Registers a named_binding under its name
|
82
|
-
# @param named_bindings [Puppet::Pops::Binder::Bindings::NamedBindings] The named bindings to register.
|
83
|
-
# @api public
|
84
|
-
#
|
85
|
-
def self.register(named_bindings)
|
86
|
-
adapter = NamedBindingsAdapter.adapt(Puppet.lookup(:current_environment))
|
87
|
-
adapter[named_bindings.name] = named_bindings
|
88
|
-
end
|
89
|
-
|
90
|
-
def self.resolve(scope, name)
|
91
|
-
entry = get(name)
|
92
|
-
return entry unless entry.is_a?(Proc)
|
93
|
-
named_bindings = Puppet::Pops::Binder::BindingsFactory.safe_named_bindings(name, scope, &entry).model
|
94
|
-
adapter = NamedBindingsAdapter.adapt(Puppet.lookup(:current_environment))
|
95
|
-
adapter[named_bindings.name] = named_bindings
|
96
|
-
named_bindings
|
97
|
-
end
|
98
|
-
|
99
|
-
# Returns the named bindings with the given name, or nil if no such bindings have been registered.
|
100
|
-
# @param name [String] The fully qualified name of a binding to get
|
101
|
-
# @return [Proc, Puppet::Pops::Binder::Bindings::NamedBindings] a Proc producing named bindings, or a named bindings directly
|
102
|
-
# @api public
|
103
|
-
#
|
104
|
-
def self.get(name)
|
105
|
-
adapter = NamedBindingsAdapter.adapt(Puppet.lookup(:current_environment))
|
106
|
-
adapter[name]
|
107
|
-
end
|
108
|
-
|
109
|
-
def self.[](name)
|
110
|
-
get(name)
|
111
|
-
end
|
112
|
-
|
113
|
-
# Supports Enumerable iteration (k,v) over the named bindings hash.
|
114
|
-
def self.each
|
115
|
-
adapter = NamedBindingsAdapter.adapt(Puppet.lookup(:current_environment))
|
116
|
-
adapter.each_pair {|k,v| yield k,v }
|
117
|
-
end
|
118
|
-
|
119
|
-
# A NamedBindingsAdapter holds a map of name to Puppet::Pops::Binder::Bindings::NamedBindings.
|
120
|
-
# It is intended to be used as an association between an Environment and named bindings.
|
121
|
-
#
|
122
|
-
class NamedBindingsAdapter < Puppet::Pops::Adaptable::Adapter
|
123
|
-
def initialize()
|
124
|
-
@named_bindings = {}
|
125
|
-
end
|
126
|
-
|
127
|
-
def [](name)
|
128
|
-
@named_bindings[name]
|
129
|
-
end
|
130
|
-
|
131
|
-
def has_name?(name)
|
132
|
-
@named_bindings.has_key?
|
133
|
-
end
|
134
|
-
|
135
|
-
def []=(name, value)
|
136
|
-
unless value.is_a?(Puppet::Pops::Binder::Bindings::NamedBindings) || value.is_a?(Proc)
|
137
|
-
#TRANSLATORS 'NameBindings' is a class name and should not be translated, 'Proc' refers to a Ruby proc.
|
138
|
-
raise ArgumentError, _("Given value must be a NamedBindings, or a Proc producing one, got: %{class_name}.") % { class_name: value.class }
|
139
|
-
end
|
140
|
-
@named_bindings[name] = value
|
141
|
-
end
|
142
|
-
|
143
|
-
def each_pair(&block)
|
144
|
-
@named_bindings.each_pair(&block)
|
145
|
-
end
|
146
|
-
end
|
147
|
-
|
148
|
-
end
|
@@ -1,44 +0,0 @@
|
|
1
|
-
require 'puppet/configurer'
|
2
|
-
|
3
|
-
# Factory for <tt>Puppet::Configurer::Downloader</tt> objects.
|
4
|
-
#
|
5
|
-
# Puppet's pluginsync facilities can be used to download modules
|
6
|
-
# and external facts, each with a different destination directory
|
7
|
-
# and related settings.
|
8
|
-
#
|
9
|
-
# @api private
|
10
|
-
#
|
11
|
-
class Puppet::Configurer::DownloaderFactory
|
12
|
-
def create_plugin_downloader(environment)
|
13
|
-
plugin_downloader = Puppet::Configurer::Downloader.new(
|
14
|
-
"plugin",
|
15
|
-
Puppet[:plugindest],
|
16
|
-
Puppet[:pluginsource],
|
17
|
-
Puppet[:pluginsignore],
|
18
|
-
environment
|
19
|
-
)
|
20
|
-
end
|
21
|
-
|
22
|
-
def create_plugin_facts_downloader(environment)
|
23
|
-
source_permissions = Puppet.features.microsoft_windows? ? :ignore : :use
|
24
|
-
|
25
|
-
plugin_fact_downloader = Puppet::Configurer::Downloader.new(
|
26
|
-
"pluginfacts",
|
27
|
-
Puppet[:pluginfactdest],
|
28
|
-
Puppet[:pluginfactsource],
|
29
|
-
Puppet[:pluginsignore],
|
30
|
-
environment,
|
31
|
-
source_permissions
|
32
|
-
)
|
33
|
-
end
|
34
|
-
|
35
|
-
def create_locales_downloader(environment)
|
36
|
-
locales_downloader = Puppet::Configurer::Downloader.new(
|
37
|
-
"locales",
|
38
|
-
Puppet[:localedest],
|
39
|
-
Puppet[:localesource],
|
40
|
-
Puppet[:pluginsignore] + " *.pot config.yaml",
|
41
|
-
environment
|
42
|
-
)
|
43
|
-
end
|
44
|
-
end
|
@@ -1,129 +0,0 @@
|
|
1
|
-
#! /usr/bin/env ruby
|
2
|
-
require 'spec_helper'
|
3
|
-
require 'puppet/configurer'
|
4
|
-
|
5
|
-
describe Puppet::Configurer::DownloaderFactory do
|
6
|
-
let(:factory) { Puppet::Configurer::DownloaderFactory.new }
|
7
|
-
let(:environment) { Puppet::Node::Environment.create(:myenv, []) }
|
8
|
-
|
9
|
-
let(:plugin_downloader) do
|
10
|
-
factory.create_plugin_downloader(environment)
|
11
|
-
end
|
12
|
-
|
13
|
-
let(:facts_downloader) do
|
14
|
-
factory.create_plugin_facts_downloader(environment)
|
15
|
-
end
|
16
|
-
|
17
|
-
let(:locales_downloader) do
|
18
|
-
factory.create_locales_downloader(environment)
|
19
|
-
end
|
20
|
-
|
21
|
-
def ignores_source_permissions(downloader)
|
22
|
-
expect(downloader.file[:source_permissions]).to eq(:ignore)
|
23
|
-
end
|
24
|
-
|
25
|
-
def uses_source_permissions(downloader)
|
26
|
-
expect(downloader.file[:source_permissions]).to eq(:use)
|
27
|
-
end
|
28
|
-
|
29
|
-
context "when creating a plugin downloader for modules" do
|
30
|
-
it 'is named "plugin"' do
|
31
|
-
expect(plugin_downloader.name).to eq('plugin')
|
32
|
-
end
|
33
|
-
|
34
|
-
it 'downloads files into Puppet[:plugindest]' do
|
35
|
-
plugindest = File.expand_path("/tmp/pdest")
|
36
|
-
Puppet[:plugindest] = plugindest
|
37
|
-
|
38
|
-
expect(plugin_downloader.file[:path]).to eq(plugindest)
|
39
|
-
end
|
40
|
-
|
41
|
-
it 'downloads files from Puppet[:pluginsource]' do
|
42
|
-
Puppet[:pluginsource] = 'puppet:///myotherplugins'
|
43
|
-
|
44
|
-
expect(plugin_downloader.file[:source]).to eq([Puppet[:pluginsource]])
|
45
|
-
end
|
46
|
-
|
47
|
-
it 'ignores files from Puppet[:pluginsignore]' do
|
48
|
-
Puppet[:pluginsignore] = 'pignore'
|
49
|
-
|
50
|
-
expect(plugin_downloader.file[:ignore]).to eq(['pignore'])
|
51
|
-
end
|
52
|
-
|
53
|
-
it 'splits Puppet[:pluginsignore] on whitespace' do
|
54
|
-
Puppet[:pluginsignore] = ".svn CVS .git"
|
55
|
-
|
56
|
-
expect(plugin_downloader.file[:ignore]).to eq(%w[.svn CVS .git])
|
57
|
-
end
|
58
|
-
|
59
|
-
it "ignores source permissions" do
|
60
|
-
ignores_source_permissions(plugin_downloader)
|
61
|
-
end
|
62
|
-
end
|
63
|
-
|
64
|
-
context "when creating a plugin downloader for external facts" do
|
65
|
-
it 'is named "pluginfacts"' do
|
66
|
-
expect(facts_downloader.name).to eq('pluginfacts')
|
67
|
-
end
|
68
|
-
|
69
|
-
it 'downloads files into Puppet[:pluginfactdest]' do
|
70
|
-
plugindest = File.expand_path("/tmp/pdest")
|
71
|
-
Puppet[:pluginfactdest] = plugindest
|
72
|
-
|
73
|
-
expect(facts_downloader.file[:path]).to eq(plugindest)
|
74
|
-
end
|
75
|
-
|
76
|
-
it 'downloads files from Puppet[:pluginfactsource]' do
|
77
|
-
Puppet[:pluginfactsource] = 'puppet:///myotherfacts'
|
78
|
-
|
79
|
-
expect(facts_downloader.file[:source]).to eq([Puppet[:pluginfactsource]])
|
80
|
-
end
|
81
|
-
|
82
|
-
it 'ignores files from Puppet[:pluginsignore]' do
|
83
|
-
Puppet[:pluginsignore] = 'pignore'
|
84
|
-
|
85
|
-
expect(facts_downloader.file[:ignore]).to eq(['pignore'])
|
86
|
-
end
|
87
|
-
|
88
|
-
context "on POSIX", :if => Puppet.features.posix? do
|
89
|
-
it "uses source permissions" do
|
90
|
-
uses_source_permissions(facts_downloader)
|
91
|
-
end
|
92
|
-
end
|
93
|
-
|
94
|
-
context "on Windows", :if => Puppet.features.microsoft_windows? do
|
95
|
-
it "ignores source permissions during external fact pluginsync" do
|
96
|
-
ignores_source_permissions(facts_downloader)
|
97
|
-
end
|
98
|
-
end
|
99
|
-
end
|
100
|
-
|
101
|
-
context "when creating a plugin downloader for module translations" do
|
102
|
-
it 'is named "locales"' do
|
103
|
-
expect(locales_downloader.name).to eq('locales')
|
104
|
-
end
|
105
|
-
|
106
|
-
it 'downloads files into Puppet[:localedest]' do
|
107
|
-
localedest = File.expand_path("/tmp/ldest")
|
108
|
-
Puppet[:localedest] = localedest
|
109
|
-
|
110
|
-
expect(locales_downloader.file[:path]).to eq(localedest)
|
111
|
-
end
|
112
|
-
|
113
|
-
it 'downloads files from Puppet[:localesource]' do
|
114
|
-
Puppet[:localesource] = 'puppet:///myotherlocales'
|
115
|
-
|
116
|
-
expect(locales_downloader.file[:source]).to eq([Puppet[:localesource]])
|
117
|
-
end
|
118
|
-
|
119
|
-
it 'ignores files from Puppet[:pluginsignore], plus config.yaml' do
|
120
|
-
Puppet[:pluginsignore] = 'lignore'
|
121
|
-
|
122
|
-
expect(locales_downloader.file[:ignore]).to eq(['lignore', '*.pot', 'config.yaml'])
|
123
|
-
end
|
124
|
-
|
125
|
-
it "ignores source permissions" do
|
126
|
-
ignores_source_permissions(locales_downloader)
|
127
|
-
end
|
128
|
-
end
|
129
|
-
end
|