chef 16.0.257 → 16.2.44
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +3 -1
- data/README.md +3 -3
- data/Rakefile +44 -16
- data/chef.gemspec +4 -4
- data/lib/chef/application/apply.rb +2 -2
- data/lib/chef/application/base.rb +1 -1
- data/lib/chef/application/client.rb +1 -1
- data/lib/chef/application/exit_code.rb +2 -2
- data/lib/chef/application/windows_service_manager.rb +1 -1
- data/lib/chef/chef_fs/chef_fs_data_store.rb +3 -3
- data/lib/chef/chef_fs/data_handler/data_bag_item_data_handler.rb +1 -1
- data/lib/chef/chef_fs/file_system/chef_server/acls_dir.rb +1 -1
- data/lib/chef/chef_fs/file_system/chef_server/cookbook_file.rb +1 -1
- data/lib/chef/chef_fs/file_system/chef_server/policies_dir.rb +1 -1
- data/lib/chef/chef_fs/file_system/chef_server/rest_list_dir.rb +1 -1
- data/lib/chef/chef_fs/file_system/multiplexed_dir.rb +1 -1
- data/lib/chef/chef_fs/file_system/repository/directory.rb +1 -1
- data/lib/chef/chef_fs/parallelizer/parallel_enumerable.rb +1 -1
- data/lib/chef/chef_fs/path_utils.rb +4 -4
- data/lib/chef/cookbook/chefignore.rb +1 -1
- data/lib/chef/cookbook/file_system_file_vendor.rb +1 -1
- data/lib/chef/cookbook/metadata.rb +2 -2
- data/lib/chef/cookbook_loader.rb +1 -1
- data/lib/chef/cookbook_manifest.rb +1 -1
- data/lib/chef/cookbook_site_streaming_uploader.rb +1 -1
- data/lib/chef/cookbook_version.rb +7 -7
- data/lib/chef/data_bag.rb +4 -4
- data/lib/chef/data_collector.rb +1 -1
- data/lib/chef/data_collector/error_handlers.rb +1 -1
- data/lib/chef/decorator/lazy_array.rb +2 -2
- data/lib/chef/deprecated.rb +5 -1
- data/lib/chef/digester.rb +4 -4
- data/lib/chef/dsl/declare_resource.rb +1 -1
- data/lib/chef/dsl/platform_introspection.rb +1 -1
- data/lib/chef/encrypted_data_bag_item/decryptor.rb +1 -1
- data/lib/chef/encrypted_data_bag_item/encryptor.rb +1 -1
- data/lib/chef/file_access_control.rb +1 -1
- data/lib/chef/formatters/base.rb +1 -1
- data/lib/chef/formatters/error_inspectors/compile_error_inspector.rb +1 -1
- data/lib/chef/formatters/error_inspectors/node_load_error_inspector.rb +2 -2
- data/lib/chef/formatters/error_inspectors/registration_error_inspector.rb +7 -7
- data/lib/chef/formatters/error_inspectors/resource_failure_inspector.rb +3 -3
- data/lib/chef/http.rb +18 -3
- data/lib/chef/http/decompressor.rb +1 -1
- data/lib/chef/http/http_request.rb +1 -1
- data/lib/chef/http/json_output.rb +1 -1
- data/lib/chef/http/ssl_policies.rb +18 -0
- data/lib/chef/json_compat.rb +1 -1
- data/lib/chef/key.rb +1 -1
- data/lib/chef/knife.rb +2 -2
- data/lib/chef/knife/bootstrap.rb +13 -16
- data/lib/chef/knife/bootstrap/chef_vault_handler.rb +1 -1
- data/lib/chef/knife/bootstrap/client_builder.rb +1 -1
- data/lib/chef/knife/bootstrap/templates/chef-full.erb +9 -9
- data/lib/chef/knife/bootstrap/templates/windows-chef-client-msi.erb +3 -1
- data/lib/chef/knife/client_bulk_delete.rb +1 -1
- data/lib/chef/knife/config_get.rb +1 -1
- data/lib/chef/knife/cookbook_delete.rb +1 -1
- data/lib/chef/knife/core/cookbook_scm_repo.rb +1 -1
- data/lib/chef/knife/core/hashed_command_loader.rb +1 -1
- data/lib/chef/knife/core/node_presenter.rb +1 -1
- data/lib/chef/knife/core/status_presenter.rb +1 -1
- data/lib/chef/knife/core/subcommand_loader.rb +1 -1
- data/lib/chef/knife/core/windows_bootstrap_context.rb +18 -3
- data/lib/chef/knife/data_bag_create.rb +1 -1
- data/lib/chef/knife/environment_compare.rb +1 -1
- data/lib/chef/knife/key_create_base.rb +1 -1
- data/lib/chef/knife/key_edit_base.rb +1 -1
- data/lib/chef/knife/list.rb +1 -1
- data/lib/chef/knife/node_bulk_delete.rb +1 -1
- data/lib/chef/knife/node_run_list_remove.rb +1 -1
- data/lib/chef/knife/role_bulk_delete.rb +1 -1
- data/lib/chef/knife/ssh.rb +2 -2
- data/lib/chef/knife/supermarket_install.rb +1 -1
- data/lib/chef/knife/supermarket_share.rb +1 -1
- data/lib/chef/knife/supermarket_unshare.rb +1 -1
- data/lib/chef/knife/{user_invite_recind.rb → user_invite_rescind.rb} +6 -6
- data/lib/chef/knife/yaml_convert.rb +2 -2
- data/lib/chef/log.rb +1 -1
- data/lib/chef/mixin/api_version_request_handling.rb +1 -1
- data/lib/chef/mixin/checksum.rb +0 -1
- data/lib/chef/mixin/create_path.rb +8 -8
- data/lib/chef/mixin/openssl_helper.rb +4 -4
- data/lib/chef/mixin/properties.rb +4 -2
- data/lib/chef/mixin/securable.rb +2 -2
- data/lib/chef/mixin/shell_out.rb +1 -1
- data/lib/chef/node/attribute.rb +2 -2
- data/lib/chef/node/immutable_collections.rb +1 -1
- data/lib/chef/node/mixin/deep_merge_cache.rb +7 -7
- data/lib/chef/policy_builder/policyfile.rb +1 -1
- data/lib/chef/powershell.rb +1 -1
- data/lib/chef/property.rb +2 -2
- data/lib/chef/provider.rb +3 -3
- data/lib/chef/provider/batch.rb +3 -10
- data/lib/chef/provider/cron.rb +2 -14
- data/lib/chef/provider/directory.rb +1 -1
- data/lib/chef/provider/execute.rb +3 -2
- data/lib/chef/provider/file.rb +1 -1
- data/lib/chef/provider/group/dscl.rb +2 -2
- data/lib/chef/provider/group/windows.rb +1 -1
- data/lib/chef/provider/ifconfig.rb +7 -7
- data/lib/chef/provider/launchd.rb +28 -32
- data/lib/chef/provider/mount/aix.rb +1 -1
- data/lib/chef/provider/mount/windows.rb +2 -2
- data/lib/chef/provider/noop.rb +1 -1
- data/lib/chef/provider/package/cab.rb +1 -1
- data/lib/chef/provider/package/chocolatey.rb +1 -1
- data/lib/chef/provider/package/dpkg.rb +1 -1
- data/lib/chef/provider/package/freebsd/base.rb +2 -1
- data/lib/chef/provider/package/homebrew.rb +1 -1
- data/lib/chef/provider/package/macports.rb +0 -2
- data/lib/chef/provider/package/openbsd.rb +1 -1
- data/lib/chef/provider/package/portage.rb +3 -2
- data/lib/chef/provider/package/powershell.rb +6 -2
- data/lib/chef/provider/package/rubygems.rb +3 -3
- data/lib/chef/provider/package/snap.rb +96 -27
- data/lib/chef/provider/package/windows.rb +27 -52
- data/lib/chef/provider/package/windows/msi.rb +3 -3
- data/lib/chef/provider/package/windows/registry_uninstall_entry.rb +1 -1
- data/lib/chef/provider/package/yum.rb +1 -1
- data/lib/chef/provider/package/yum/yum_cache.rb +1 -1
- data/lib/chef/provider/powershell_script.rb +11 -15
- data/lib/chef/provider/remote_directory.rb +2 -2
- data/lib/chef/provider/remote_file/http.rb +4 -1
- data/lib/chef/provider/script.rb +4 -75
- data/lib/chef/provider/service/arch.rb +2 -2
- data/lib/chef/provider/service/debian.rb +2 -2
- data/lib/chef/provider/service/macosx.rb +13 -2
- data/lib/chef/provider/service/openbsd.rb +4 -4
- data/lib/chef/provider/service/redhat.rb +1 -1
- data/lib/chef/provider/service/simple.rb +3 -3
- data/lib/chef/provider/service/upstart.rb +1 -1
- data/lib/chef/provider/service/windows.rb +1 -1
- data/lib/chef/provider/subversion.rb +2 -2
- data/lib/chef/provider/user/aix.rb +1 -1
- data/lib/chef/provider/user/dscl.rb +7 -7
- data/lib/chef/provider/user/linux.rb +3 -3
- data/lib/chef/provider/user/mac.rb +15 -11
- data/lib/chef/provider/windows_script.rb +87 -25
- data/lib/chef/provider/windows_task.rb +5 -3
- data/lib/chef/provider/zypper_repository.rb +30 -10
- data/lib/chef/resource.rb +25 -14
- data/lib/chef/resource/alternatives.rb +65 -4
- data/lib/chef/resource/apt_package.rb +31 -2
- data/lib/chef/resource/apt_preference.rb +34 -5
- data/lib/chef/resource/apt_repository.rb +22 -15
- data/lib/chef/resource/apt_update.rb +6 -4
- data/lib/chef/resource/archive_file.rb +33 -12
- data/lib/chef/resource/bash.rb +1 -2
- data/lib/chef/resource/batch.rb +5 -3
- data/lib/chef/resource/bff_package.rb +1 -1
- data/lib/chef/resource/breakpoint.rb +1 -1
- data/lib/chef/resource/build_essential.rb +8 -4
- data/lib/chef/resource/cab_package.rb +1 -1
- data/lib/chef/resource/chef_client_cron.rb +12 -9
- data/lib/chef/resource/chef_client_scheduled_task.rb +22 -7
- data/lib/chef/resource/chef_client_systemd_timer.rb +10 -7
- data/lib/chef/resource/chef_gem.rb +6 -2
- data/lib/chef/resource/chef_handler.rb +3 -3
- data/lib/chef/resource/chef_sleep.rb +7 -4
- data/lib/chef/resource/chef_vault_secret.rb +4 -4
- data/lib/chef/resource/chocolatey_config.rb +5 -3
- data/lib/chef/resource/chocolatey_feature.rb +5 -3
- data/lib/chef/resource/chocolatey_package.rb +5 -3
- data/lib/chef/resource/chocolatey_source.rb +5 -3
- data/lib/chef/resource/cookbook_file.rb +3 -2
- data/lib/chef/resource/cron/_cron_shared.rb +98 -0
- data/lib/chef/resource/cron/cron.rb +46 -0
- data/lib/chef/resource/{cron_d.rb → cron/cron_d.rb} +28 -94
- data/lib/chef/resource/cron_access.rb +17 -6
- data/lib/chef/resource/csh.rb +1 -2
- data/lib/chef/resource/directory.rb +1 -1
- data/lib/chef/resource/dmg_package.rb +18 -15
- data/lib/chef/resource/dnf_package.rb +1 -1
- data/lib/chef/resource/dpkg_package.rb +1 -1
- data/lib/chef/resource/execute.rb +479 -9
- data/lib/chef/resource/file.rb +11 -8
- data/lib/chef/resource/freebsd_package.rb +2 -2
- data/lib/chef/resource/gem_package.rb +6 -6
- data/lib/chef/resource/group.rb +1 -1
- data/lib/chef/resource/helpers/cron_validations.rb +6 -3
- data/lib/chef/resource/homebrew_cask.rb +1 -1
- data/lib/chef/resource/homebrew_package.rb +30 -1
- data/lib/chef/resource/homebrew_tap.rb +1 -1
- data/lib/chef/resource/homebrew_update.rb +107 -0
- data/lib/chef/resource/hostname.rb +11 -24
- data/lib/chef/resource/http_request.rb +1 -1
- data/lib/chef/resource/ifconfig.rb +7 -7
- data/lib/chef/resource/ips_package.rb +1 -1
- data/lib/chef/resource/kernel_module.rb +15 -2
- data/lib/chef/resource/ksh.rb +1 -1
- data/lib/chef/resource/launchd.rb +5 -5
- data/lib/chef/resource/link.rb +4 -4
- data/lib/chef/resource/locale.rb +4 -4
- data/lib/chef/resource/log.rb +1 -1
- data/lib/chef/resource/macos_userdefaults.rb +15 -10
- data/lib/chef/resource/macosx_service.rb +1 -1
- data/lib/chef/resource/macports_package.rb +1 -1
- data/lib/chef/resource/mdadm.rb +1 -1
- data/lib/chef/resource/mount.rb +2 -2
- data/lib/chef/resource/msu_package.rb +2 -2
- data/lib/chef/resource/ohai.rb +1 -1
- data/lib/chef/resource/ohai_hint.rb +1 -1
- data/lib/chef/resource/openbsd_package.rb +1 -1
- data/lib/chef/resource/openssl_dhparam.rb +1 -1
- data/lib/chef/resource/openssl_ec_private_key.rb +1 -1
- data/lib/chef/resource/openssl_ec_public_key.rb +1 -1
- data/lib/chef/resource/openssl_rsa_private_key.rb +1 -1
- data/lib/chef/resource/openssl_rsa_public_key.rb +1 -1
- data/lib/chef/resource/openssl_x509_certificate.rb +1 -1
- data/lib/chef/resource/openssl_x509_crl.rb +1 -1
- data/lib/chef/resource/openssl_x509_request.rb +1 -1
- data/lib/chef/resource/osx_profile.rb +1 -1
- data/lib/chef/resource/package.rb +1 -1
- data/lib/chef/resource/pacman_package.rb +1 -1
- data/lib/chef/resource/paludis_package.rb +1 -1
- data/lib/chef/resource/perl.rb +1 -2
- data/lib/chef/resource/plist.rb +24 -5
- data/lib/chef/resource/portage_package.rb +1 -1
- data/lib/chef/resource/powershell_package.rb +1 -1
- data/lib/chef/resource/powershell_package_source.rb +1 -1
- data/lib/chef/resource/powershell_script.rb +5 -3
- data/lib/chef/resource/python.rb +1 -2
- data/lib/chef/resource/reboot.rb +1 -1
- data/lib/chef/resource/registry_key.rb +1 -1
- data/lib/chef/resource/remote_directory.rb +1 -1
- data/lib/chef/resource/remote_file.rb +26 -11
- data/lib/chef/resource/rhsm_errata.rb +1 -3
- data/lib/chef/resource/rhsm_errata_level.rb +1 -1
- data/lib/chef/resource/rhsm_register.rb +1 -2
- data/lib/chef/resource/rhsm_repo.rb +1 -2
- data/lib/chef/resource/rhsm_subscription.rb +1 -3
- data/lib/chef/resource/route.rb +1 -1
- data/lib/chef/resource/rpm_package.rb +5 -2
- data/lib/chef/resource/ruby.rb +1 -2
- data/lib/chef/resource/ruby_block.rb +1 -4
- data/lib/chef/resource/scm/_scm.rb +4 -3
- data/lib/chef/resource/scm/git.rb +2 -2
- data/lib/chef/resource/scm/subversion.rb +2 -2
- data/lib/chef/resource/script.rb +1 -1
- data/lib/chef/resource/service.rb +1 -1
- data/lib/chef/resource/smartos_package.rb +1 -1
- data/lib/chef/resource/snap_package.rb +1 -1
- data/lib/chef/resource/solaris_package.rb +1 -1
- data/lib/chef/resource/ssh_known_hosts_entry.rb +1 -1
- data/lib/chef/resource/sudo.rb +4 -4
- data/lib/chef/resource/swap_file.rb +2 -2
- data/lib/chef/resource/sysctl.rb +61 -2
- data/lib/chef/resource/systemd_unit.rb +2 -2
- data/lib/chef/resource/template.rb +1 -1
- data/lib/chef/resource/timezone.rb +1 -1
- data/lib/chef/resource/user.rb +2 -2
- data/lib/chef/resource/user_ulimit.rb +24 -22
- data/lib/chef/resource/windows_ad_join.rb +31 -2
- data/lib/chef/resource/windows_audit_policy.rb +227 -0
- data/lib/chef/resource/windows_auto_run.rb +13 -2
- data/lib/chef/resource/windows_certificate.rb +28 -2
- data/lib/chef/resource/windows_dfs_folder.rb +1 -1
- data/lib/chef/resource/windows_dfs_namespace.rb +1 -1
- data/lib/chef/resource/windows_dfs_server.rb +2 -2
- data/lib/chef/resource/windows_env.rb +10 -1
- data/lib/chef/resource/windows_feature.rb +57 -2
- data/lib/chef/resource/windows_feature_dism.rb +15 -2
- data/lib/chef/resource/windows_feature_powershell.rb +29 -2
- data/lib/chef/resource/windows_firewall_rule.rb +11 -7
- data/lib/chef/resource/windows_font.rb +13 -4
- data/lib/chef/resource/windows_package.rb +66 -6
- data/lib/chef/resource/windows_pagefile.rb +32 -4
- data/lib/chef/resource/windows_path.rb +18 -1
- data/lib/chef/resource/windows_printer.rb +26 -6
- data/lib/chef/resource/windows_printer_port.rb +29 -1
- data/lib/chef/resource/windows_script.rb +2 -16
- data/lib/chef/resource/windows_security_policy.rb +47 -16
- data/lib/chef/resource/windows_service.rb +1 -1
- data/lib/chef/resource/windows_share.rb +23 -3
- data/lib/chef/resource/windows_shortcut.rb +13 -3
- data/lib/chef/resource/windows_task.rb +143 -29
- data/lib/chef/resource/windows_uac.rb +20 -1
- data/lib/chef/resource/windows_user_privilege.rb +45 -3
- data/lib/chef/resource/windows_workgroup.rb +19 -3
- data/lib/chef/resource/yum_package.rb +88 -6
- data/lib/chef/resource/yum_repository.rb +36 -19
- data/lib/chef/resource/zypper_package.rb +29 -3
- data/lib/chef/resource/zypper_repository.rb +17 -5
- data/lib/chef/resource_inspector.rb +5 -4
- data/lib/chef/resources.rb +4 -2
- data/lib/chef/run_context/cookbook_compiler.rb +1 -1
- data/lib/chef/scan_access_control.rb +1 -1
- data/lib/chef/search/query.rb +1 -1
- data/lib/chef/shell/ext.rb +1 -1
- data/lib/chef/util/diff.rb +2 -2
- data/lib/chef/util/dsc/lcm_output_parser.rb +3 -3
- data/lib/chef/util/windows/net_user.rb +1 -1
- data/lib/chef/util/windows/volume.rb +1 -1
- data/lib/chef/version.rb +1 -1
- data/lib/chef/win32/api.rb +2 -2
- data/lib/chef/win32/api/error.rb +3 -1
- data/lib/chef/win32/api/file.rb +18 -18
- data/lib/chef/win32/api/net.rb +1 -0
- data/lib/chef/win32/file.rb +1 -1
- data/lib/chef/win32/mutex.rb +1 -1
- data/lib/chef/win32/net.rb +1 -0
- data/lib/chef/win32/process.rb +2 -2
- data/lib/chef/win32/registry.rb +2 -2
- data/lib/chef/win32/security.rb +1 -1
- data/lib/chef/win32/security/sid.rb +4 -4
- data/spec/data/lwrp/providers/buck_passer.rb +1 -1
- data/spec/data/lwrp/providers/buck_passer_2.rb +1 -1
- data/spec/data/lwrp/providers/embedded_resource_accesses_providers_scope.rb +1 -1
- data/spec/functional/resource/cron_spec.rb +10 -0
- data/spec/functional/resource/dnf_package_spec.rb +2 -2
- data/spec/functional/resource/git_spec.rb +6 -6
- data/spec/functional/resource/launchd_spec.rb +232 -0
- data/spec/functional/resource/link_spec.rb +3 -3
- data/spec/functional/resource/remote_file_spec.rb +3 -3
- data/spec/functional/resource/user/dscl_spec.rb +1 -1
- data/spec/functional/resource/user/mac_user_spec.rb +1 -1
- data/spec/functional/resource/windows_task_spec.rb +12 -12
- data/spec/integration/knife/raw_spec.rb +4 -4
- data/spec/integration/knife/redirection_spec.rb +2 -2
- data/spec/support/chef_helpers.rb +1 -1
- data/spec/support/platform_helpers.rb +1 -14
- data/spec/support/platforms/win32/spec_service.rb +1 -1
- data/spec/support/shared/functional/execute_resource.rb +1 -1
- data/spec/support/shared/functional/file_resource.rb +1 -1
- data/spec/support/shared/functional/http.rb +2 -2
- data/spec/support/shared/functional/windows_script.rb +1 -1
- data/spec/support/shared/unit/execute_resource.rb +1 -1
- data/spec/support/shared/unit/mock_shellout.rb +1 -1
- data/spec/support/shared/unit/provider/useradd_based_user_provider.rb +4 -4
- data/spec/unit/application_spec.rb +7 -0
- data/spec/unit/data_bag_spec.rb +1 -1
- data/spec/unit/file_access_control_spec.rb +1 -1
- data/spec/unit/http/ssl_policies_spec.rb +20 -0
- data/spec/unit/knife/bootstrap_spec.rb +2 -2
- data/spec/unit/knife/core/windows_bootstrap_context_spec.rb +7 -1
- data/spec/unit/knife/role_env_run_list_add_spec.rb +6 -6
- data/spec/unit/knife/role_env_run_list_clear_spec.rb +4 -4
- data/spec/unit/knife/role_env_run_list_remove_spec.rb +4 -4
- data/spec/unit/knife/role_env_run_list_replace_spec.rb +4 -4
- data/spec/unit/knife/role_env_run_list_set_spec.rb +4 -4
- data/spec/unit/knife/role_run_list_add_spec.rb +6 -6
- data/spec/unit/knife/role_run_list_clear_spec.rb +4 -4
- data/spec/unit/knife/role_run_list_remove_spec.rb +4 -4
- data/spec/unit/knife/role_run_list_replace_spec.rb +4 -4
- data/spec/unit/knife/role_run_list_set_spec.rb +4 -4
- data/spec/unit/mixin/openssl_helper_spec.rb +4 -4
- data/spec/unit/mixin/shell_out_spec.rb +25 -31
- data/spec/unit/mixin/user_context_spec.rb +1 -9
- data/spec/unit/node/attribute_spec.rb +1 -1
- data/spec/unit/property_spec.rb +1 -1
- data/spec/unit/provider/apt_repository_spec.rb +27 -27
- data/spec/unit/provider/batch_spec.rb +130 -0
- data/spec/unit/provider/cron_spec.rb +9 -49
- data/spec/unit/provider/git_spec.rb +3 -3
- data/spec/unit/provider/group/groupadd_spec.rb +1 -1
- data/spec/unit/provider/launchd_spec.rb +8 -50
- data/spec/unit/provider/osx_profile_spec.rb +2 -2
- data/spec/unit/provider/package/msu_spec.rb +3 -3
- data/spec/unit/provider/package/portage_spec.rb +2 -2
- data/spec/unit/provider/package/powershell_spec.rb +96 -87
- data/spec/unit/provider/package/snap_spec.rb +1 -1
- data/spec/unit/provider/powershell_script_spec.rb +3 -45
- data/spec/unit/provider/script_spec.rb +20 -110
- data/spec/unit/provider/service/gentoo_service_spec.rb +1 -1
- data/spec/unit/provider/zypper_repository_spec.rb +75 -25
- data/spec/unit/provider_resolver_spec.rb +11 -11
- data/spec/unit/resource/archive_file_spec.rb +11 -2
- data/spec/unit/resource/chef_client_scheduled_task_spec.rb +17 -7
- data/spec/unit/resource/cron_spec.rb +2 -2
- data/spec/unit/resource/helpers/cron_validations_spec.rb +5 -1
- data/spec/unit/resource/homebrew_update_spec.rb +30 -0
- data/spec/unit/resource/powershell_script_spec.rb +10 -15
- data/spec/unit/resource/timezone_spec.rb +1 -1
- data/spec/unit/resource/windows_audit_policy_spec.rb +64 -0
- data/spec/unit/resource/windows_dns_record_spec.rb +3 -3
- data/spec/unit/resource/windows_dns_zone_spec.rb +2 -2
- data/spec/unit/resource/windows_package_spec.rb +10 -0
- data/spec/unit/resource/windows_task_spec.rb +1 -1
- data/spec/unit/resource/windows_uac_spec.rb +2 -2
- data/spec/unit/resource/yum_repository_spec.rb +21 -21
- data/spec/unit/resource_spec.rb +67 -1
- data/spec/unit/run_context_spec.rb +1 -1
- data/spec/unit/util/dsc/configuration_generator_spec.rb +1 -1
- data/spec/unit/util/threaded_job_queue_spec.rb +9 -0
- data/spec/unit/win32/registry_spec.rb +1 -1
- metadata +28 -27
- data/lib/chef/resource/cron.rb +0 -157
@@ -23,8 +23,19 @@ class Chef
|
|
23
23
|
class WindowsAutorun < Chef::Resource
|
24
24
|
provides(:windows_auto_run) { true }
|
25
25
|
|
26
|
-
description "Use the windows_auto_run resource to set applications to run at login."
|
26
|
+
description "Use the **windows_auto_run** resource to set applications to run at login."
|
27
27
|
introduced "14.0"
|
28
|
+
examples <<~DOC
|
29
|
+
**Run BGInfo at login**
|
30
|
+
|
31
|
+
```ruby
|
32
|
+
windows_auto_run 'BGINFO' do
|
33
|
+
program 'C:/Sysinternals/bginfo.exe'
|
34
|
+
args '\'C:/Sysinternals/Config.bgi\' /NOLICPROMPT /TIMER:0'
|
35
|
+
action :create
|
36
|
+
end
|
37
|
+
```
|
38
|
+
DOC
|
28
39
|
|
29
40
|
property :program_name, String,
|
30
41
|
description: "The name of the program to run at login if it differs from the resource block's name.",
|
@@ -32,7 +43,7 @@ class Chef
|
|
32
43
|
|
33
44
|
property :path, String,
|
34
45
|
coerce: proc { |x| x.tr("/", "\\") }, # make sure we have windows paths for the registry
|
35
|
-
description: "The path to the program that will run at login.
|
46
|
+
description: "The path to the program that will run at login."
|
36
47
|
|
37
48
|
property :args, String,
|
38
49
|
description: "Any arguments to be used with the program."
|
@@ -28,8 +28,34 @@ class Chef
|
|
28
28
|
class WindowsCertificate < Chef::Resource
|
29
29
|
provides :windows_certificate
|
30
30
|
|
31
|
-
description "Use the windows_certificate resource to install a certificate into the Windows certificate store from a file. The resource grants read-only access to the private key for designated accounts. Due to current limitations in WinRM, installing certificates remotely may not work if the operation requires a user profile. Operations on the local machine store should still work."
|
31
|
+
description "Use the **windows_certificate** resource to install a certificate into the Windows certificate store from a file. The resource grants read-only access to the private key for designated accounts. Due to current limitations in WinRM, installing certificates remotely may not work if the operation requires a user profile. Operations on the local machine store should still work."
|
32
32
|
introduced "14.7"
|
33
|
+
examples <<~DOC
|
34
|
+
**Add PFX cert to local machine personal store and grant accounts read-only access to private key**
|
35
|
+
|
36
|
+
```ruby
|
37
|
+
windows_certificate 'c:/test/mycert.pfx' do
|
38
|
+
pfx_password 'password'
|
39
|
+
private_key_acl ["acme\\fred", "pc\\jane"]
|
40
|
+
end
|
41
|
+
```
|
42
|
+
|
43
|
+
**Add cert to trusted intermediate store**
|
44
|
+
|
45
|
+
```ruby
|
46
|
+
windows_certificate 'c:/test/mycert.cer' do
|
47
|
+
store_name 'CA'
|
48
|
+
end
|
49
|
+
```
|
50
|
+
|
51
|
+
**Remove all certificates matching the subject**
|
52
|
+
|
53
|
+
```ruby
|
54
|
+
windows_certificate 'me.acme.com' do
|
55
|
+
action :delete
|
56
|
+
end
|
57
|
+
```
|
58
|
+
DOC
|
33
59
|
|
34
60
|
property :source, String,
|
35
61
|
description: "The source file (for create and acl_add), thumbprint (for delete and acl_add) or subject (for delete) if it differs from the resource block's name.",
|
@@ -308,7 +334,7 @@ class Chef
|
|
308
334
|
#
|
309
335
|
def import_certificates(cert_objs, is_pfx)
|
310
336
|
[cert_objs].flatten.each do |cert_obj|
|
311
|
-
thumbprint = OpenSSL::Digest
|
337
|
+
thumbprint = OpenSSL::Digest.new("SHA1", cert_obj.to_der).to_s # Fetch its thumbprint
|
312
338
|
# Need to check if return value is Boolean:true
|
313
339
|
# If not then the given certificate should be added in certstore
|
314
340
|
if verify_cert(thumbprint) == true
|
@@ -23,7 +23,7 @@ class Chef
|
|
23
23
|
class WindowsDfsFolder < Chef::Resource
|
24
24
|
provides :windows_dfs_folder
|
25
25
|
|
26
|
-
description "
|
26
|
+
description "Use the **windows_dfs_folder** resource to creates a folder within DFS as many levels deep as required."
|
27
27
|
introduced "15.0"
|
28
28
|
|
29
29
|
property :folder_path, String,
|
@@ -23,7 +23,7 @@ class Chef
|
|
23
23
|
class WindowsDfsNamespace < Chef::Resource
|
24
24
|
provides :windows_dfs_namespace
|
25
25
|
|
26
|
-
description "
|
26
|
+
description "Use the **windows_dfs_namespace** resource to creates a share and DFS namespace on a Windows server."
|
27
27
|
introduced "15.0"
|
28
28
|
|
29
29
|
property :namespace_name, String,
|
@@ -23,7 +23,7 @@ class Chef
|
|
23
23
|
class WindowsDfsServer < Chef::Resource
|
24
24
|
provides :windows_dfs_server
|
25
25
|
|
26
|
-
description "
|
26
|
+
description "Use the **windows_dfs_server** resource to set system-wide DFS settings."
|
27
27
|
introduced "15.0"
|
28
28
|
|
29
29
|
property :use_fqdn, [TrueClass, FalseClass],
|
@@ -50,7 +50,7 @@ class Chef
|
|
50
50
|
ps_results = powershell_out("Get-DfsnServerConfiguration -ComputerName '#{ENV["COMPUTERNAME"]}' | Select LdapTimeoutSec, PreferLogonDC, EnableSiteCostedReferrals, SyncIntervalSec, UseFqdn | ConvertTo-Json")
|
51
51
|
|
52
52
|
if ps_results.error?
|
53
|
-
raise "The dfs_server resource failed to fetch the current state via the Get-DfsnServerConfiguration PowerShell
|
53
|
+
raise "The dfs_server resource failed to fetch the current state via the Get-DfsnServerConfiguration PowerShell cmdlet. Is the DFS Windows feature installed?"
|
54
54
|
end
|
55
55
|
|
56
56
|
Chef::Log.debug("The Get-DfsnServerConfiguration results were #{ps_results.stdout}")
|
@@ -25,7 +25,16 @@ class Chef
|
|
25
25
|
provides :windows_env
|
26
26
|
provides :env # backwards compat with the pre-Chef 14 resource name
|
27
27
|
|
28
|
-
description "Use the windows_env resource to manage environment keys in Microsoft Windows. After an environment key is set, Microsoft Windows must be restarted before the environment key will be available to the Task Scheduler."
|
28
|
+
description "Use the **windows_env** resource to manage environment keys in Microsoft Windows. After an environment key is set, Microsoft Windows must be restarted before the environment key will be available to the Task Scheduler."
|
29
|
+
examples <<~DOC
|
30
|
+
**Set an environment variable**:
|
31
|
+
|
32
|
+
```ruby
|
33
|
+
windows_env 'ComSpec' do
|
34
|
+
value 'C:\\Windows\\system32\\cmd.exe'
|
35
|
+
end
|
36
|
+
```
|
37
|
+
DOC
|
29
38
|
|
30
39
|
default_action :create
|
31
40
|
allowed_actions :create, :delete, :modify
|
@@ -23,8 +23,63 @@ class Chef
|
|
23
23
|
class WindowsFeature < Chef::Resource
|
24
24
|
provides(:windows_feature) { true }
|
25
25
|
|
26
|
-
description "Use the windows_feature resource to add, remove or entirely delete Windows features and roles. This resource calls the 'windows_feature_dism' or 'windows_feature_powershell' resources depending on the specified installation method, and defaults to DISM, which is available on both Workstation and Server editions of Windows."
|
26
|
+
description "Use the **windows_feature** resource to add, remove or entirely delete Windows features and roles. This resource calls the 'windows_feature_dism' or 'windows_feature_powershell' resources depending on the specified installation method, and defaults to DISM, which is available on both Workstation and Server editions of Windows."
|
27
27
|
introduced "14.0"
|
28
|
+
examples <<~DOC
|
29
|
+
**Install the DHCP Server feature**:
|
30
|
+
|
31
|
+
```ruby
|
32
|
+
windows_feature 'DHCPServer' do
|
33
|
+
action :install
|
34
|
+
end
|
35
|
+
```
|
36
|
+
|
37
|
+
**Install the .Net 3.5.1 feature using repository files on DVD**:
|
38
|
+
|
39
|
+
```ruby
|
40
|
+
windows_feature "NetFx3" do
|
41
|
+
action :install
|
42
|
+
source 'd:\\sources\\sxs'
|
43
|
+
end
|
44
|
+
```
|
45
|
+
|
46
|
+
**Remove Telnet Server and Client features**:
|
47
|
+
|
48
|
+
```ruby
|
49
|
+
windows_feature %w(TelnetServer TelnetClient) do
|
50
|
+
action :remove
|
51
|
+
end
|
52
|
+
```
|
53
|
+
|
54
|
+
**Add the SMTP Server feature using the PowerShell provider**:
|
55
|
+
|
56
|
+
```ruby
|
57
|
+
windows_feature 'smtp-server' do
|
58
|
+
action :install
|
59
|
+
all true
|
60
|
+
install_method :windows_feature_powershell
|
61
|
+
end
|
62
|
+
```
|
63
|
+
|
64
|
+
**Install multiple features using one resource with the PowerShell provider**:
|
65
|
+
|
66
|
+
```ruby
|
67
|
+
windows_feature %w(Web-Asp-Net45 Web-Net-Ext45) do
|
68
|
+
action :install
|
69
|
+
install_method :windows_feature_powershell
|
70
|
+
end
|
71
|
+
```
|
72
|
+
|
73
|
+
**Install the Network Policy and Access Service feature, including the management tools**:
|
74
|
+
|
75
|
+
```ruby
|
76
|
+
windows_feature 'NPAS' do
|
77
|
+
action :install
|
78
|
+
management_tools true
|
79
|
+
install_method :windows_feature_powershell
|
80
|
+
end
|
81
|
+
```
|
82
|
+
DOC
|
28
83
|
|
29
84
|
property :feature_name, [Array, String],
|
30
85
|
description: "The name of the feature(s) or role(s) to install if they differ from the resource block's name. The same feature may have different names depending on the underlying installation method being used (ie DHCPServer vs DHCP; DNS-Server-Full-Role vs DNS).",
|
@@ -42,7 +97,7 @@ class Chef
|
|
42
97
|
default: false
|
43
98
|
|
44
99
|
property :install_method, Symbol,
|
45
|
-
description: "The underlying installation method to use for feature installation. Specify
|
100
|
+
description: "The underlying installation method to use for feature installation. Specify `:windows_feature_dism` for DISM or `:windows_feature_powershell` for PowerShell.",
|
46
101
|
equal_to: %i{windows_feature_dism windows_feature_powershell windows_feature_servermanagercmd},
|
47
102
|
default: :windows_feature_dism
|
48
103
|
|
@@ -24,8 +24,21 @@ class Chef
|
|
24
24
|
class WindowsFeatureDism < Chef::Resource
|
25
25
|
provides(:windows_feature_dism) { true }
|
26
26
|
|
27
|
-
description "Use the windows_feature_dism resource to add, remove, or entirely delete Windows features and roles using DISM."
|
27
|
+
description "Use the **windows_feature_dism** resource to add, remove, or entirely delete Windows features and roles using DISM."
|
28
28
|
introduced "14.0"
|
29
|
+
examples <<~DOC
|
30
|
+
**Installing the TelnetClient service**:
|
31
|
+
|
32
|
+
```ruby
|
33
|
+
windows_feature_dism "TelnetClient"
|
34
|
+
```
|
35
|
+
|
36
|
+
**Installing two features by using an array**:
|
37
|
+
|
38
|
+
```ruby
|
39
|
+
windows_feature_dism %w(TelnetClient TFTP)
|
40
|
+
```
|
41
|
+
DOC
|
29
42
|
|
30
43
|
property :feature_name, [Array, String],
|
31
44
|
description: "The name of the feature(s) or role(s) to install if they differ from the resource name.",
|
@@ -36,7 +49,7 @@ class Chef
|
|
36
49
|
description: "Specify a local repository for the feature install."
|
37
50
|
|
38
51
|
property :all, [TrueClass, FalseClass],
|
39
|
-
description: "Install all sub-features. When set to
|
52
|
+
description: "Install all sub-features. When set to `true`, this is the equivalent of specifying the `/All` switch to `dism.exe`",
|
40
53
|
default: false
|
41
54
|
|
42
55
|
property :timeout, Integer,
|
@@ -25,8 +25,35 @@ class Chef
|
|
25
25
|
class WindowsFeaturePowershell < Chef::Resource
|
26
26
|
provides(:windows_feature_powershell) { true }
|
27
27
|
|
28
|
-
description "Use the windows_feature_powershell resource to add, remove, or entirely delete Windows features and roles using PowerShell. This resource offers significant speed benefits over the windows_feature_dism resource, but requires installation of the Remote Server Administration Tools on non-server releases of Windows."
|
28
|
+
description "Use the **windows_feature_powershell** resource to add, remove, or entirely delete Windows features and roles using PowerShell. This resource offers significant speed benefits over the windows_feature_dism resource, but requires installation of the Remote Server Administration Tools on non-server releases of Windows."
|
29
29
|
introduced "14.0"
|
30
|
+
examples <<~DOC
|
31
|
+
**Add the SMTP Server feature**:
|
32
|
+
|
33
|
+
```ruby
|
34
|
+
windows_feature_powershell "smtp-server" do
|
35
|
+
action :install
|
36
|
+
all true
|
37
|
+
end
|
38
|
+
```
|
39
|
+
|
40
|
+
**Install multiple features using one resource**:
|
41
|
+
|
42
|
+
```ruby
|
43
|
+
windows_feature_powershell ['Web-Asp-Net45', 'Web-Net-Ext45'] do
|
44
|
+
action :install
|
45
|
+
end
|
46
|
+
```
|
47
|
+
|
48
|
+
**Install the Network Policy and Access Service feature**:
|
49
|
+
|
50
|
+
```ruby
|
51
|
+
windows_feature_powershell 'NPAS' do
|
52
|
+
action :install
|
53
|
+
management_tools true
|
54
|
+
end
|
55
|
+
```
|
56
|
+
DOC
|
30
57
|
|
31
58
|
property :feature_name, [Array, String],
|
32
59
|
description: "The name of the feature(s) or role(s) to install if they differ from the resource block's name.",
|
@@ -37,7 +64,7 @@ class Chef
|
|
37
64
|
description: "Specify a local repository for the feature install."
|
38
65
|
|
39
66
|
property :all, [TrueClass, FalseClass],
|
40
|
-
description: "Install all subfeatures. When set to
|
67
|
+
description: "Install all subfeatures. When set to `true`, this is the equivalent of specifying the `-InstallAllSubFeatures` switch with `Add-WindowsFeature`.",
|
41
68
|
default: false
|
42
69
|
|
43
70
|
property :timeout, Integer,
|
@@ -26,10 +26,11 @@ class Chef
|
|
26
26
|
class WindowsFirewallRule < Chef::Resource
|
27
27
|
provides :windows_firewall_rule
|
28
28
|
|
29
|
-
description "Use the windows_firewall_rule resource to create, change or remove Windows firewall rules."
|
29
|
+
description "Use the **windows_firewall_rule** resource to create, change or remove Windows firewall rules."
|
30
30
|
introduced "14.7"
|
31
31
|
examples <<~DOC
|
32
|
-
Allowing port 80 access
|
32
|
+
**Allowing port 80 access**:
|
33
|
+
|
33
34
|
```ruby
|
34
35
|
windows_firewall_rule 'IIS' do
|
35
36
|
local_port '80'
|
@@ -38,7 +39,8 @@ class Chef
|
|
38
39
|
end
|
39
40
|
```
|
40
41
|
|
41
|
-
Allow protocol ICMPv6 with ICMP Type
|
42
|
+
**Allow protocol ICMPv6 with ICMP Type**:
|
43
|
+
|
42
44
|
```ruby
|
43
45
|
windows_firewall_rule 'CoreNet-Rule' do
|
44
46
|
rule_name 'CoreNet-ICMP6-LR2-In'
|
@@ -49,7 +51,8 @@ class Chef
|
|
49
51
|
end
|
50
52
|
```
|
51
53
|
|
52
|
-
Blocking WinRM over HTTP on a particular IP
|
54
|
+
**Blocking WinRM over HTTP on a particular IP**:
|
55
|
+
|
53
56
|
```ruby
|
54
57
|
windows_firewall_rule 'Disable WinRM over HTTP' do
|
55
58
|
local_port '5985'
|
@@ -59,7 +62,8 @@ class Chef
|
|
59
62
|
end
|
60
63
|
```
|
61
64
|
|
62
|
-
Deleting an existing rule
|
65
|
+
**Deleting an existing rule**
|
66
|
+
|
63
67
|
```ruby
|
64
68
|
windows_firewall_rule 'Remove the SSH rule' do
|
65
69
|
rule_name 'ssh'
|
@@ -89,7 +93,7 @@ class Chef
|
|
89
93
|
description: "The local address the firewall rule applies to."
|
90
94
|
|
91
95
|
property :local_port, [String, Integer, Array],
|
92
|
-
|
96
|
+
# split various formats of comma separated lists and provide a sorted array of strings to match PS output
|
93
97
|
coerce: proc { |d| d.is_a?(String) ? d.split(/\s*,\s*/).sort : Array(d).sort.map(&:to_s) },
|
94
98
|
description: "The local port the firewall rule applies to."
|
95
99
|
|
@@ -97,7 +101,7 @@ class Chef
|
|
97
101
|
description: "The remote address the firewall rule applies to."
|
98
102
|
|
99
103
|
property :remote_port, [String, Integer, Array],
|
100
|
-
|
104
|
+
# split various formats of comma separated lists and provide a sorted array of strings to match PS output
|
101
105
|
coerce: proc { |d| d.is_a?(String) ? d.split(/\s*,\s*/).sort : Array(d).sort.map(&:to_s) },
|
102
106
|
description: "The remote port the firewall rule applies to."
|
103
107
|
|
@@ -24,8 +24,17 @@ class Chef
|
|
24
24
|
|
25
25
|
provides(:windows_font) { true }
|
26
26
|
|
27
|
-
description "Use the windows_font resource to install font files on Windows. By default, the font is sourced from the cookbook using the resource, but a URI source can be specified as well."
|
27
|
+
description "Use the **windows_font** resource to install font files on Windows. By default, the font is sourced from the cookbook using the resource, but a URI source can be specified as well."
|
28
28
|
introduced "14.0"
|
29
|
+
examples <<~DOC
|
30
|
+
**Install a font from a https source**:
|
31
|
+
|
32
|
+
```ruby
|
33
|
+
windows_font 'Custom.otf' do
|
34
|
+
source "https://example.com/Custom.otf"
|
35
|
+
end
|
36
|
+
```
|
37
|
+
DOC
|
29
38
|
|
30
39
|
property :font_name, String,
|
31
40
|
description: "An optional property to set the name of the font to install if it differs from the resource block's name.",
|
@@ -33,7 +42,7 @@ class Chef
|
|
33
42
|
|
34
43
|
property :source, String,
|
35
44
|
description: "A local filesystem path or URI that is used to source the font file.",
|
36
|
-
coerce: proc { |x| x
|
45
|
+
coerce: proc { |x| /^.:.*/.match?(x) ? x.tr('\\', "/").gsub("//", "/") : x }
|
37
46
|
|
38
47
|
action :install do
|
39
48
|
description "Install a font to the system fonts directory."
|
@@ -75,7 +84,7 @@ class Chef
|
|
75
84
|
|
76
85
|
# install the font into the appropriate fonts directory
|
77
86
|
def install_font
|
78
|
-
require "win32ole" if RUBY_PLATFORM
|
87
|
+
require "win32ole" if RUBY_PLATFORM.match?(/mswin|mingw32|windows/)
|
79
88
|
fonts_dir = Chef::Util::PathHelper.join(ENV["windir"], "fonts")
|
80
89
|
folder = WIN32OLE.new("Shell.Application").Namespace(fonts_dir)
|
81
90
|
converge_by("install font #{new_resource.font_name} to #{fonts_dir}") do
|
@@ -87,7 +96,7 @@ class Chef
|
|
87
96
|
#
|
88
97
|
# @return [Boolean] Is the font is installed?
|
89
98
|
def font_exists?
|
90
|
-
require "win32ole" if RUBY_PLATFORM
|
99
|
+
require "win32ole" if RUBY_PLATFORM.match?(/mswin|mingw32|windows/)
|
91
100
|
fonts_dir = WIN32OLE.new("WScript.Shell").SpecialFolders("Fonts")
|
92
101
|
logger.trace("Seeing if the font at #{Chef::Util::PathHelper.join(fonts_dir, new_resource.font_name)} exists")
|
93
102
|
::File.exist?(Chef::Util::PathHelper.join(fonts_dir, new_resource.font_name))
|
@@ -19,7 +19,7 @@
|
|
19
19
|
require_relative "../mixin/uris"
|
20
20
|
require_relative "package"
|
21
21
|
require_relative "../provider/package/windows"
|
22
|
-
require_relative "../win32/error" if RUBY_PLATFORM
|
22
|
+
require_relative "../win32/error" if RUBY_PLATFORM.match?(/mswin|mingw|windows/)
|
23
23
|
require_relative "../dist"
|
24
24
|
|
25
25
|
class Chef
|
@@ -30,8 +30,68 @@ class Chef
|
|
30
30
|
provides(:windows_package) { true }
|
31
31
|
provides :package, os: "windows"
|
32
32
|
|
33
|
-
description "Use the windows_package resource to manage packages on the Microsoft Windows platform. The windows_package resource supports these installer formats:\n\n Microsoft Installer Package (MSI)\n Nullsoft Scriptable Install System (NSIS)\n Inno Setup (inno)\n Wise\n InstallShield\n Custom installers such as installing a non-.msi file that embeds an .msi-based installer\n"
|
33
|
+
description "Use the **windows_package** resource to manage packages on the Microsoft Windows platform. The windows_package resource supports these installer formats:\n\n Microsoft Installer Package (MSI)\n Nullsoft Scriptable Install System (NSIS)\n Inno Setup (inno)\n Wise\n InstallShield\n Custom installers such as installing a non-.msi file that embeds an .msi-based installer\n"
|
34
34
|
introduced "11.12"
|
35
|
+
examples <<~DOC
|
36
|
+
**Install a package**:
|
37
|
+
|
38
|
+
```ruby
|
39
|
+
windows_package '7zip' do
|
40
|
+
action :install
|
41
|
+
source 'C:\\7z920.msi'
|
42
|
+
end
|
43
|
+
```
|
44
|
+
|
45
|
+
**Specify a URL for the source attribute**:
|
46
|
+
|
47
|
+
```ruby
|
48
|
+
windows_package '7zip' do
|
49
|
+
source 'http://www.7-zip.org/a/7z938-x64.msi'
|
50
|
+
end
|
51
|
+
```
|
52
|
+
|
53
|
+
**Specify path and checksum**:
|
54
|
+
|
55
|
+
```ruby
|
56
|
+
windows_package '7zip' do
|
57
|
+
source 'http://www.7-zip.org/a/7z938-x64.msi'
|
58
|
+
checksum '7c8e873991c82ad9cfc123415254ea6101e9a645e12977dcd518979e50fdedf3'
|
59
|
+
end
|
60
|
+
```
|
61
|
+
|
62
|
+
**Modify remote_file resource attributes**:
|
63
|
+
|
64
|
+
The windows_package resource may specify a package at a remote location using the remote_file_attributes property. This uses the remote_file resource to download the contents at the specified URL and passes in a Hash that modifies the properties of the remote_file resource.
|
65
|
+
|
66
|
+
```ruby
|
67
|
+
windows_package '7zip' do
|
68
|
+
source 'http://www.7-zip.org/a/7z938-x64.msi'
|
69
|
+
remote_file_attributes ({
|
70
|
+
:path => 'C:\\7zip.msi',
|
71
|
+
:checksum => '7c8e873991c82ad9cfc123415254ea6101e9a645e12977dcd518979e50fdedf3'
|
72
|
+
})
|
73
|
+
end
|
74
|
+
```
|
75
|
+
|
76
|
+
**Download a nsis (Nullsoft) package resource**:
|
77
|
+
|
78
|
+
```ruby
|
79
|
+
windows_package 'Mercurial 3.6.1 (64-bit)' do
|
80
|
+
source 'http://mercurial.selenic.com/release/windows/Mercurial-3.6.1-x64.exe'
|
81
|
+
checksum 'febd29578cb6736163d232708b834a2ddd119aa40abc536b2c313fc5e1b5831d'
|
82
|
+
end
|
83
|
+
```
|
84
|
+
|
85
|
+
**Download a custom package**:
|
86
|
+
|
87
|
+
```ruby
|
88
|
+
windows_package 'Microsoft Visual C++ 2005 Redistributable' do
|
89
|
+
source 'https://download.microsoft.com/download/6/B/B/6BB661D6-A8AE-4819-B79F-236472F6070C/vcredist_x86.exe'
|
90
|
+
installer_type :custom
|
91
|
+
options '/Q'
|
92
|
+
end
|
93
|
+
```
|
94
|
+
DOC
|
35
95
|
|
36
96
|
allowed_actions :install, :remove
|
37
97
|
|
@@ -44,8 +104,8 @@ class Chef
|
|
44
104
|
description: "An optional property to set the package name if it differs from the resource block's name.",
|
45
105
|
identity: true
|
46
106
|
|
47
|
-
|
48
|
-
|
107
|
+
# we don't redefine the version property as a string here since we store the current value
|
108
|
+
# of version and that may be an array if multiple versions of a package are present on the system
|
49
109
|
|
50
110
|
# windows can't take array options yet
|
51
111
|
property :options, String,
|
@@ -75,11 +135,11 @@ class Chef
|
|
75
135
|
end
|
76
136
|
end),
|
77
137
|
default_description: "The resource block's name", # this property is basically a name_property but not really so we need to spell it out
|
78
|
-
description: "The path to a package in the local file system. The location of the package may be at a URL.
|
138
|
+
description: "The path to a package in the local file system. The location of the package may be at a URL."
|
79
139
|
|
80
140
|
property :checksum, String,
|
81
141
|
desired_state: false, coerce: (proc { |c| c.downcase }),
|
82
|
-
description: "The SHA-256 checksum of the file. Use to prevent a file from being re-downloaded. When the local file matches the checksum, #{Chef::Dist::PRODUCT} does not download it. Use when a URL is specified by the source property."
|
142
|
+
description: "The SHA-256 checksum of the file. Use to prevent a file from being re-downloaded. When the local file matches the checksum, #{Chef::Dist::PRODUCT} does not download it. Use when a URL is specified by the `source` property."
|
83
143
|
|
84
144
|
property :remote_file_attributes, Hash,
|
85
145
|
desired_state: false,
|