puppet 5.3.7-x64-mingw32 → 5.4.0-x64-mingw32
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of puppet might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/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
@@ -8,7 +8,7 @@ Puppet::Type.type(:package).provide :gem, :parent => Puppet::Provider::Package d
|
|
8
8
|
specified source is used, also pass `--clear-sources` via `install_options`.
|
9
9
|
If source is present but is not a valid URL, it will be interpreted as the
|
10
10
|
path to a local gem file. If source is not present, the gem will be
|
11
|
-
installed from the default gem repositories.
|
11
|
+
installed from the default gem repositories. Note that to modify this for Windows, it has to be a valid URL.
|
12
12
|
|
13
13
|
This provider supports the `install_options` and `uninstall_options` attributes,
|
14
14
|
which allow command-line flags to be passed to the gem command.
|
@@ -31,7 +31,7 @@ Puppet::Type.type(:package).provide :gem, :parent => Puppet::Provider::Package d
|
|
31
31
|
gem_list_command << "--source" << options[:source]
|
32
32
|
end
|
33
33
|
if name = options[:justme]
|
34
|
-
gem_list_command <<
|
34
|
+
gem_list_command << '\A' + name + '\z'
|
35
35
|
end
|
36
36
|
|
37
37
|
begin
|
@@ -61,9 +61,9 @@ Puppet::Type.type(:package).provide :macports, :parent => Puppet::Provider::Pack
|
|
61
61
|
def install
|
62
62
|
should = @resource.should(:ensure)
|
63
63
|
if [:latest, :installed, :present].include?(should)
|
64
|
-
|
64
|
+
port("-q", :install, @resource[:name])
|
65
65
|
else
|
66
|
-
|
66
|
+
port("-q", :install, @resource[:name], "@#{should}")
|
67
67
|
end
|
68
68
|
# MacPorts now correctly exits non-zero with appropriate errors in
|
69
69
|
# situations where a port cannot be found or installed.
|
@@ -174,6 +174,9 @@ Puppet::Type.type(:package).provide :pkg, :parent => Puppet::Provider::Package d
|
|
174
174
|
# http://defect.opensolaris.org/bz/show_bug.cgi?id=19159%
|
175
175
|
# notes that we can't use -Ha for the same even though the manual page reads that way.
|
176
176
|
def latest
|
177
|
+
# Refresh package metadata before looking for latest versions
|
178
|
+
pkg(:refresh)
|
179
|
+
|
177
180
|
lines = pkg(:list, "-Hvn", @resource[:name]).split("\n")
|
178
181
|
|
179
182
|
# remove certificate expiration warnings from the output, but report them
|
@@ -140,7 +140,6 @@ Puppet::Type.type(:package).provide :pkgdmg, :parent => Puppet::Provider::Packag
|
|
140
140
|
end
|
141
141
|
|
142
142
|
def install
|
143
|
-
source = nil
|
144
143
|
unless source = @resource[:source]
|
145
144
|
raise Puppet::Error.new(_("Mac OS X PKG DMGs must specify a package source."))
|
146
145
|
end
|
@@ -109,7 +109,6 @@ Puppet::Type.type(:package).provide :portage, :parent => Puppet::Provider::Packa
|
|
109
109
|
result_format = self.qatom_result_format
|
110
110
|
result_fields = self.qatom_result_fields
|
111
111
|
@atom ||= begin
|
112
|
-
search_output = nil
|
113
112
|
package_info = {}
|
114
113
|
# do the search
|
115
114
|
search_output = qatom_bin *([@resource[:name], '--format', output_format])
|
@@ -145,7 +145,7 @@ Puppet::Type.type(:package).provide :yum, :parent => :rpm, :source => :rpm do
|
|
145
145
|
# Quote the DNF docs:
|
146
146
|
# "Yum does this if its obsoletes config option is enabled but
|
147
147
|
# the behavior is not properly documented and can be harmful."
|
148
|
-
# So we'll stick with the
|
148
|
+
# So we'll stick with the safer option
|
149
149
|
# If a user wants to remove obsoletes, they can use { :install_options => '--obsoletes' }
|
150
150
|
# More detail here: https://bugzilla.redhat.com/show_bug.cgi?id=1096506
|
151
151
|
'update'
|
@@ -175,17 +175,32 @@ Puppet::Type.type(:package).provide :yum, :parent => :rpm, :source => :rpm do
|
|
175
175
|
operation = :install
|
176
176
|
end
|
177
177
|
should = nil
|
178
|
-
when true,
|
178
|
+
when true, :present, :installed
|
179
|
+
# if we have been given a source and we were not asked for a specific
|
180
|
+
# version feed it to yum directly
|
181
|
+
if @resource[:source]
|
182
|
+
wanted = @resource[:source]
|
183
|
+
self.debug "Installing directly from #{wanted}"
|
184
|
+
end
|
185
|
+
should = nil
|
186
|
+
when false,:absent
|
179
187
|
# pass
|
180
188
|
should = nil
|
181
189
|
else
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
wanted
|
190
|
+
if @resource[:source]
|
191
|
+
# An explicit source was supplied, which means we're ensuring a specific
|
192
|
+
# version, and also supplying the path to a package that supplies that
|
193
|
+
# version.
|
194
|
+
wanted = @resource[:source]
|
195
|
+
self.debug "Installing directly from #{wanted}"
|
196
|
+
else
|
197
|
+
# No explicit source was specified, so add the package version
|
198
|
+
wanted += "-#{should}"
|
199
|
+
if wanted.scan(ARCH_REGEX)
|
200
|
+
self.debug "Detected Arch argument in package! - Moving arch to end of version string"
|
201
|
+
wanted.gsub!(/(.+)(#{ARCH_REGEX})(.+)/,'\1\3\2')
|
202
|
+
end
|
187
203
|
end
|
188
|
-
|
189
204
|
current_package = self.query
|
190
205
|
if current_package
|
191
206
|
if rpm_compareEVR(rpm_parse_evr(should), rpm_parse_evr(current_package[:ensure])) < 0
|
@@ -126,7 +126,7 @@ Puppet::Type.type(:package).provide :zypper, :parent => :rpm do
|
|
126
126
|
|
127
127
|
def uninstall
|
128
128
|
#extract version numbers and convert to integers
|
129
|
-
major, minor,
|
129
|
+
major, minor, _ = zypper_version.scan(/\d+/).map{ |x| x.to_i }
|
130
130
|
|
131
131
|
if major < 1
|
132
132
|
super
|
@@ -137,7 +137,7 @@ Puppet::Type.type(:package).provide :zypper, :parent => :rpm do
|
|
137
137
|
end
|
138
138
|
|
139
139
|
options << @resource[:name]
|
140
|
-
|
140
|
+
|
141
141
|
zypper *options
|
142
142
|
end
|
143
143
|
|
@@ -308,7 +308,7 @@ Puppet::Type.type(:scheduled_task).provide(:win32_taskscheduler) do
|
|
308
308
|
trigger['type']['days_of_week'] = if puppet_trigger['day_of_week']
|
309
309
|
bitfield_from_days_of_week(puppet_trigger['day_of_week'])
|
310
310
|
else
|
311
|
-
scheduler_days_of_week.inject(0) {|day_flags,day| day_flags
|
311
|
+
scheduler_days_of_week.inject(0) {|day_flags,day| day_flags | day}
|
312
312
|
end
|
313
313
|
when 'monthly'
|
314
314
|
trigger['type'] = {
|
@@ -426,7 +426,7 @@ Puppet::Type.type(:scheduled_task).provide(:win32_taskscheduler) do
|
|
426
426
|
day = 32 if day == 'last'
|
427
427
|
|
428
428
|
integer_day = Integer(day)
|
429
|
-
self.fail "Day must be specified as an integer in the range 1-31, or as 'last'" unless integer_day
|
429
|
+
self.fail "Day must be specified as an integer in the range 1-31, or as 'last'" unless integer_day.between?(1,32)
|
430
430
|
|
431
431
|
bitfield |= 1 << integer_day - 1
|
432
432
|
end
|
@@ -4,10 +4,9 @@ Puppet::Type.type(:service).provide :launchd, :parent => :base do
|
|
4
4
|
This provider manages jobs with `launchd`, which is the default service
|
5
5
|
framework for Mac OS X (and may be available for use on other platforms).
|
6
6
|
|
7
|
-
For `launchd`
|
7
|
+
For more information, see the `launchd` man page:
|
8
8
|
|
9
|
-
* <https://developer.apple.com/
|
10
|
-
* <http://launchd.macosforge.org/>
|
9
|
+
* <https://developer.apple.com/legacy/library/documentation/Darwin/Reference/ManPages/man8/launchd.8.html>
|
11
10
|
|
12
11
|
This provider reads plists out of the following directories:
|
13
12
|
|
@@ -142,7 +141,7 @@ Puppet::Type.type(:service).provide :launchd, :parent => :base do
|
|
142
141
|
@label_to_path_map[job["Label"]] = filepath
|
143
142
|
else
|
144
143
|
#TRANSLATORS 'plist' and label' should not be translated
|
145
|
-
Puppet.
|
144
|
+
Puppet.debug(_("The %{file} plist does not contain a 'label' key; Puppet is skipping it") % { file: filepath })
|
146
145
|
next
|
147
146
|
end
|
148
147
|
end
|
@@ -239,7 +238,7 @@ Puppet::Type.type(:service).provide :launchd, :parent => :base do
|
|
239
238
|
# directly.
|
240
239
|
def start
|
241
240
|
return ucommand(:start) if resource[:start]
|
242
|
-
job_path,
|
241
|
+
job_path, _ = plist_from_label(resource[:name])
|
243
242
|
did_enable_job = false
|
244
243
|
cmds = []
|
245
244
|
cmds << :launchctl << :load
|
@@ -262,7 +261,7 @@ Puppet::Type.type(:service).provide :launchd, :parent => :base do
|
|
262
261
|
|
263
262
|
def stop
|
264
263
|
return ucommand(:stop) if resource[:stop]
|
265
|
-
job_path,
|
264
|
+
job_path, _ = plist_from_label(resource[:name])
|
266
265
|
did_disable_job = false
|
267
266
|
cmds = []
|
268
267
|
cmds << :launchctl << :unload
|
@@ -298,7 +297,7 @@ Puppet::Type.type(:service).provide :launchd, :parent => :base do
|
|
298
297
|
job_plist_disabled = nil
|
299
298
|
overrides_disabled = nil
|
300
299
|
|
301
|
-
|
300
|
+
_, job_plist = plist_from_label(resource[:name])
|
302
301
|
job_plist_disabled = job_plist["Disabled"] if job_plist.has_key?("Disabled")
|
303
302
|
|
304
303
|
if FileTest.file?(self.class.launchd_overrides) and overrides = self.class.read_plist(self.class.launchd_overrides)
|
@@ -33,8 +33,9 @@ Puppet::Type.type(:service).provide :redhat, :parent => :init, :source => :init
|
|
33
33
|
end
|
34
34
|
|
35
35
|
# For Suse OS family, chkconfig returns 0 even if the service is disabled or non-existent
|
36
|
-
# Therefore, check the output for '<name> on'
|
37
|
-
|
36
|
+
# Therefore, check the output for '<name> on' (or '<name> B for boot services)
|
37
|
+
# to see if it is enabled
|
38
|
+
return :false unless Facter.value(:osfamily) != 'Suse' || output =~ /^#{name}\s+(on|B)$/
|
38
39
|
|
39
40
|
:true
|
40
41
|
end
|
@@ -25,7 +25,7 @@ Puppet::Type.type(:service).provide :systemd, :parent => :base do
|
|
25
25
|
defaultfor :osfamily => :coreos
|
26
26
|
defaultfor :operatingsystem => :amazon, :operatingsystemmajrelease => ["2"]
|
27
27
|
defaultfor :operatingsystem => :debian, :operatingsystemmajrelease => ["8", "stretch/sid", "9", "buster/sid"]
|
28
|
-
defaultfor :operatingsystem => :ubuntu, :operatingsystemmajrelease => ["15.04","15.10","16.04","16.10"
|
28
|
+
defaultfor :operatingsystem => :ubuntu, :operatingsystemmajrelease => ["15.04","15.10","16.04","16.10"]
|
29
29
|
defaultfor :operatingsystem => :cumuluslinux, :operatingsystemmajrelease => ["3"]
|
30
30
|
|
31
31
|
def self.instances
|
@@ -179,7 +179,7 @@ Puppet::Type.type(:service).provide :systemd, :parent => :base do
|
|
179
179
|
def prepare_error_message(name, action, exception)
|
180
180
|
error_return = "Systemd #{action} for #{name} failed!\n"
|
181
181
|
journalctl_command = "journalctl -n 50 --since '5 minutes ago' -u #{name} --no-pager"
|
182
|
-
Puppet.debug("
|
182
|
+
Puppet.debug("Running journalctl command to get logs for systemd #{action} failure: #{journalctl_command}")
|
183
183
|
journalctl_output = execute(journalctl_command)
|
184
184
|
error_return << "journalctl log for #{name}:\n#{journalctl_output}"
|
185
185
|
end
|
@@ -58,7 +58,7 @@ Puppet::Type.type(:ssh_authorized_key).provide(
|
|
58
58
|
|
59
59
|
Puppet::Util::SUIDManager.asuser(@resource.should(:user)) do
|
60
60
|
unless Puppet::FileSystem.exist?(dir = File.dirname(target))
|
61
|
-
Puppet.debug "Creating #{dir}"
|
61
|
+
Puppet.debug "Creating #{dir} as #{@resource.should(:user)}"
|
62
62
|
Dir.mkdir(dir, dir_perm)
|
63
63
|
end
|
64
64
|
|
@@ -72,6 +72,7 @@ Puppet::Type.type(:user).provide :aix, :parent => Puppet::Provider::AixObject do
|
|
72
72
|
:from => :expiry_from_attr },
|
73
73
|
{:aix_attr => :maxage, :puppet_prop => :password_max_age},
|
74
74
|
{:aix_attr => :minage, :puppet_prop => :password_min_age},
|
75
|
+
{:aix_attr => :pwdwarntime, :puppet_prop => :password_warn_days},
|
75
76
|
{:aix_attr => :attributes, :puppet_prop => :attributes},
|
76
77
|
{ :aix_attr => :gecos, :puppet_prop => :comment },
|
77
78
|
]
|
@@ -275,7 +276,7 @@ Puppet::Type.type(:user).provide :aix, :parent => Puppet::Provider::AixObject do
|
|
275
276
|
# Must receive "user:enc_password" as input
|
276
277
|
# command, arguments = {:failonfail => true, :combine => true}
|
277
278
|
# Fix for bugs #11200 and #10915
|
278
|
-
cmd = [self.class.command(:chpasswd), get_ia_module_args, '-e', '-c'].flatten
|
279
|
+
cmd = [self.class.command(:chpasswd), get_ia_module_args, '-e', '-c', user].flatten
|
279
280
|
begin
|
280
281
|
output = execute(cmd, {:failonfail => false, :combine => true, :stdinfile => tmpfile.path })
|
281
282
|
# chpasswd can return 1, even on success (at least on AIX 6.1); empty output indicates success
|
@@ -292,7 +293,7 @@ Puppet::Type.type(:user).provide :aix, :parent => Puppet::Provider::AixObject do
|
|
292
293
|
def managed_attribute_keys(hash)
|
293
294
|
managed_attributes ||= @resource.original_parameters[:attributes] || hash.keys.map{|k| k.to_s}
|
294
295
|
managed_attributes = [managed_attributes] unless managed_attributes.is_a?(Array)
|
295
|
-
managed_attributes.map {|attr| key,
|
296
|
+
managed_attributes.map {|attr| key, _ = attr.split("="); key.strip.to_sym}
|
296
297
|
end
|
297
298
|
|
298
299
|
def should_include?(key, managed_keys)
|
@@ -45,7 +45,7 @@ Puppet::Type.type(:user).provide :openbsd, :parent => :useradd do
|
|
45
45
|
# sp_loginclass field.
|
46
46
|
begin
|
47
47
|
return unmunge(shadow_property, ent.send(method))
|
48
|
-
rescue
|
48
|
+
rescue
|
49
49
|
#TRANSLATORS 'ruby-shadow' is a Ruby gem library
|
50
50
|
Puppet.warning _("ruby-shadow doesn't support %{method}") % { method: method }
|
51
51
|
end
|
@@ -67,7 +67,7 @@ Puppet::Type.type(:user).provide :pw, :parent => Puppet::Provider::NameService::
|
|
67
67
|
# use pw to update password hash
|
68
68
|
def password=(cryptopw)
|
69
69
|
Puppet.debug "change password for user '#{@resource[:name]}' method called with hash '#{cryptopw}'"
|
70
|
-
stdin,
|
70
|
+
stdin, _, _ = Open3.popen3("pw user mod #{@resource[:name]} -H 0")
|
71
71
|
stdin.puts(cryptopw)
|
72
72
|
stdin.close
|
73
73
|
Puppet.debug "finished password for user '#{@resource[:name]}' method called with hash '#{cryptopw}'"
|
@@ -18,6 +18,7 @@ Puppet::Type.type(:user).provide :user_role_add, :parent => :useradd, :source =>
|
|
18
18
|
options :profiles, :flag => "-P"
|
19
19
|
options :password_min_age, :flag => "-n"
|
20
20
|
options :password_max_age, :flag => "-x"
|
21
|
+
options :password_warn_days, :flag => "-w"
|
21
22
|
|
22
23
|
verify :gid, "GID must be an integer" do |value|
|
23
24
|
value.is_a? Integer
|
@@ -48,7 +49,7 @@ Puppet::Type.type(:user).provide :user_role_add, :parent => :useradd, :source =>
|
|
48
49
|
cmd = []
|
49
50
|
Puppet::Type.type(:user).validproperties.each do |property|
|
50
51
|
#skip the password because we can't create it with the solaris useradd
|
51
|
-
next if [:ensure, :password, :password_min_age, :password_max_age].include?(property)
|
52
|
+
next if [:ensure, :password, :password_min_age, :password_max_age, :password_warn_days].include?(property)
|
52
53
|
# 1680 Now you can set the hashed passwords on solaris:lib/puppet/provider/user/user_role_add.rb
|
53
54
|
# the value needs to be quoted, mostly because -c might
|
54
55
|
# have spaces in it
|
@@ -196,6 +197,11 @@ Puppet::Type.type(:user).provide :user_role_add, :parent => :useradd, :source =>
|
|
196
197
|
shadow_entry[4].empty? ? -1 : shadow_entry[4]
|
197
198
|
end
|
198
199
|
|
200
|
+
def password_warn_days
|
201
|
+
return :absent unless shadow_entry
|
202
|
+
shadow_entry[5].empty? ? -1 : shadow_entry[5]
|
203
|
+
end
|
204
|
+
|
199
205
|
# Read in /etc/shadow, find the line for our used and rewrite it with the
|
200
206
|
# new pw. Smooth like 80 grit sandpaper.
|
201
207
|
#
|
@@ -16,6 +16,7 @@ Puppet::Type.type(:user).provide :useradd, :parent => Puppet::Provider::NameServ
|
|
16
16
|
options :groups, :flag => "-G"
|
17
17
|
options :password_min_age, :flag => "-m", :method => :sp_min
|
18
18
|
options :password_max_age, :flag => "-M", :method => :sp_max
|
19
|
+
options :password_warn_days, :flag => "-W", :method => :sp_warn
|
19
20
|
options :password, :method => :sp_pwdp
|
20
21
|
options :expiry, :method => :sp_expire,
|
21
22
|
:munge => proc { |value|
|
@@ -41,7 +42,7 @@ Puppet::Type.type(:user).provide :useradd, :parent => Puppet::Provider::NameServ
|
|
41
42
|
end
|
42
43
|
}
|
43
44
|
|
44
|
-
optional_commands :localadd => "luseradd"
|
45
|
+
optional_commands :localadd => "luseradd", :localdelete => "luserdel", :localmodify => "lusermod", :localpassword => "lchage"
|
45
46
|
has_feature :libuser if Puppet.features.libuser?
|
46
47
|
|
47
48
|
def exists?
|
@@ -156,7 +157,7 @@ Puppet::Type.type(:user).provide :useradd, :parent => Puppet::Provider::NameServ
|
|
156
157
|
# sort them to have a predictable command line in tests
|
157
158
|
Puppet::Type.type(:user).validproperties.sort.each do |property|
|
158
159
|
next if property == :ensure
|
159
|
-
next if property
|
160
|
+
next if property_manages_password_age?(property)
|
160
161
|
next if property == :groups and @resource.forcelocal?
|
161
162
|
next if property == :expiry and @resource.forcelocal?
|
162
163
|
# the value needs to be quoted, mostly because -c might
|
@@ -185,22 +186,47 @@ Puppet::Type.type(:user).provide :useradd, :parent => Puppet::Provider::NameServ
|
|
185
186
|
cmd << @resource[:name]
|
186
187
|
end
|
187
188
|
|
189
|
+
def modifycmd(param, value)
|
190
|
+
if @resource.forcelocal?
|
191
|
+
cmd = [command(property_manages_password_age?(param) ? :localpassword : :localmodify)]
|
192
|
+
@custom_environment = Puppet::Util::Libuser.getenv
|
193
|
+
else
|
194
|
+
cmd = [command(property_manages_password_age?(param) ? :password : :modify)]
|
195
|
+
end
|
196
|
+
cmd << flag(param) << value
|
197
|
+
cmd += check_allow_dup
|
198
|
+
cmd << @resource[:name]
|
199
|
+
|
200
|
+
cmd
|
201
|
+
end
|
202
|
+
|
188
203
|
def deletecmd
|
189
|
-
|
204
|
+
if @resource.forcelocal?
|
205
|
+
cmd = [command(:localdelete)]
|
206
|
+
@custom_environment = Puppet::Util::Libuser.getenv
|
207
|
+
else
|
208
|
+
cmd = [command(:delete)]
|
209
|
+
end
|
190
210
|
cmd += @resource.managehome? ? ['-r'] : []
|
191
211
|
cmd << @resource[:name]
|
192
212
|
end
|
193
213
|
|
194
214
|
def passcmd
|
195
|
-
|
215
|
+
if @resource.forcelocal?
|
216
|
+
cmd = command(:localpassword)
|
217
|
+
@custom_environment = Puppet::Util::Libuser.getenv
|
218
|
+
else
|
219
|
+
cmd = command(:password)
|
220
|
+
end
|
221
|
+
age_limits = [:password_min_age, :password_max_age, :password_warn_days].select { |property| @resource.should(property) }
|
196
222
|
if age_limits.empty?
|
197
223
|
nil
|
198
224
|
else
|
199
|
-
[
|
225
|
+
[cmd, age_limits.collect { |property| [flag(property), @resource.should(property)]}, @resource[:name]].flatten
|
200
226
|
end
|
201
227
|
end
|
202
228
|
|
203
|
-
[:expiry, :password_min_age, :password_max_age, :password].each do |shadow_property|
|
229
|
+
[:expiry, :password_min_age, :password_max_age, :password_warn_days, :password].each do |shadow_property|
|
204
230
|
define_method(shadow_property) do
|
205
231
|
if Puppet.features.libshadow?
|
206
232
|
if ent = Shadow::Passwd.getspnam(@canonical_name)
|
@@ -228,4 +254,8 @@ Puppet::Type.type(:user).provide :useradd, :parent => Puppet::Provider::NameServ
|
|
228
254
|
def groups?
|
229
255
|
!!@resource[:groups]
|
230
256
|
end
|
257
|
+
|
258
|
+
def property_manages_password_age?(property)
|
259
|
+
property.to_s =~ /password_.+_age|password_warn_days/
|
260
|
+
end
|
231
261
|
end
|
@@ -52,7 +52,7 @@ Puppet::Type.type(:user).provide :windows_adsi do
|
|
52
52
|
def groups_to_s(groups)
|
53
53
|
return '' if groups.nil? || !groups.kind_of?(Array)
|
54
54
|
groups = groups.map do |group_name|
|
55
|
-
sid = Puppet::Util::Windows::SID.
|
55
|
+
sid = Puppet::Util::Windows::SID.name_to_sid_object(group_name)
|
56
56
|
if sid.account =~ /\\/
|
57
57
|
account, _ = Puppet::Util::Windows::ADSI::Group.parse_name(sid.account)
|
58
58
|
else
|
@@ -76,8 +76,8 @@ Puppet::Type.type(:yumrepo).provide(:inifile) do
|
|
76
76
|
# Use directories in reposdir if they are set instead of default
|
77
77
|
if reposdir
|
78
78
|
# Follow the code from the yum/config.py
|
79
|
-
|
80
|
-
|
79
|
+
reposdir.gsub!("\n", ' ')
|
80
|
+
reposdir.gsub!(',', ' ')
|
81
81
|
dirs = reposdir.split
|
82
82
|
end
|
83
83
|
dirs.select! { |dir| Puppet::FileSystem.exist?(dir) }
|
@@ -204,8 +204,6 @@ Puppet::Type.type(:yumrepo).provide(:inifile) do
|
|
204
204
|
def create
|
205
205
|
@property_hash[:ensure] = :present
|
206
206
|
|
207
|
-
new_section = current_section
|
208
|
-
|
209
207
|
# We fetch a list of properties from the type, then iterate
|
210
208
|
# over them, avoiding ensure. We're relying on .should to
|
211
209
|
# check if the property has been set and should be modified,
|