puppet 5.3.7-universal-darwin → 5.4.0-universal-darwin
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 +218 -180
- 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
@@ -15,19 +15,25 @@ class Checker4_0 < Evaluator::LiteralEvaluator
|
|
15
15
|
attr_reader :acceptor
|
16
16
|
attr_reader :migration_checker
|
17
17
|
|
18
|
+
def self.check_visitor
|
19
|
+
# Class instance variable rather than Class variable because methods visited
|
20
|
+
# may be overridden in subclass
|
21
|
+
@check_visitor ||= Visitor.new(nil, 'check', 0, 0)
|
22
|
+
end
|
23
|
+
|
18
24
|
# Initializes the validator with a diagnostics producer. This object must respond to
|
19
25
|
# `:will_accept?` and `:accept`.
|
20
26
|
#
|
21
27
|
def initialize(diagnostics_producer)
|
22
28
|
super()
|
23
|
-
@@check_visitor ||= Visitor.new(nil, "check", 0, 0)
|
24
29
|
@@rvalue_visitor ||= Visitor.new(nil, "rvalue", 0, 0)
|
25
30
|
@@hostname_visitor ||= Visitor.new(nil, "hostname", 1, 2)
|
26
31
|
@@assignment_visitor ||= Visitor.new(nil, "assign", 0, 1)
|
27
32
|
@@query_visitor ||= Visitor.new(nil, "query", 0, 0)
|
28
33
|
@@relation_visitor ||= Visitor.new(nil, "relation", 0, 0)
|
29
|
-
@@idem_visitor ||= Visitor.new(
|
34
|
+
@@idem_visitor ||= Visitor.new(nil, "idem", 0, 0)
|
30
35
|
|
36
|
+
@check_visitor = self.class.check_visitor
|
31
37
|
@acceptor = diagnostics_producer
|
32
38
|
|
33
39
|
# Use null migration checker unless given in context
|
@@ -51,7 +57,7 @@ class Checker4_0 < Evaluator::LiteralEvaluator
|
|
51
57
|
|
52
58
|
# Performs regular validity check
|
53
59
|
def check(o)
|
54
|
-
|
60
|
+
@check_visitor.visit_this_0(self, o)
|
55
61
|
end
|
56
62
|
|
57
63
|
# Performs check if this is a vaid hostname expression
|
@@ -380,9 +386,7 @@ class Checker4_0 < Evaluator::LiteralEvaluator
|
|
380
386
|
}
|
381
387
|
|
382
388
|
FUTURE_RESERVED_WORDS = {
|
383
|
-
'
|
384
|
-
'produces' => true,
|
385
|
-
'consumes' => true
|
389
|
+
'plan' => true
|
386
390
|
}
|
387
391
|
|
388
392
|
# for 'class', 'define', and function
|
@@ -0,0 +1,60 @@
|
|
1
|
+
module Puppet::Pops
|
2
|
+
module Validation
|
3
|
+
|
4
|
+
# Validator that limits the set of allowed expressions to not include catalog related operations
|
5
|
+
# @api private
|
6
|
+
class TasksChecker < Checker4_0
|
7
|
+
def check_Application(o)
|
8
|
+
illegalTasksExpression(o)
|
9
|
+
end
|
10
|
+
|
11
|
+
def check_CapabilityMapping(o)
|
12
|
+
illegalTasksExpression(o)
|
13
|
+
end
|
14
|
+
|
15
|
+
def check_CollectExpression(o)
|
16
|
+
illegalTasksExpression(o)
|
17
|
+
end
|
18
|
+
|
19
|
+
def check_HostClassDefinition(o)
|
20
|
+
illegalTasksExpression(o)
|
21
|
+
end
|
22
|
+
|
23
|
+
def check_NodeDefinition(o)
|
24
|
+
illegalTasksExpression(o)
|
25
|
+
end
|
26
|
+
|
27
|
+
def check_RelationshipExpression(o)
|
28
|
+
illegalTasksExpression(o)
|
29
|
+
end
|
30
|
+
|
31
|
+
def check_ResourceDefaultsExpression(o)
|
32
|
+
illegalTasksExpression(o)
|
33
|
+
end
|
34
|
+
|
35
|
+
def check_ResourceExpression(o)
|
36
|
+
illegalTasksExpression(o)
|
37
|
+
end
|
38
|
+
|
39
|
+
def check_ResourceOverrideExpression(o)
|
40
|
+
illegalTasksExpression(o)
|
41
|
+
end
|
42
|
+
|
43
|
+
def check_ResourceTypeDefinition(o)
|
44
|
+
illegalTasksExpression(o)
|
45
|
+
end
|
46
|
+
|
47
|
+
def check_SiteDefinition(o)
|
48
|
+
illegalTasksExpression(o)
|
49
|
+
end
|
50
|
+
|
51
|
+
def illegalTasksExpression(o)
|
52
|
+
acceptor.accept(Issues::CATALOG_OPERATION_NOT_SUPPORTED_WHEN_SCRIPTING, o)
|
53
|
+
end
|
54
|
+
|
55
|
+
def resource_without_title?(o)
|
56
|
+
false
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
@@ -7,7 +7,12 @@ class ValidatorFactory_4_0 < Factory
|
|
7
7
|
|
8
8
|
# Produces the checker to use
|
9
9
|
def checker diagnostic_producer
|
10
|
-
|
10
|
+
if Puppet[:tasks]
|
11
|
+
require_relative 'tasks_checker'
|
12
|
+
TasksChecker.new(diagnostic_producer)
|
13
|
+
else
|
14
|
+
Checker4_0.new(diagnostic_producer)
|
15
|
+
end
|
11
16
|
end
|
12
17
|
|
13
18
|
# Produces the label provider to use
|
data/lib/puppet/property.rb
CHANGED
@@ -365,7 +365,7 @@ class Puppet::Property < Puppet::Parameter
|
|
365
365
|
begin
|
366
366
|
@should = should
|
367
367
|
insync?(is)
|
368
|
-
rescue
|
368
|
+
rescue
|
369
369
|
# Certain operations may fail, but we don't want to fail the transaction if we can
|
370
370
|
# avoid it
|
371
371
|
#TRANSLATORS 'insync_values?' should not be translated
|
data/lib/puppet/provider.rb
CHANGED
@@ -290,16 +290,26 @@ class Puppet::Provider
|
|
290
290
|
end
|
291
291
|
end
|
292
292
|
|
293
|
+
# Compare a fact value against one or more supplied value
|
294
|
+
# @param [Symbol] fact a fact to query to match against one of the given values
|
295
|
+
# @param [Array, Regexp, String] values one or more values to compare to the
|
296
|
+
# value of the given fact
|
297
|
+
# @return [Boolean] whether or not the fact value matches one of the supplied
|
298
|
+
# values. Given one or more Regexp instances, fact is compared via the basic
|
299
|
+
# pattern-matching operator.
|
293
300
|
def self.fact_match(fact, values)
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
if fval = Facter.value(fact).to_s and fval != ""
|
298
|
-
fval = fval.to_s.downcase.intern
|
299
|
-
|
300
|
-
values.include?(fval)
|
301
|
+
fact_val = Facter.value(fact).to_s.downcase
|
302
|
+
if fact_val.empty?
|
303
|
+
return false
|
301
304
|
else
|
302
|
-
|
305
|
+
values = [values] unless values.is_a?(Array)
|
306
|
+
values.any? do |value|
|
307
|
+
if value.is_a?(Regexp)
|
308
|
+
fact_val =~ value
|
309
|
+
else
|
310
|
+
fact_val.intern == value.to_s.downcase.intern
|
311
|
+
end
|
312
|
+
end
|
303
313
|
end
|
304
314
|
end
|
305
315
|
|
@@ -168,7 +168,6 @@ Puppet::Type.type(:augeas).provide(:augeas) do
|
|
168
168
|
glob_avail = !aug.match("/augeas/version/pathx/functions/glob").empty?
|
169
169
|
opt_ctx = resource[:context].match("^/files/[^'\"\\[\\]]+$") if resource[:context]
|
170
170
|
|
171
|
-
restricted = false
|
172
171
|
if resource[:incl]
|
173
172
|
aug.set("/augeas/load/Xfm/lens", resource[:lens])
|
174
173
|
aug.set("/augeas/load/Xfm/incl", resource[:incl])
|
@@ -220,7 +219,7 @@ Puppet::Type.type(:augeas).provide(:augeas) do
|
|
220
219
|
|
221
220
|
#validate and tear apart the command
|
222
221
|
fail (_("Invalid command: %{cmd}") % { cmd: cmd_array.join(" ") }) if cmd_array.length < 4
|
223
|
-
|
222
|
+
_ = cmd_array.shift
|
224
223
|
path = cmd_array.shift
|
225
224
|
comparator = cmd_array.shift
|
226
225
|
arg = cmd_array.join(" ")
|
@@ -251,7 +250,7 @@ Puppet::Type.type(:augeas).provide(:augeas) do
|
|
251
250
|
|
252
251
|
#validate and tear apart the command
|
253
252
|
fail(_("Invalid command: %{cmd}") % { cmd: cmd_array.join(" ") }) if cmd_array.length < 3
|
254
|
-
|
253
|
+
_ = cmd_array.shift
|
255
254
|
path = cmd_array.shift
|
256
255
|
|
257
256
|
# Need to break apart the clause
|
@@ -299,7 +298,7 @@ Puppet::Type.type(:augeas).provide(:augeas) do
|
|
299
298
|
|
300
299
|
#validate and tear apart the command
|
301
300
|
fail(_("Invalid command: %{cmd}") % { cmd: cmd_array.join(" ") }) if cmd_array.length < 3
|
302
|
-
|
301
|
+
_ = cmd_array.shift
|
303
302
|
path = cmd_array.shift
|
304
303
|
|
305
304
|
# Need to break apart the clause
|
data/lib/puppet/provider/exec.rb
CHANGED
@@ -14,7 +14,8 @@ Puppet::Type.type(:group).provide :groupadd, :parent => Puppet::Provider::NameSe
|
|
14
14
|
value.is_a? Integer
|
15
15
|
end
|
16
16
|
|
17
|
-
optional_commands :localadd => "lgroupadd"
|
17
|
+
optional_commands :localadd => "lgroupadd", :localdelete => "lgroupdel", :localmodify => "lgroupmod"
|
18
|
+
|
18
19
|
has_feature :libuser if Puppet.features.libuser?
|
19
20
|
|
20
21
|
def exists?
|
@@ -82,4 +83,27 @@ Puppet::Type.type(:group).provide :groupadd, :parent => Puppet::Provider::NameSe
|
|
82
83
|
cmd << @resource[:name]
|
83
84
|
cmd
|
84
85
|
end
|
86
|
+
|
87
|
+
def modifycmd(param, value)
|
88
|
+
if @resource.forcelocal?
|
89
|
+
cmd = [command(:localmodify)]
|
90
|
+
@custom_environment = Puppet::Util::Libuser.getenv
|
91
|
+
else
|
92
|
+
cmd = [command(:modify)]
|
93
|
+
end
|
94
|
+
cmd << flag(param) << value
|
95
|
+
cmd += check_allow_dup
|
96
|
+
cmd << @resource[:name]
|
97
|
+
|
98
|
+
cmd
|
99
|
+
end
|
100
|
+
|
101
|
+
def deletecmd
|
102
|
+
if @resource.forcelocal?
|
103
|
+
@custom_environment = Puppet::Util::Libuser.getenv
|
104
|
+
[command(:localdelete), @resource[:name]]
|
105
|
+
else
|
106
|
+
[command(:delete), @resource[:name]]
|
107
|
+
end
|
108
|
+
end
|
85
109
|
end
|
@@ -23,9 +23,12 @@ Puppet::Type.type(:group).provide :windows_adsi do
|
|
23
23
|
# Cannot use munge of the group property to canonicalize @should
|
24
24
|
# since the default array_matching comparison is not commutative
|
25
25
|
|
26
|
-
current_sids = current.map(&:sid)
|
27
26
|
# dupes automatically weeded out when hashes built
|
28
|
-
|
27
|
+
current_users = Puppet::Util::Windows::ADSI::Group.name_sid_hash(current)
|
28
|
+
specified_users = Puppet::Util::Windows::ADSI::Group.name_sid_hash(should)
|
29
|
+
|
30
|
+
current_sids = current_users.keys.to_a
|
31
|
+
specified_sids = specified_users.keys.to_a
|
29
32
|
|
30
33
|
if @resource[:auth_membership]
|
31
34
|
current_sids.sort == specified_sids.sort
|
@@ -37,7 +40,7 @@ Puppet::Type.type(:group).provide :windows_adsi do
|
|
37
40
|
def members_to_s(users)
|
38
41
|
return '' if users.nil? or !users.kind_of?(Array)
|
39
42
|
users = users.map do |user_name|
|
40
|
-
sid = Puppet::Util::Windows::SID.
|
43
|
+
sid = Puppet::Util::Windows::SID.name_to_sid_object(user_name)
|
41
44
|
if !sid
|
42
45
|
resource.debug("#{user_name} (unresolvable to SID)")
|
43
46
|
next user_name
|
@@ -55,7 +58,7 @@ Puppet::Type.type(:group).provide :windows_adsi do
|
|
55
58
|
end
|
56
59
|
|
57
60
|
def member_valid?(user_name)
|
58
|
-
! Puppet::Util::Windows::SID.
|
61
|
+
! Puppet::Util::Windows::SID.name_to_sid_object(user_name).nil?
|
59
62
|
end
|
60
63
|
|
61
64
|
def group
|
@@ -26,21 +26,38 @@ module Puppet::Provider::Mount
|
|
26
26
|
def remount
|
27
27
|
#TRANSLATORS refers to remounting a file system
|
28
28
|
info _("Remounting")
|
29
|
-
|
29
|
+
os = Facter.value(:operatingsystem)
|
30
|
+
supports_remounts = (resource[:remounts] == :true)
|
31
|
+
if supports_remounts && os == 'AIX'
|
32
|
+
remount_with_option("remount")
|
33
|
+
elsif os.match(/^(FreeBSD|DragonFly|OpenBSD)$/)
|
34
|
+
remount_with_option("update")
|
35
|
+
elsif supports_remounts
|
30
36
|
mountcmd "-o", "remount", resource[:name]
|
31
|
-
elsif ["FreeBSD", "DragonFly", "OpenBSD"].include?(Facter.value(:operatingsystem))
|
32
|
-
if self.options && !self.options.empty?
|
33
|
-
options = self.options + ",update"
|
34
|
-
else
|
35
|
-
options = "update"
|
36
|
-
end
|
37
|
-
mountcmd "-o", options, resource[:name]
|
38
37
|
else
|
39
38
|
unmount
|
40
39
|
mount
|
41
40
|
end
|
42
41
|
end
|
43
42
|
|
43
|
+
# Remount by appending the supplied param "option" to any existing explicitly
|
44
|
+
# defined options. If resource has no explicitly defined options, will mount
|
45
|
+
# with only "option".
|
46
|
+
# @param [String] option A remount option to use or append with existing options
|
47
|
+
#
|
48
|
+
def remount_with_option(option)
|
49
|
+
if using_explicit_options?
|
50
|
+
options = self.options + "," + option
|
51
|
+
else
|
52
|
+
options = option
|
53
|
+
end
|
54
|
+
mountcmd "-o", options, resource[:name]
|
55
|
+
end
|
56
|
+
|
57
|
+
def using_explicit_options?
|
58
|
+
!self.options.nil? && !self.options.empty?
|
59
|
+
end
|
60
|
+
|
44
61
|
# This only works when the mount point is synced to the fstab.
|
45
62
|
def unmount
|
46
63
|
umount(resource[:name])
|
@@ -174,7 +174,7 @@ class Puppet::Provider::NameService < Puppet::Provider
|
|
174
174
|
begin
|
175
175
|
execute(self.addcmd, {:failonfail => true, :combine => true, :custom_environment => @custom_environment})
|
176
176
|
if feature?(:manages_password_age) && (cmd = passcmd)
|
177
|
-
execute(cmd)
|
177
|
+
execute(cmd, { :custom_environment => @custom_environment })
|
178
178
|
end
|
179
179
|
rescue Puppet::ExecutionFailure => detail
|
180
180
|
raise Puppet::Error, _("Could not create %{resource} %{name}: %{detail}") % { resource: @resource.class.name, name: @resource.name, detail: detail }, detail.backtrace
|
@@ -189,7 +189,7 @@ class Puppet::Provider::NameService < Puppet::Provider
|
|
189
189
|
end
|
190
190
|
|
191
191
|
begin
|
192
|
-
execute(self.deletecmd)
|
192
|
+
execute(self.deletecmd, { :custom_environment => @custom_environment })
|
193
193
|
rescue Puppet::ExecutionFailure => detail
|
194
194
|
raise Puppet::Error, _("Could not delete %{resource} %{name}: %{detail}") % { resource: @resource.class.name, name: @resource.name, detail: detail }, detail.backtrace
|
195
195
|
end
|
@@ -266,7 +266,12 @@ class Puppet::Provider::NameService < Puppet::Provider
|
|
266
266
|
# reading of the file.
|
267
267
|
Puppet::Etc.endgrent
|
268
268
|
|
269
|
-
groups.
|
269
|
+
uniq_groups = groups.uniq
|
270
|
+
if groups != uniq_groups
|
271
|
+
debug("Removing any duplicate group entries")
|
272
|
+
end
|
273
|
+
# remove any double listed groups
|
274
|
+
uniq_groups.join(",")
|
270
275
|
end
|
271
276
|
|
272
277
|
# Convert the Etc struct into a hash.
|
@@ -296,7 +301,7 @@ class Puppet::Provider::NameService < Puppet::Provider
|
|
296
301
|
cmd = modifycmd(param, munge(param, value))
|
297
302
|
raise Puppet::DevError, _("Nameservice command must be an array") unless cmd.is_a?(Array)
|
298
303
|
begin
|
299
|
-
execute(cmd)
|
304
|
+
execute(cmd, { :custom_environment => @custom_environment })
|
300
305
|
rescue Puppet::ExecutionFailure => detail
|
301
306
|
raise Puppet::Error, _("Could not set %{param} on %{resource}[%{name}]: %{detail}") % { param: param, resource: @resource.class.name, name: @resource.name, detail: detail }, detail.backtrace
|
302
307
|
end
|
@@ -402,10 +402,10 @@ class Puppet::Provider::NameService::DirectoryService < Puppet::Provider::NameSe
|
|
402
402
|
next if property == :ensure
|
403
403
|
value = @resource.should(property)
|
404
404
|
if property == :gid and value.nil?
|
405
|
-
value = self.class.next_system_id(
|
405
|
+
value = self.class.next_system_id('gid')
|
406
406
|
end
|
407
407
|
if property == :uid and value.nil?
|
408
|
-
value = self.class.next_system_id(
|
408
|
+
value = self.class.next_system_id('uid')
|
409
409
|
end
|
410
410
|
if value != "" and not value.nil?
|
411
411
|
if property == :members
|
@@ -431,7 +431,7 @@ class Puppet::Provider::NameService::DirectoryService < Puppet::Provider::NameSe
|
|
431
431
|
cmd = [:dseditgroup, "-o", "edit", "-n", ".", "-d", member, @resource[:name]]
|
432
432
|
begin
|
433
433
|
execute(cmd)
|
434
|
-
rescue Puppet::ExecutionFailure
|
434
|
+
rescue Puppet::ExecutionFailure
|
435
435
|
# TODO: We're falling back to removing the member using dscl due to rdar://8481241
|
436
436
|
# This bug causes dseditgroup to fail to remove a member if that member doesn't exist
|
437
437
|
cmd = [:dscl, ".", "-delete", "/Groups/#{@resource.name}", "GroupMembership", member]
|
@@ -1,33 +1,22 @@
|
|
1
1
|
require 'puppet/provider/nameservice'
|
2
2
|
|
3
3
|
class Puppet::Provider::NameService
|
4
|
-
class ObjectAdd < Puppet::Provider::NameService
|
5
|
-
|
6
|
-
|
7
|
-
end
|
8
|
-
|
9
|
-
# Determine the flag to pass to our command.
|
10
|
-
def flag(name)
|
11
|
-
name = name.intern if name.is_a? String
|
12
|
-
self.class.option(name, :flag) || "-" + name.to_s[0,1]
|
13
|
-
end
|
14
|
-
|
15
|
-
def modifycmd(param, value)
|
16
|
-
cmd = [command(param.to_s =~ /password_.+_age/ ? :password : :modify)]
|
17
|
-
cmd << flag(param) << value
|
18
|
-
if @resource.allowdupe? && ((param == :uid) || (param == :gid and self.class.name == :groupadd))
|
19
|
-
cmd << "-o"
|
4
|
+
class ObjectAdd < Puppet::Provider::NameService
|
5
|
+
def deletecmd
|
6
|
+
[command(:delete), @resource[:name]]
|
20
7
|
end
|
21
|
-
cmd << @resource[:name]
|
22
8
|
|
23
|
-
|
24
|
-
|
9
|
+
# Determine the flag to pass to our command.
|
10
|
+
def flag(name)
|
11
|
+
name = name.intern if name.is_a? String
|
12
|
+
self.class.option(name, :flag) || "-" + name.to_s[0, 1]
|
13
|
+
end
|
25
14
|
|
26
|
-
|
27
|
-
|
28
|
-
|
15
|
+
def posixmethod(name)
|
16
|
+
name = name.intern if name.is_a? String
|
17
|
+
method = self.class.option(name, :method) || name
|
29
18
|
|
30
|
-
|
19
|
+
method
|
20
|
+
end
|
31
21
|
end
|
32
22
|
end
|
33
|
-
end
|
@@ -1,21 +1,21 @@
|
|
1
1
|
require 'puppet/provider/nameservice/objectadd'
|
2
2
|
|
3
3
|
class Puppet::Provider::NameService
|
4
|
-
class PW < ObjectAdd
|
5
|
-
|
6
|
-
|
7
|
-
|
4
|
+
class PW < ObjectAdd
|
5
|
+
def deletecmd
|
6
|
+
[command(:pw), "#{@resource.class.name.to_s}del", @resource[:name]]
|
7
|
+
end
|
8
8
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
9
|
+
def modifycmd(param, value)
|
10
|
+
cmd = [
|
11
|
+
command(:pw),
|
12
|
+
"#{@resource.class.name.to_s}mod",
|
13
|
+
@resource[:name],
|
14
|
+
flag(param),
|
15
|
+
munge(param, value)
|
16
|
+
]
|
17
|
+
cmd
|
18
|
+
end
|
18
19
|
end
|
19
20
|
end
|
20
|
-
end
|
21
21
|
|