puppet 5.3.7 → 5.4.0
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 +216 -178
- 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
@@ -1,7 +1,7 @@
|
|
1
1
|
.\" generated with Ronn/v0.7.3
|
2
2
|
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
3
3
|
.
|
4
|
-
.TH "PUPPET\-FILEBUCKET" "8" "
|
4
|
+
.TH "PUPPET\-FILEBUCKET" "8" "June 2017" "Puppet Labs, LLC" "Puppet manual"
|
5
5
|
.
|
6
6
|
.SH "NAME"
|
7
7
|
\fBpuppet\-filebucket\fR \- Store and retrieve files in a filebucket
|
@@ -78,56 +78,38 @@ Print extra information\.
|
|
78
78
|
\-\-version
|
79
79
|
Print version information\.
|
80
80
|
.
|
81
|
-
.SH "
|
81
|
+
.SH "EXAMPLE"
|
82
82
|
.
|
83
83
|
.nf
|
84
84
|
|
85
|
-
## Backup a file to the filebucket, then restore it to a temporary directory
|
86
85
|
$ puppet filebucket backup /etc/passwd
|
87
86
|
/etc/passwd: 429b225650b912a2ee067b0a4cf1e949
|
88
87
|
$ puppet filebucket restore /tmp/passwd 429b225650b912a2ee067b0a4cf1e949
|
89
|
-
|
90
88
|
## Diff between two files in the filebucket
|
91
89
|
$ puppet filebucket \-l diff d43a6ecaa892a1962398ac9170ea9bf2 7ae322f5791217e031dc60188f4521ef
|
92
90
|
1a2
|
93
91
|
> again
|
94
|
-
|
95
|
-
## Diff between the file in the filebucket and a local file
|
92
|
+
## Diff between the file in the filebucket and the current one
|
96
93
|
$ puppet filebucket \-l diff d43a6ecaa892a1962398ac9170ea9bf2 /tmp/testFile
|
97
94
|
1a2
|
98
95
|
> again
|
99
|
-
|
100
|
-
## Backup a file to the filebucket and observe that it keeps each backup separate
|
101
96
|
$ puppet filebucket \-l list
|
102
97
|
d43a6ecaa892a1962398ac9170ea9bf2 2015\-05\-11 09:27:56 /tmp/TestFile
|
103
|
-
|
104
98
|
$ echo again >> /tmp/TestFile
|
105
|
-
|
106
99
|
$ puppet filebucket \-l backup /tmp/TestFile
|
107
100
|
/tmp/TestFile: 7ae322f5791217e031dc60188f4521ef
|
108
|
-
|
109
|
-
$ puppet filebucket \-l list
|
101
|
+
$ puppet filebucket \-l list
|
110
102
|
d43a6ecaa892a1962398ac9170ea9bf2 2015\-05\-11 09:27:56 /tmp/TestFile
|
111
103
|
7ae322f5791217e031dc60188f4521ef 2015\-05\-11 09:52:15 /tmp/TestFile
|
112
|
-
|
113
|
-
## List files in a filebucket within date ranges
|
114
104
|
$ puppet filebucket \-l \-f 2015\-01\-01 \-t 2015\-01\-11 list
|
115
105
|
<Empty Output>
|
116
|
-
|
117
106
|
$ puppet filebucket \-l \-f 2015\-05\-10 list
|
118
107
|
d43a6ecaa892a1962398ac9170ea9bf2 2015\-05\-11 09:27:56 /tmp/TestFile
|
119
108
|
7ae322f5791217e031dc60188f4521ef 2015\-05\-11 09:52:15 /tmp/TestFile
|
120
|
-
|
121
109
|
$ puppet filebucket \-l \-f "2015\-05\-11 09:30:00" list
|
122
110
|
7ae322f5791217e031dc60188f4521ef 2015\-05\-11 09:52:15 /tmp/TestFile
|
123
|
-
|
124
111
|
$ puppet filebucket \-l \-t "2015\-05\-11 09:30:00" list
|
125
112
|
d43a6ecaa892a1962398ac9170ea9bf2 2015\-05\-11 09:27:56 /tmp/TestFile
|
126
|
-
|
127
|
-
## From a Puppet master, list files in the master bucketdir
|
128
|
-
$ puppet filebucket \-b $(puppet config print bucketdir \-\-section master) list
|
129
|
-
d43a6ecaa892a1962398ac9170ea9bf2 2015\-05\-11 09:27:56 /tmp/TestFile
|
130
|
-
7ae322f5791217e031dc60188f4521ef 2015\-05\-11 09:52:15 /tmp/TestFile
|
131
113
|
.
|
132
114
|
.fi
|
133
115
|
.
|
data/man/man8/puppet-generate.8
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
.\" generated with Ronn/v0.7.3
|
2
2
|
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
3
3
|
.
|
4
|
-
.TH "PUPPET\-GENERATE" "8" "
|
4
|
+
.TH "PUPPET\-GENERATE" "8" "June 2017" "Puppet Labs, LLC" "Puppet manual"
|
5
5
|
.
|
6
6
|
.SH "NAME"
|
7
7
|
\fBpuppet\-generate\fR \- Generates Puppet code from Ruby definitions\.
|
data/man/man8/puppet-help.8
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
.\" generated with Ronn/v0.7.3
|
2
2
|
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
3
3
|
.
|
4
|
-
.TH "PUPPET\-HELP" "8" "
|
4
|
+
.TH "PUPPET\-HELP" "8" "June 2017" "Puppet Labs, LLC" "Puppet manual"
|
5
5
|
.
|
6
6
|
.SH "NAME"
|
7
7
|
\fBpuppet\-help\fR \- Display Puppet help\.
|
data/man/man8/puppet-key.8
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
.\" generated with Ronn/v0.7.3
|
2
2
|
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
3
3
|
.
|
4
|
-
.TH "PUPPET\-KEY" "8" "
|
4
|
+
.TH "PUPPET\-KEY" "8" "June 2017" "Puppet Labs, LLC" "Puppet manual"
|
5
5
|
.
|
6
6
|
.SH "NAME"
|
7
7
|
\fBpuppet\-key\fR \- Create, save, and remove certificate keys\.
|
data/man/man8/puppet-lookup.8
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
.\" generated with Ronn/v0.7.3
|
2
2
|
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
3
3
|
.
|
4
|
-
.TH "PUPPET\-LOOKUP" "8" "
|
4
|
+
.TH "PUPPET\-LOOKUP" "8" "June 2017" "Puppet Labs, LLC" "Puppet manual"
|
5
5
|
.
|
6
6
|
.SH "NAME"
|
7
7
|
\fBpuppet\-lookup\fR \- Interactive Hiera lookup
|
data/man/man8/puppet-man.8
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
.\" generated with Ronn/v0.7.3
|
2
2
|
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
3
3
|
.
|
4
|
-
.TH "PUPPET\-MAN" "8" "
|
4
|
+
.TH "PUPPET\-MAN" "8" "June 2017" "Puppet Labs, LLC" "Puppet manual"
|
5
5
|
.
|
6
6
|
.SH "NAME"
|
7
7
|
\fBpuppet\-man\fR \- Display Puppet manual pages\.
|
data/man/man8/puppet-master.8
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
.\" generated with Ronn/v0.7.3
|
2
2
|
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
3
3
|
.
|
4
|
-
.TH "PUPPET\-MASTER" "8" "
|
4
|
+
.TH "PUPPET\-MASTER" "8" "June 2017" "Puppet Labs, LLC" "Puppet manual"
|
5
5
|
.
|
6
6
|
.SH "NAME"
|
7
7
|
\fBpuppet\-master\fR \- The puppet master daemon
|
data/man/man8/puppet-module.8
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
.\" generated with Ronn/v0.7.3
|
2
2
|
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
3
3
|
.
|
4
|
-
.TH "PUPPET\-MODULE" "8" "
|
4
|
+
.TH "PUPPET\-MODULE" "8" "June 2017" "Puppet Labs, LLC" "Puppet manual"
|
5
5
|
.
|
6
6
|
.SH "NAME"
|
7
7
|
\fBpuppet\-module\fR \- Creates, installs and searches for modules on the Puppet Forge\.
|
@@ -32,16 +32,7 @@ Whether to log debug information\.
|
|
32
32
|
.
|
33
33
|
.TP
|
34
34
|
\-\-environment production
|
35
|
-
The environment
|
36
|
-
.
|
37
|
-
.IP
|
38
|
-
When defining an environment in the \fB[agent]\fR section, this refers to the environment that the agent requests from the master\. The environment doesn\'t have to exist on the local filesystem because the agent fetches it from the master\. This definition is used when running \fBpuppet agent\fR\.
|
39
|
-
.
|
40
|
-
.IP
|
41
|
-
When defined in the \fB[user]\fR section, the environment refers to the path that Puppet uses to search for code and modules related to its execution\. This requires the environment to exist locally on the filesystem where puppet is being executed\. Puppet subcommands, including \fBpuppet module\fR and \fBpuppet apply\fR, use this definition\.
|
42
|
-
.
|
43
|
-
.IP
|
44
|
-
Given that the context and effects vary depending on the config section \fIhttps://puppet\.com/docs/puppet/latest/config_file_main\.html#config\-sections\fR in which the \fBenvironment\fR setting is defined, do not set it globally\.
|
35
|
+
The environment Puppet is running in\. For clients (e\.g\., \fBpuppet agent\fR) this determines the environment itself, which is used to find modules and much more\. For servers (i\.e\., \fBpuppet master\fR) this provides the default environment for nodes we know nothing about\.
|
45
36
|
.
|
46
37
|
.TP
|
47
38
|
\-\-modulepath
|
data/man/man8/puppet-node.8
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
.\" generated with Ronn/v0.7.3
|
2
2
|
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
3
3
|
.
|
4
|
-
.TH "PUPPET\-NODE" "8" "
|
4
|
+
.TH "PUPPET\-NODE" "8" "June 2017" "Puppet Labs, LLC" "Puppet manual"
|
5
5
|
.
|
6
6
|
.SH "NAME"
|
7
7
|
\fBpuppet\-node\fR \- View and manage node definitions\.
|
data/man/man8/puppet-parser.8
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
.\" generated with Ronn/v0.7.3
|
2
2
|
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
3
3
|
.
|
4
|
-
.TH "PUPPET\-PARSER" "8" "
|
4
|
+
.TH "PUPPET\-PARSER" "8" "June 2017" "Puppet Labs, LLC" "Puppet manual"
|
5
5
|
.
|
6
6
|
.SH "NAME"
|
7
7
|
\fBpuppet\-parser\fR \- Interact directly with the parser\.
|
data/man/man8/puppet-plugin.8
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
.\" generated with Ronn/v0.7.3
|
2
2
|
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
3
3
|
.
|
4
|
-
.TH "PUPPET\-PLUGIN" "8" "
|
4
|
+
.TH "PUPPET\-PLUGIN" "8" "June 2017" "Puppet Labs, LLC" "Puppet manual"
|
5
5
|
.
|
6
6
|
.SH "NAME"
|
7
7
|
\fBpuppet\-plugin\fR \- Interact with the Puppet plugin system\.
|
data/man/man8/puppet-report.8
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
.\" generated with Ronn/v0.7.3
|
2
2
|
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
3
3
|
.
|
4
|
-
.TH "PUPPET\-REPORT" "8" "
|
4
|
+
.TH "PUPPET\-REPORT" "8" "June 2017" "Puppet Labs, LLC" "Puppet manual"
|
5
5
|
.
|
6
6
|
.SH "NAME"
|
7
7
|
\fBpuppet\-report\fR \- Create, display, and submit reports\.
|
data/man/man8/puppet-resource.8
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
.\" generated with Ronn/v0.7.3
|
2
2
|
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
3
3
|
.
|
4
|
-
.TH "PUPPET\-RESOURCE" "8" "
|
4
|
+
.TH "PUPPET\-RESOURCE" "8" "June 2017" "Puppet Labs, LLC" "Puppet manual"
|
5
5
|
.
|
6
6
|
.SH "NAME"
|
7
7
|
\fBpuppet\-resource\fR \- The resource abstraction layer shell
|
data/man/man8/puppet-status.8
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
.\" generated with Ronn/v0.7.3
|
2
2
|
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
3
3
|
.
|
4
|
-
.TH "PUPPET\-STATUS" "8" "
|
4
|
+
.TH "PUPPET\-STATUS" "8" "June 2017" "Puppet Labs, LLC" "Puppet manual"
|
5
5
|
.
|
6
6
|
.SH "NAME"
|
7
7
|
\fBpuppet\-status\fR \- View puppet server status\.
|
data/man/man8/puppet.8
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
.\" generated with Ronn/v0.7.3
|
2
2
|
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
3
3
|
.
|
4
|
-
.TH "PUPPET" "8" "
|
4
|
+
.TH "PUPPET" "8" "June 2017" "Puppet Labs, LLC" "Puppet manual"
|
5
5
|
.
|
6
6
|
.SH "NAME"
|
7
7
|
\fBpuppet\fR
|
@@ -16,4 +16,4 @@ Available subcommands:
|
|
16
16
|
agent The puppet agent daemon apply Apply Puppet manifests locally ca Local Puppet Certificate Authority management\. (Deprecated) catalog Compile, save, view, and convert catalogs\. cert Manage certificates and requests certificate Provide access to the CA for certificate management\. certificate_request Manage certificate requests\. (Deprecated) certificate_revocation_list Manage the list of revoked certificates\. (Deprecated) config Interact with Puppet\'s settings\. describe Display help about resource types device Manage remote network devices doc Generate Puppet references epp Interact directly with the EPP template parser/renderer\. facts Retrieve and store facts\. filebucket Store and retrieve files in a filebucket generate Generates Puppet code from Ruby definitions\. help Display Puppet help\. key Create, save, and remove certificate keys\. (Deprecated) lookup Interactive Hiera lookup man Display Puppet manual pages\. master The puppet master daemon module Creates, installs and searches for modules on the Puppet Forge\. node View and manage node definitions\. parser Interact directly with the parser\. plugin Interact with the Puppet plugin system\. report Create, display, and submit reports\. resource The resource abstraction layer shell status View puppet server status\. (Deprecated)
|
17
17
|
.
|
18
18
|
.P
|
19
|
-
See \'puppet help \fIsubcommand\fR \fIaction\fR\' for help on a specific subcommand action\. See \'puppet help \fIsubcommand\fR\' for help on a specific subcommand\. Puppet v5\.
|
19
|
+
See \'puppet help \fIsubcommand\fR \fIaction\fR\' for help on a specific subcommand action\. See \'puppet help \fIsubcommand\fR\' for help on a specific subcommand\. Puppet v5\.0\.0
|
@@ -90,27 +90,6 @@ describe 'lookup' do
|
|
90
90
|
expect(lookup('a')).to eql('value a')
|
91
91
|
end
|
92
92
|
|
93
|
-
context 'uses node_terminus' do
|
94
|
-
require 'puppet/indirector/node/exec'
|
95
|
-
require 'puppet/indirector/node/plain'
|
96
|
-
|
97
|
-
let(:node) { Puppet::Node.new('testnode', :environment => env) }
|
98
|
-
|
99
|
-
it ':plain without --compile' do
|
100
|
-
Puppet.settings[:node_terminus] = 'exec'
|
101
|
-
Puppet::Node::Plain.any_instance.expects(:find).returns(node)
|
102
|
-
Puppet::Node::Exec.any_instance.expects(:find).never
|
103
|
-
expect(lookup('a')).to eql('value a')
|
104
|
-
end
|
105
|
-
|
106
|
-
it 'configured in Puppet settings with --compile' do
|
107
|
-
Puppet.settings[:node_terminus] = 'exec'
|
108
|
-
Puppet::Node::Plain.any_instance.expects(:find).never
|
109
|
-
Puppet::Node::Exec.any_instance.expects(:find).returns(node)
|
110
|
-
expect(lookup('a', :compile => true)).to eql('value a')
|
111
|
-
end
|
112
|
-
end
|
113
|
-
|
114
93
|
context 'configured with the wrong environment' do
|
115
94
|
let(:env) { Puppet::Node::Environment.create(env_name.to_sym, [File.join(populated_env_dir, env_name, 'modules')]) }
|
116
95
|
it 'does not find data in non-existing environment' do
|
@@ -898,6 +898,24 @@ describe Puppet::Parser::Compiler do
|
|
898
898
|
end.to raise_error(/Class\[Foo\]: parameter 'x' expects an Integer value, got Undef/)
|
899
899
|
end
|
900
900
|
|
901
|
+
it 'denies a regexp (rich data) argument given to class String parameter (even if later encoding of it is a string)' do
|
902
|
+
expect do
|
903
|
+
catalog = compile_to_catalog(<<-MANIFEST)
|
904
|
+
class foo(String $x) { }
|
905
|
+
class { 'foo': x => /I am a regexp and I don't want to be a String/}
|
906
|
+
MANIFEST
|
907
|
+
end.to raise_error(/Class\[Foo\]: parameter 'x' expects a String value, got Regexp/)
|
908
|
+
end
|
909
|
+
|
910
|
+
it 'denies a regexp (rich data) argument given to define String parameter (even if later encoding of it is a string)' do
|
911
|
+
expect do
|
912
|
+
catalog = compile_to_catalog(<<-MANIFEST)
|
913
|
+
define foo(String $x) { }
|
914
|
+
foo { 'foo': x => /I am a regexp and I don't want to be a String/}
|
915
|
+
MANIFEST
|
916
|
+
end.to raise_error(/Foo\[foo\]: parameter 'x' expects a String value, got Regexp/)
|
917
|
+
end
|
918
|
+
|
901
919
|
it 'accepts a Resource as a Type' do
|
902
920
|
catalog = compile_to_catalog(<<-MANIFEST)
|
903
921
|
define bar($text) { }
|
@@ -0,0 +1,113 @@
|
|
1
|
+
require 'puppet'
|
2
|
+
require 'spec_helper'
|
3
|
+
require 'puppet_spec/compiler'
|
4
|
+
require 'matchers/resource'
|
5
|
+
require 'puppet/parser/script_compiler'
|
6
|
+
|
7
|
+
describe 'the script compiler' do
|
8
|
+
include PuppetSpec::Compiler
|
9
|
+
include PuppetSpec::Files
|
10
|
+
include Matchers::Resource
|
11
|
+
before(:each) do
|
12
|
+
Puppet[:tasks] = true
|
13
|
+
end
|
14
|
+
|
15
|
+
context "when used" do
|
16
|
+
let(:env_name) { 'testenv' }
|
17
|
+
let(:environments_dir) { Puppet[:environmentpath] }
|
18
|
+
let(:env_dir) { File.join(environments_dir, env_name) }
|
19
|
+
let(:manifest) { Puppet::Node::Environment::NO_MANIFEST }
|
20
|
+
let(:env) { Puppet::Node::Environment.create(env_name.to_sym, [File.join(populated_env_dir, 'modules')], manifest) }
|
21
|
+
let(:node) { Puppet::Node.new("test", :environment => env) }
|
22
|
+
|
23
|
+
let(:env_dir_files) {
|
24
|
+
{
|
25
|
+
'manifests' => {
|
26
|
+
'good.pp' => "'good'\n"
|
27
|
+
},
|
28
|
+
'modules' => {
|
29
|
+
'test' => {
|
30
|
+
'plans' => {
|
31
|
+
'run_me.pp' => 'plan test::run_me() { "worked2" }'
|
32
|
+
}
|
33
|
+
}
|
34
|
+
}
|
35
|
+
}
|
36
|
+
}
|
37
|
+
|
38
|
+
let(:populated_env_dir) do
|
39
|
+
dir_contained_in(environments_dir, env_name => env_dir_files)
|
40
|
+
PuppetSpec::Files.record_tmp(env_dir)
|
41
|
+
env_dir
|
42
|
+
end
|
43
|
+
|
44
|
+
let(:script_compiler) do
|
45
|
+
Puppet::Parser::ScriptCompiler.new(env, node.name)
|
46
|
+
end
|
47
|
+
|
48
|
+
context 'is configured such that' do
|
49
|
+
it 'returns what the script_compiler returns' do
|
50
|
+
Puppet[:code] = <<-CODE
|
51
|
+
42
|
52
|
+
CODE
|
53
|
+
expect(script_compiler.compile).to eql(42)
|
54
|
+
end
|
55
|
+
|
56
|
+
it 'referencing undefined variables raises an error' do
|
57
|
+
expect do
|
58
|
+
Puppet[:code] = <<-CODE
|
59
|
+
notice $rubyversion
|
60
|
+
CODE
|
61
|
+
Puppet::Parser::ScriptCompiler.new(env, 'test_node_name').compile
|
62
|
+
|
63
|
+
end.to raise_error(/Unknown variable: 'rubyversion'/)
|
64
|
+
end
|
65
|
+
|
66
|
+
it 'has strict=error behavior' do
|
67
|
+
expect do
|
68
|
+
Puppet[:code] = <<-CODE
|
69
|
+
notice({a => 10, a => 20})
|
70
|
+
CODE
|
71
|
+
Puppet::Parser::ScriptCompiler.new(env, 'test_node_name').compile
|
72
|
+
|
73
|
+
end.to raise_error(/The key 'a' is declared more than once/)
|
74
|
+
end
|
75
|
+
|
76
|
+
it 'performing a multi assign from a class reference raises an error' do
|
77
|
+
expect do
|
78
|
+
Puppet[:code] = <<-CODE
|
79
|
+
[$a] = Class[the_dalit]
|
80
|
+
CODE
|
81
|
+
Puppet::Parser::ScriptCompiler.new(env, 'test_node_name').compile
|
82
|
+
|
83
|
+
end.to raise_error(/The catalog operation 'multi var assignment from class' is only available when compiling a catalog/)
|
84
|
+
end
|
85
|
+
end
|
86
|
+
|
87
|
+
context 'when using environment manifest' do
|
88
|
+
context 'set to single file' do
|
89
|
+
let (:manifest) { "#{env_dir}/manifests/good.pp" }
|
90
|
+
|
91
|
+
it 'loads and evaluates' do
|
92
|
+
expect(script_compiler.compile).to eql('good')
|
93
|
+
end
|
94
|
+
end
|
95
|
+
|
96
|
+
context 'set to directory' do
|
97
|
+
let (:manifest) { "#{env_dir}/manifests" }
|
98
|
+
|
99
|
+
it 'fails with an error' do
|
100
|
+
expect{script_compiler.compile}.to raise_error(/manifest of environment 'testenv' appoints directory '.*\/manifests'. It must be a file/)
|
101
|
+
end
|
102
|
+
end
|
103
|
+
|
104
|
+
context 'set to non existing path' do
|
105
|
+
let (:manifest) { "#{env_dir}/manyfiests/good.pp" }
|
106
|
+
|
107
|
+
it 'fails with an error' do
|
108
|
+
expect{script_compiler.compile}.to raise_error(/manifest of environment 'testenv' appoints '.*\/good.pp'. It does not exist/)
|
109
|
+
end
|
110
|
+
end
|
111
|
+
end
|
112
|
+
end
|
113
|
+
end
|
@@ -19,12 +19,14 @@ describe "mount provider (integration)", :unless => Puppet.features.microsoft_wi
|
|
19
19
|
@fake_fstab = tmpfile('fstab')
|
20
20
|
@current_options = "local"
|
21
21
|
@current_device = "/dev/disk1s1"
|
22
|
+
Puppet[:digest_algorithm] = 'md5'
|
22
23
|
Puppet::Type.type(:mount).defaultprovider.stubs(:default_target).returns(@fake_fstab)
|
23
24
|
Facter.stubs(:value).with(:hostname).returns('some_host')
|
24
25
|
Facter.stubs(:value).with(:domain).returns('some_domain')
|
25
26
|
Facter.stubs(:value).with(:kernel).returns('Linux')
|
26
27
|
Facter.stubs(:value).with(:operatingsystem).returns('RedHat')
|
27
28
|
Facter.stubs(:value).with(:osfamily).returns('RedHat')
|
29
|
+
Facter.stubs(:value).with(:fips_enabled).returns(false)
|
28
30
|
Puppet::Util::ExecutionStub.set do |command, options|
|
29
31
|
case command[0]
|
30
32
|
when %r{/s?bin/mount}
|
@@ -479,7 +479,11 @@ describe Puppet::Type.type(:file), :uses_checksums => true do
|
|
479
479
|
|
480
480
|
describe "when writing files" do
|
481
481
|
shared_examples "files are backed up" do |resource_options|
|
482
|
-
it "should backup files to a filebucket when one is configured" do
|
482
|
+
it "should backup files to a filebucket when one is configured" do |example|
|
483
|
+
if Puppet::Util::Platform.windows? && ['sha512', 'sha384'].include?(example.metadata[:digest_algorithm])
|
484
|
+
skip "PUP-8257: Skip file bucket test on windows for #{example.metadata[:digest_algorithm]} due to long path names"
|
485
|
+
end
|
486
|
+
|
483
487
|
filebucket = Puppet::Type.type(:filebucket).new :path => tmpfile("filebucket"), :name => "mybucket"
|
484
488
|
file = described_class.new({:path => path, :backup => "mybucket", :content => "foo"}.merge(resource_options))
|
485
489
|
catalog.add_resource file
|
@@ -562,7 +566,11 @@ describe Puppet::Type.type(:file), :uses_checksums => true do
|
|
562
566
|
expect(File.read(File.join(backup, "foo"))).to eq("yay")
|
563
567
|
end
|
564
568
|
|
565
|
-
it "should backup directories to filebuckets by backing up each file separately" do
|
569
|
+
it "should backup directories to filebuckets by backing up each file separately" do |example|
|
570
|
+
if Puppet::Util::Platform.windows? && ['sha512', 'sha384'].include?(example.metadata[:digest_algorithm])
|
571
|
+
skip "PUP-8257: Skip file bucket test on windows for #{example.metadata[:digest_algorithm]} due to long path names"
|
572
|
+
end
|
573
|
+
|
566
574
|
bucket = Puppet::Type.type(:filebucket).new :path => tmpfile("filebucket"), :name => "mybucket"
|
567
575
|
file = described_class.new({:path => tmpfile("bucket_backs"), :backup => "mybucket", :content => "foo", :force => true}.merge(resource_options))
|
568
576
|
catalog.add_resource file
|
@@ -1816,7 +1824,7 @@ describe Puppet::Type.type(:file), :uses_checksums => true do
|
|
1816
1824
|
end
|
1817
1825
|
end
|
1818
1826
|
|
1819
|
-
[:md5, :sha256, :md5lite, :sha256lite].each do |checksum|
|
1827
|
+
[:md5, :sha256, :md5lite, :sha256lite, :sha384, :sha512, :sha224].each do |checksum|
|
1820
1828
|
describe "setting checksum_value explicitly with checksum #{checksum}" do
|
1821
1829
|
let(:path) { tmpfile('target') }
|
1822
1830
|
let(:contents) { 'yay' }
|