chef 17.10.163 → 18.7.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile +25 -21
- data/README.md +7 -7
- data/Rakefile +3 -22
- data/{chef-universal-mingw32.gemspec → chef-universal-mingw-ucrt.gemspec} +7 -6
- data/chef.gemspec +33 -27
- data/lib/chef/api_client_v1.rb +9 -1
- data/lib/chef/application/base.rb +20 -2
- data/lib/chef/application/exit_code.rb +3 -3
- data/lib/chef/chef_fs/file_pattern.rb +1 -1
- data/lib/chef/chef_fs/file_system.rb +21 -7
- data/lib/chef/chef_fs/path_utils.rb +7 -9
- data/lib/chef/client.rb +186 -2
- data/lib/chef/compliance/default_attributes.rb +2 -2
- data/lib/chef/compliance/input.rb +1 -1
- data/lib/chef/compliance/profile.rb +1 -1
- data/lib/chef/compliance/profile_collection.rb +0 -1
- data/lib/chef/compliance/runner.rb +6 -1
- data/lib/chef/compliance/waiver.rb +1 -1
- data/lib/chef/cookbook/chefignore.rb +4 -1
- data/lib/chef/cookbook/cookbook_version_loader.rb +1 -1
- data/lib/chef/cookbook/metadata.rb +1 -1
- data/lib/chef/cookbook/remote_file_vendor.rb +1 -3
- data/lib/chef/cookbook/synchronizer.rb +21 -3
- data/lib/chef/cookbook/syntax_check.rb +2 -2
- data/lib/chef/cookbook_manifest.rb +2 -2
- data/lib/chef/cookbook_version.rb +1 -1
- data/lib/chef/data_collector.rb +14 -0
- data/lib/chef/delayed_evaluator.rb +4 -0
- data/lib/chef/dsl/reader_helpers.rb +1 -1
- data/lib/chef/dsl/rest_resource.rb +77 -0
- data/lib/chef/event_dispatch/base.rb +3 -0
- data/lib/chef/event_dispatch/dispatcher.rb +0 -1
- data/lib/chef/exceptions.rb +9 -1
- data/lib/chef/file_access_control/windows.rb +4 -1
- data/lib/chef/file_cache.rb +17 -2
- data/lib/chef/formatters/doc.rb +1 -1
- data/lib/chef/guard_interpreter/resource_guard_interpreter.rb +2 -0
- data/lib/chef/http/authenticator.rb +253 -3
- data/lib/chef/http/ssl_policies.rb +2 -2
- data/lib/chef/mixin/{homebrew_user.rb → homebrew.rb} +13 -16
- data/lib/chef/mixin/openssl_helper.rb +1 -16
- data/lib/chef/mixin/powershell_exec.rb +5 -28
- data/lib/chef/monkey_patches/net-http.rb +127 -0
- data/lib/chef/node/attribute.rb +3 -11
- data/lib/chef/node/attribute_collections.rb +10 -1
- data/lib/chef/node/immutable_collections.rb +17 -6
- data/lib/chef/node/mixin/immutablize_array.rb +1 -0
- data/lib/chef/node/mixin/state_tracking.rb +7 -4
- data/lib/chef/node/mixin/state_tracking_array.rb +41 -0
- data/lib/chef/node.rb +23 -1
- data/lib/chef/platform/query_helpers.rb +4 -2
- data/lib/chef/policy_builder/policyfile.rb +8 -0
- data/lib/chef/property.rb +13 -6
- data/lib/chef/provider/group/windows.rb +1 -1
- data/lib/chef/provider/http_request.rb +11 -9
- data/lib/chef/provider/launchd.rb +2 -1
- data/lib/chef/provider/mount/linux.rb +6 -1
- data/lib/chef/provider/mount/mount.rb +13 -5
- data/lib/chef/provider/mount/windows.rb +1 -1
- data/lib/chef/provider/package/apt.rb +11 -2
- data/lib/chef/provider/package/chocolatey.rb +260 -22
- data/lib/chef/provider/package/dnf/dnf_helper.py +7 -0
- data/lib/chef/provider/package/homebrew.rb +6 -9
- data/lib/chef/provider/package/powershell.rb +1 -0
- data/lib/chef/provider/package/rubygems.rb +5 -1
- data/lib/chef/provider/package/snap.rb +3 -2
- data/lib/chef/provider/package/windows/msi.rb +2 -2
- data/lib/chef/provider/package/windows/registry_uninstall_entry.rb +1 -1
- data/lib/chef/provider/package/yum/yum_helper.py +3 -3
- data/lib/chef/provider/package/zypper/version.rb +60 -0
- data/lib/chef/provider/package/zypper.rb +47 -3
- data/lib/chef/provider/powershell_script.rb +96 -6
- data/lib/chef/provider/registry_key.rb +2 -0
- data/lib/chef/provider/remote_file/http.rb +1 -1
- data/lib/chef/provider/service/systemd.rb +23 -8
- data/lib/chef/provider/service/windows.rb +1 -1
- data/lib/chef/provider/service.rb +14 -0
- data/lib/chef/provider/user/aix.rb +5 -0
- data/lib/chef/provider/user/linux.rb +29 -0
- data/lib/chef/provider/user/mac.rb +1 -1
- data/lib/chef/provider/user/windows.rb +5 -0
- data/lib/chef/provider/user.rb +45 -9
- data/lib/chef/provider/yum_repository.rb +13 -1
- data/lib/chef/provider.rb +1 -1
- data/lib/chef/recipe.rb +4 -12
- data/lib/chef/resource/_rest_resource.rb +389 -0
- data/lib/chef/resource/alternatives.rb +0 -1
- data/lib/chef/resource/apt_package.rb +21 -1
- data/lib/chef/resource/apt_preference.rb +0 -1
- data/lib/chef/resource/apt_repository.rb +138 -18
- data/lib/chef/resource/apt_update.rb +0 -1
- data/lib/chef/resource/archive_file.rb +0 -1
- data/lib/chef/resource/bash.rb +13 -1
- data/lib/chef/resource/batch.rb +0 -1
- data/lib/chef/resource/bff_package.rb +0 -1
- data/lib/chef/resource/breakpoint.rb +0 -1
- data/lib/chef/resource/build_essential.rb +0 -1
- data/lib/chef/resource/cab_package.rb +0 -1
- data/lib/chef/resource/chef_client_config.rb +12 -14
- data/lib/chef/resource/chef_client_cron.rb +1 -2
- data/lib/chef/resource/chef_client_launchd.rb +2 -2
- data/lib/chef/resource/chef_client_scheduled_task.rb +3 -3
- data/lib/chef/resource/chef_client_systemd_timer.rb +5 -1
- data/lib/chef/resource/chef_client_trusted_certificate.rb +0 -1
- data/lib/chef/resource/chef_gem.rb +1 -2
- data/lib/chef/resource/chef_handler.rb +0 -1
- data/lib/chef/resource/chef_sleep.rb +1 -3
- data/lib/chef/resource/chef_vault_secret.rb +0 -1
- data/lib/chef/resource/chocolatey_config.rb +0 -1
- data/lib/chef/resource/chocolatey_feature.rb +0 -1
- data/lib/chef/resource/chocolatey_installer.rb +207 -0
- data/lib/chef/resource/chocolatey_package.rb +8 -1
- data/lib/chef/resource/chocolatey_source.rb +0 -1
- data/lib/chef/resource/cookbook_file.rb +0 -1
- data/lib/chef/resource/cron/_cron_shared.rb +0 -1
- data/lib/chef/resource/cron/cron.rb +0 -1
- data/lib/chef/resource/cron/cron_d.rb +15 -1
- data/lib/chef/resource/cron_access.rb +0 -1
- data/lib/chef/resource/csh.rb +0 -1
- data/lib/chef/resource/directory.rb +0 -1
- data/lib/chef/resource/dmg_package.rb +2 -1
- data/lib/chef/resource/dnf_package.rb +0 -1
- data/lib/chef/resource/dpkg_package.rb +0 -1
- data/lib/chef/resource/dsc_resource.rb +0 -1
- data/lib/chef/resource/dsc_script.rb +1 -2
- data/lib/chef/resource/execute.rb +8 -7
- data/lib/chef/resource/file.rb +0 -1
- data/lib/chef/resource/freebsd_package.rb +2 -1
- data/lib/chef/resource/gem_package.rb +2 -1
- data/lib/chef/resource/group.rb +25 -2
- data/lib/chef/resource/habitat/habitat_package.rb +0 -1
- data/lib/chef/resource/habitat/habitat_sup.rb +6 -7
- data/lib/chef/resource/habitat/habitat_sup_windows.rb +1 -1
- data/lib/chef/resource/habitat_config.rb +0 -1
- data/lib/chef/resource/habitat_install.rb +2 -2
- data/lib/chef/resource/habitat_service.rb +0 -1
- data/lib/chef/resource/habitat_user_toml.rb +0 -1
- data/lib/chef/resource/homebrew_cask.rb +21 -33
- data/lib/chef/resource/homebrew_package.rb +3 -2
- data/lib/chef/resource/homebrew_tap.rb +32 -18
- data/lib/chef/resource/homebrew_update.rb +4 -6
- data/lib/chef/resource/hostname.rb +0 -1
- data/lib/chef/resource/http_request.rb +0 -1
- data/lib/chef/resource/ifconfig.rb +0 -1
- data/lib/chef/resource/inspec_input.rb +0 -1
- data/lib/chef/resource/inspec_waiver.rb +0 -1
- data/lib/chef/resource/inspec_waiver_file_entry.rb +2 -3
- data/lib/chef/resource/ips_package.rb +0 -1
- data/lib/chef/resource/kernel_module.rb +0 -1
- data/lib/chef/resource/ksh.rb +0 -1
- data/lib/chef/resource/launchd.rb +9 -3
- data/lib/chef/resource/link.rb +0 -1
- data/lib/chef/resource/locale.rb +0 -1
- data/lib/chef/resource/log.rb +0 -1
- data/lib/chef/resource/lwrp_base.rb +0 -4
- data/lib/chef/resource/macos_pkg.rb +111 -0
- data/lib/chef/resource/macos_userdefaults.rb +3 -4
- data/lib/chef/resource/macosx_service.rb +0 -1
- data/lib/chef/resource/macports_package.rb +2 -1
- data/lib/chef/resource/mdadm.rb +0 -1
- data/lib/chef/resource/mount.rb +0 -1
- data/lib/chef/resource/msu_package.rb +0 -1
- data/lib/chef/resource/notify_group.rb +0 -2
- data/lib/chef/resource/ohai.rb +0 -1
- data/lib/chef/resource/ohai_hint.rb +0 -1
- data/lib/chef/resource/openbsd_package.rb +2 -1
- data/lib/chef/resource/openssl_dhparam.rb +0 -2
- data/lib/chef/resource/openssl_ec_private_key.rb +0 -2
- data/lib/chef/resource/openssl_ec_public_key.rb +0 -2
- data/lib/chef/resource/openssl_rsa_private_key.rb +0 -2
- data/lib/chef/resource/openssl_rsa_public_key.rb +0 -2
- data/lib/chef/resource/openssl_x509_certificate.rb +0 -2
- data/lib/chef/resource/openssl_x509_crl.rb +0 -2
- data/lib/chef/resource/openssl_x509_request.rb +0 -2
- data/lib/chef/resource/osx_profile.rb +0 -1
- data/lib/chef/resource/package.rb +0 -1
- data/lib/chef/resource/pacman_package.rb +2 -1
- data/lib/chef/resource/paludis_package.rb +0 -1
- data/lib/chef/resource/perl.rb +0 -1
- data/lib/chef/resource/plist.rb +7 -3
- data/lib/chef/resource/portage_package.rb +2 -1
- data/lib/chef/resource/powershell_package.rb +4 -1
- data/lib/chef/resource/powershell_package_source.rb +0 -1
- data/lib/chef/resource/powershell_script.rb +5 -2
- data/lib/chef/resource/python.rb +0 -1
- data/lib/chef/resource/reboot.rb +0 -1
- data/lib/chef/resource/registry_key.rb +6 -1
- data/lib/chef/resource/remote_directory.rb +0 -1
- data/lib/chef/resource/remote_file.rb +0 -1
- data/lib/chef/resource/rhsm_errata.rb +0 -1
- data/lib/chef/resource/rhsm_errata_level.rb +0 -1
- data/lib/chef/resource/rhsm_register.rb +2 -4
- data/lib/chef/resource/rhsm_repo.rb +0 -1
- data/lib/chef/resource/rhsm_subscription.rb +0 -1
- data/lib/chef/resource/route.rb +0 -1
- data/lib/chef/resource/rpm_package.rb +2 -1
- data/lib/chef/resource/ruby.rb +0 -1
- data/lib/chef/resource/ruby_block.rb +0 -1
- data/lib/chef/resource/scm/_scm.rb +0 -2
- data/lib/chef/resource/scm/git.rb +0 -2
- data/lib/chef/resource/scm/subversion.rb +0 -2
- data/lib/chef/resource/script.rb +0 -1
- data/lib/chef/resource/selinux/common_helpers.rb +47 -0
- data/lib/chef/resource/selinux/selinux_debian.erb +18 -0
- data/lib/chef/resource/selinux/selinux_default.erb +15 -0
- data/lib/chef/resource/selinux_boolean.rb +101 -0
- data/lib/chef/resource/selinux_fcontext.rb +160 -0
- data/lib/chef/resource/selinux_install.rb +107 -0
- data/lib/chef/resource/selinux_login.rb +129 -0
- data/lib/chef/resource/selinux_module.rb +143 -0
- data/lib/chef/resource/selinux_permissive.rb +64 -0
- data/lib/chef/resource/selinux_port.rb +118 -0
- data/lib/chef/resource/selinux_state.rb +166 -0
- data/lib/chef/resource/selinux_user.rb +137 -0
- data/lib/chef/resource/service.rb +4 -2
- data/lib/chef/resource/smartos_package.rb +2 -1
- data/lib/chef/resource/snap_package.rb +25 -1
- data/lib/chef/resource/solaris_package.rb +2 -1
- data/lib/chef/resource/ssh_known_hosts_entry.rb +0 -1
- data/lib/chef/resource/sudo.rb +37 -3
- data/lib/chef/resource/support/client.erb +2 -2
- data/lib/chef/resource/support/ulimit.erb +40 -0
- data/lib/chef/resource/swap_file.rb +0 -1
- data/lib/chef/resource/sysctl.rb +2 -2
- data/lib/chef/resource/systemd_unit.rb +0 -1
- data/lib/chef/resource/template.rb +0 -1
- data/lib/chef/resource/timezone.rb +0 -1
- data/lib/chef/resource/user/aix_user.rb +0 -1
- data/lib/chef/resource/user/linux_user.rb +0 -1
- data/lib/chef/resource/user/mac_user.rb +0 -1
- data/lib/chef/resource/user/pw_user.rb +0 -1
- data/lib/chef/resource/user/solaris_user.rb +0 -1
- data/lib/chef/resource/user/windows_user.rb +0 -1
- data/lib/chef/resource/user.rb +10 -1
- data/lib/chef/resource/user_ulimit.rb +38 -1
- data/lib/chef/resource/whyrun_safe_ruby_block.rb +0 -1
- data/lib/chef/resource/windows_ad_join.rb +0 -2
- data/lib/chef/resource/windows_audit_policy.rb +0 -2
- data/lib/chef/resource/windows_auto_run.rb +0 -1
- data/lib/chef/resource/windows_certificate.rb +1 -1
- data/lib/chef/resource/windows_defender.rb +0 -1
- data/lib/chef/resource/windows_defender_exclusion.rb +0 -1
- data/lib/chef/resource/windows_dfs_folder.rb +0 -1
- data/lib/chef/resource/windows_dfs_namespace.rb +0 -1
- data/lib/chef/resource/windows_dfs_server.rb +0 -1
- data/lib/chef/resource/windows_dns_record.rb +0 -1
- data/lib/chef/resource/windows_dns_zone.rb +0 -1
- data/lib/chef/resource/windows_env.rb +0 -1
- data/lib/chef/resource/windows_feature.rb +0 -1
- data/lib/chef/resource/windows_feature_dism.rb +0 -1
- data/lib/chef/resource/windows_feature_powershell.rb +0 -1
- data/lib/chef/resource/windows_firewall_profile.rb +0 -2
- data/lib/chef/resource/windows_firewall_rule.rb +0 -1
- data/lib/chef/resource/windows_font.rb +2 -3
- data/lib/chef/resource/windows_package.rb +3 -4
- data/lib/chef/resource/windows_pagefile.rb +0 -2
- data/lib/chef/resource/windows_path.rb +0 -1
- data/lib/chef/resource/windows_printer.rb +0 -1
- data/lib/chef/resource/windows_printer_port.rb +0 -1
- data/lib/chef/resource/windows_script.rb +0 -2
- data/lib/chef/resource/windows_security_policy.rb +2 -3
- data/lib/chef/resource/windows_service.rb +0 -1
- data/lib/chef/resource/windows_share.rb +0 -1
- data/lib/chef/resource/windows_shortcut.rb +1 -2
- data/lib/chef/resource/windows_task.rb +0 -1
- data/lib/chef/resource/windows_uac.rb +0 -1
- data/lib/chef/resource/windows_update_settings.rb +0 -1
- data/lib/chef/resource/windows_user_privilege.rb +14 -11
- data/lib/chef/resource/windows_workgroup.rb +0 -1
- data/lib/chef/resource/yum_package.rb +2 -1
- data/lib/chef/resource/yum_repository.rb +4 -1
- data/lib/chef/resource/zypper_package.rb +2 -1
- data/lib/chef/resource/zypper_repository.rb +0 -1
- data/lib/chef/resource.rb +23 -5
- data/lib/chef/resource_inspector.rb +25 -7
- data/lib/chef/resource_reporter.rb +4 -0
- data/lib/chef/resources.rb +11 -0
- data/lib/chef/run_context.rb +3 -3
- data/lib/chef/secret_fetcher/azure_key_vault.rb +1 -1
- data/lib/chef/util/powershell/ps_credential.rb +10 -0
- data/lib/chef/version.rb +1 -1
- data/lib/chef/win32/handle.rb +6 -7
- data/lib/chef/win32/registry.rb +12 -4
- data/lib/chef/win32/security.rb +16 -1
- data/spec/data/rubygems.org/sexp_processor-info +2 -1
- data/spec/data/trusted_certs/intermediate.pem +38 -27
- data/spec/functional/resource/cookbook_file_spec.rb +1 -1
- data/spec/functional/resource/dsc_script_spec.rb +1 -1
- data/spec/functional/resource/execute_spec.rb +1 -1
- data/spec/functional/resource/group_spec.rb +26 -42
- data/spec/functional/resource/link_spec.rb +8 -8
- data/spec/functional/resource/plist_spec.rb +25 -0
- data/spec/functional/resource/registry_spec.rb +233 -609
- data/spec/functional/resource/remote_file_spec.rb +1 -1
- data/spec/functional/resource/user/linux_user_spec.rb +127 -0
- data/spec/functional/resource/windows_certificate_spec.rb +1 -1
- data/spec/functional/resource/windows_font_spec.rb +12 -9
- data/spec/functional/resource/yum_package_spec.rb +1 -1
- data/spec/functional/resource/zypper_package_spec.rb +12 -0
- data/spec/functional/shell_spec.rb +1 -2
- data/spec/functional/version_spec.rb +1 -1
- data/spec/functional/win32/registry_spec.rb +0 -3
- data/spec/integration/client/client_spec.rb +88 -3
- data/spec/integration/client/exit_code_spec.rb +1 -1
- data/spec/integration/client/fips_spec.rb +5 -5
- data/spec/integration/client/ipv6_spec.rb +1 -1
- data/spec/integration/client/open_ssl_spec.rb +3 -3
- data/spec/integration/compliance/compliance_spec.rb +1 -1
- data/spec/integration/recipes/accumulator_spec.rb +1 -1
- data/spec/integration/recipes/lwrp_inline_resources_spec.rb +1 -1
- data/spec/integration/recipes/lwrp_spec.rb +1 -1
- data/spec/integration/recipes/notifies_spec.rb +1 -1
- data/spec/integration/recipes/notifying_block_spec.rb +1 -1
- data/spec/integration/recipes/remote_directory.rb +1 -1
- data/spec/integration/recipes/unified_mode_spec.rb +1 -1
- data/spec/integration/recipes/use_partial_spec.rb +2 -1
- data/spec/integration/solo/solo_spec.rb +2 -2
- data/spec/spec_helper.rb +7 -4
- data/spec/support/chef_helpers.rb +2 -2
- data/spec/support/platform_helpers.rb +28 -7
- data/spec/support/ruby_installer.rb +1 -1
- data/spec/support/shared/functional/file_resource.rb +3 -3
- data/spec/support/shared/functional/windows_script.rb +2 -2
- data/spec/tiny_server.rb +5 -2
- data/spec/unit/application/client_spec.rb +0 -10
- data/spec/unit/chef_fs/file_system_spec.rb +2 -0
- data/spec/unit/client_spec.rb +80 -4
- data/spec/unit/compliance/runner_spec.rb +8 -0
- data/spec/unit/cookbook/syntax_check_spec.rb +3 -0
- data/spec/unit/data_collector_spec.rb +106 -2
- data/spec/unit/delayed_evaluator_spec.rb +35 -0
- data/spec/unit/file_cache_spec.rb +64 -0
- data/spec/unit/http/authenticator_spec.rb +121 -0
- data/spec/unit/mixin/homebrew_spec.rb +118 -0
- data/spec/unit/mixin/openssl_helper_spec.rb +5 -0
- data/spec/unit/mixin/powershell_exec_spec.rb +5 -5
- data/spec/unit/node/vivid_mash_spec.rb +42 -0
- data/spec/unit/node_spec.rb +6 -0
- data/spec/unit/platform/query_helpers_spec.rb +2 -17
- data/spec/unit/property/validation_spec.rb +30 -0
- data/spec/unit/provider/apt_repository_spec.rb +48 -12
- data/spec/unit/provider/cron_spec.rb +2 -0
- data/spec/unit/provider/http_request_spec.rb +60 -72
- data/spec/unit/provider/launchd_spec.rb +2 -2
- data/spec/unit/provider/mount/aix_spec.rb +2 -2
- data/spec/unit/provider/mount/linux_spec.rb +15 -4
- data/spec/unit/provider/mount/mount_spec.rb +8 -8
- data/spec/unit/provider/package/apt_spec.rb +18 -13
- data/spec/unit/provider/package/chocolatey_spec.rb +41 -9
- data/spec/unit/provider/package/homebrew_spec.rb +4 -1
- data/spec/unit/provider/package/rpm_spec.rb +2 -2
- data/spec/unit/provider/package/rubygems_spec.rb +1 -1
- data/spec/unit/provider/package/windows_spec.rb +5 -5
- data/spec/unit/provider/package/zypper_spec.rb +32 -0
- data/spec/unit/provider/powershell_script_spec.rb +100 -4
- data/spec/unit/provider/registry_key_spec.rb +17 -17
- data/spec/unit/provider/remote_file/http_spec.rb +4 -4
- data/spec/unit/provider/service/systemd_service_spec.rb +1 -0
- data/spec/unit/provider/user/linux_spec.rb +51 -1
- data/spec/unit/provider/user/windows_spec.rb +1 -0
- data/spec/unit/provider/user_spec.rb +24 -6
- data/spec/unit/resource/apt_repository_spec.rb +5 -0
- data/spec/unit/resource/archive_file_spec.rb +1 -1
- data/spec/unit/resource/chef_client_cron_spec.rb +5 -0
- data/spec/unit/resource/chef_client_launchd_spec.rb +5 -0
- data/spec/unit/resource/chef_client_scheduled_task_spec.rb +5 -0
- data/spec/unit/resource/chef_client_systemd_timer_spec.rb +1 -1
- data/spec/unit/resource/chocolatey_installer_spec.rb +151 -0
- data/spec/unit/resource/cron_d_spec.rb +37 -1
- data/spec/unit/resource/macos_pkg_spec.rb +38 -0
- data/spec/unit/resource/powershell_script_spec.rb +2 -2
- data/spec/unit/resource/rest_resource_spec.rb +381 -0
- data/spec/unit/resource/selinux_boolean_spec.rb +92 -0
- data/spec/unit/resource/selinux_fcontext_spec.rb +65 -0
- data/spec/unit/resource/selinux_install_spec.rb +60 -0
- data/spec/unit/resource/selinux_login_spec.rb +73 -0
- data/spec/unit/resource/selinux_module_spec.rb +55 -0
- data/spec/unit/resource/selinux_permissive_spec.rb +39 -0
- data/spec/unit/resource/selinux_port_spec.rb +42 -0
- data/spec/unit/resource/selinux_state_spec.rb +46 -0
- data/spec/unit/resource/selinux_user_spec.rb +92 -0
- data/spec/unit/resource/sysctl_spec.rb +2 -2
- data/spec/unit/resource/user/linux_user_spec.rb +42 -0
- data/spec/unit/resource/yum_repository_spec.rb +4 -0
- data/spec/unit/resource_inspector_spec.rb +36 -0
- data/spec/unit/resource_reporter_spec.rb +57 -3
- data/spec/unit/resource_spec.rb +94 -2
- data/spec/unit/util/dsc/local_configuration_manager_spec.rb +1 -1
- data/spec/unit/util/powershell/ps_credential_spec.rb +6 -0
- data/tasks/rspec.rb +1 -1
- metadata +126 -44
- data/lib/chef/powershell.rb +0 -81
- data/spec/unit/mixin/homebrew_user_spec.rb +0 -119
- /data/spec/functional/assets/yumrepo/repodata/{01a3b-filelists.sqlite.bz2 → 4632d67cb92636e7575d911c24f0e04d3505a944e97c483abe0c3e73a7c62d33-filelists.sqlite.bz2} +0 -0
- /data/spec/functional/assets/yumrepo/repodata/{6bf96-other.xml.gz → 74599b793e54d877323837d2d81a1c3c594c44e4335f9528234bb490f7b9b439-other.xml.gz} +0 -0
- /data/spec/functional/assets/yumrepo/repodata/{5dc1e-primary.sqlite.bz2 → a845d418f919d2115ab95a56b2c76f6825ad0d0bede49181a55c04f58995d057-primary.sqlite.bz2} +0 -0
- /data/spec/functional/assets/yumrepo/repodata/{7c365-other.sqlite.bz2 → af9b7cf9ef23bd7b43068d74a460f3b5d06753d638e58e4a0c9edc35bfb9cdc4-other.sqlite.bz2} +0 -0
- /data/spec/functional/assets/yumrepo/repodata/{401dc-filelists.xml.gz → bdb4f5f1492a3b9532f22c43110a81500dd744f23da0aec5c33b2a41317c737d-filelists.xml.gz} +0 -0
- /data/spec/functional/assets/yumrepo/repodata/{dabe2-primary.xml.gz → c10d1d34ce99e02f12ec96ef68360543ab1bb7c3cb81a4a2bf78df7d8597e9df-primary.xml.gz} +0 -0
|
@@ -18,19 +18,18 @@
|
|
|
18
18
|
#
|
|
19
19
|
|
|
20
20
|
require_relative "../resource"
|
|
21
|
-
require_relative "../mixin/
|
|
21
|
+
require_relative "../mixin/homebrew"
|
|
22
22
|
|
|
23
23
|
class Chef
|
|
24
24
|
class Resource
|
|
25
25
|
class HomebrewCask < Chef::Resource
|
|
26
|
-
unified_mode true
|
|
27
26
|
|
|
28
27
|
provides(:homebrew_cask) { true }
|
|
29
28
|
|
|
30
29
|
description "Use the **homebrew_cask** resource to install binaries distributed via the Homebrew package manager."
|
|
31
30
|
introduced "14.0"
|
|
32
31
|
|
|
33
|
-
include Chef::Mixin::
|
|
32
|
+
include Chef::Mixin::Homebrew
|
|
34
33
|
|
|
35
34
|
property :cask_name, String,
|
|
36
35
|
description: "An optional property to set the cask name if it differs from the resource block's name.",
|
|
@@ -41,50 +40,36 @@ class Chef
|
|
|
41
40
|
property :options, String,
|
|
42
41
|
description: "Options to pass to the brew command during installation."
|
|
43
42
|
|
|
44
|
-
property :install_cask, [TrueClass, FalseClass],
|
|
45
|
-
description: "Automatically install the Homebrew cask tap, if necessary.",
|
|
46
|
-
default: true
|
|
47
|
-
|
|
48
43
|
property :homebrew_path, String,
|
|
49
|
-
description: "The path to the
|
|
44
|
+
description: "The path to the Homebrew binary."
|
|
50
45
|
|
|
51
46
|
property :owner, [String, Integer],
|
|
52
47
|
description: "The owner of the Homebrew installation.",
|
|
53
48
|
default: lazy { find_homebrew_username },
|
|
54
|
-
default_description: "Calculated default username"
|
|
49
|
+
default_description: "Calculated default username"\
|
|
55
50
|
|
|
56
51
|
action :install, description: "Install an application that is packaged as a Homebrew cask." do
|
|
57
|
-
if new_resource.install_cask
|
|
58
|
-
homebrew_tap "homebrew/cask" do
|
|
59
|
-
homebrew_path homebrew_bin_path(new_resource.homebrew_path)
|
|
60
|
-
owner new_resource.owner
|
|
61
|
-
end
|
|
62
|
-
end
|
|
63
|
-
|
|
64
52
|
unless casked?
|
|
65
53
|
converge_by("install cask #{new_resource.cask_name} #{new_resource.options}") do
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
cwd
|
|
54
|
+
execute "install cask #{new_resource.cask_name}" do
|
|
55
|
+
command "#{homebrew_bin_path(new_resource.homebrew_path)} install --cask #{new_resource.cask_name} #{new_resource.options}"
|
|
56
|
+
user new_resource.owner
|
|
57
|
+
cwd ::Dir.home(new_resource.owner)
|
|
58
|
+
login true
|
|
59
|
+
end
|
|
70
60
|
end
|
|
71
61
|
end
|
|
72
62
|
end
|
|
73
63
|
|
|
74
64
|
action :remove, description: "Remove an application that is packaged as a Homebrew cask." do
|
|
75
|
-
if new_resource.install_cask
|
|
76
|
-
homebrew_tap "homebrew/cask" do
|
|
77
|
-
homebrew_path homebrew_bin_path(new_resource.homebrew_path)
|
|
78
|
-
owner new_resource.owner
|
|
79
|
-
end
|
|
80
|
-
end
|
|
81
|
-
|
|
82
65
|
if casked?
|
|
83
66
|
converge_by("uninstall cask #{new_resource.cask_name}") do
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
cwd
|
|
67
|
+
execute "uninstall cask #{new_resource.cask_name}" do
|
|
68
|
+
command "#{homebrew_bin_path(new_resource.homebrew_path)} uninstall --cask #{new_resource.cask_name}"
|
|
69
|
+
user new_resource.owner
|
|
70
|
+
cwd ::Dir.home(new_resource.owner)
|
|
71
|
+
login true
|
|
72
|
+
end
|
|
88
73
|
end
|
|
89
74
|
end
|
|
90
75
|
end
|
|
@@ -99,10 +84,13 @@ class Chef
|
|
|
99
84
|
# @return [Boolean]
|
|
100
85
|
def casked?
|
|
101
86
|
unscoped_name = new_resource.cask_name.split("/").last
|
|
102
|
-
shell_out!(
|
|
87
|
+
shell_out!(
|
|
88
|
+
"#{homebrew_bin_path(new_resource.homebrew_path)} list --cask 2>/dev/null",
|
|
103
89
|
user: new_resource.owner,
|
|
104
90
|
env: { "HOME" => ::Dir.home(new_resource.owner), "USER" => new_resource.owner },
|
|
105
|
-
cwd: ::Dir.home(new_resource.owner)
|
|
91
|
+
cwd: ::Dir.home(new_resource.owner),
|
|
92
|
+
login: true
|
|
93
|
+
).stdout.split.include?(unscoped_name)
|
|
106
94
|
end
|
|
107
95
|
end
|
|
108
96
|
end
|
|
@@ -24,7 +24,6 @@ require "chef-utils/dist" unless defined?(ChefUtils::Dist)
|
|
|
24
24
|
class Chef
|
|
25
25
|
class Resource
|
|
26
26
|
class HomebrewPackage < Chef::Resource::Package
|
|
27
|
-
unified_mode true
|
|
28
27
|
|
|
29
28
|
provides :homebrew_package
|
|
30
29
|
provides :package, os: "darwin"
|
|
@@ -61,8 +60,10 @@ class Chef
|
|
|
61
60
|
```
|
|
62
61
|
DOC
|
|
63
62
|
|
|
63
|
+
allowed_actions :install, :upgrade, :remove, :purge
|
|
64
|
+
|
|
64
65
|
property :homebrew_user, [ String, Integer ],
|
|
65
|
-
description: "The name or
|
|
66
|
+
description: "The name or UID of the Homebrew owner to be used by #{ChefUtils::Dist::Infra::PRODUCT} when executing a command.\n\n#{ChefUtils::Dist::Infra::PRODUCT}, by default, will attempt to execute a Homebrew command as the owner of the `/usr/local/bin/brew` executable on x86_64 machines or `/opt/homebrew/bin/brew` executable on arm64 machines. If that executable doesn't exist, #{ChefUtils::Dist::Infra::PRODUCT} will attempt to find the user by executing `which brew`. If that executable can't be found, #{ChefUtils::Dist::Infra::PRODUCT} will print an error message: `Couldn't find the 'brew' executable anywhere on the path.`.\n\nSet this property to specify the Homebrew owner for situations where Chef Infra Client cannot automatically detect the correct owner.'"
|
|
66
67
|
|
|
67
68
|
end
|
|
68
69
|
end
|
|
@@ -18,19 +18,18 @@
|
|
|
18
18
|
#
|
|
19
19
|
|
|
20
20
|
require_relative "../resource"
|
|
21
|
-
require_relative "../mixin/
|
|
21
|
+
require_relative "../mixin/homebrew"
|
|
22
22
|
|
|
23
23
|
class Chef
|
|
24
24
|
class Resource
|
|
25
25
|
class HomebrewTap < Chef::Resource
|
|
26
|
-
unified_mode true
|
|
27
26
|
|
|
28
27
|
provides(:homebrew_tap) { true }
|
|
29
28
|
|
|
30
29
|
description "Use the **homebrew_tap** resource to add additional formula repositories to the Homebrew package manager."
|
|
31
30
|
introduced "14.0"
|
|
32
31
|
|
|
33
|
-
include Chef::Mixin::
|
|
32
|
+
include Chef::Mixin::Homebrew
|
|
34
33
|
|
|
35
34
|
property :tap_name, String,
|
|
36
35
|
description: "An optional property to set the tap name if it differs from the resource block's name.",
|
|
@@ -52,10 +51,13 @@ class Chef
|
|
|
52
51
|
action :tap, description: "Add a Homebrew tap." do
|
|
53
52
|
unless tapped?(new_resource.tap_name)
|
|
54
53
|
converge_by("tap #{new_resource.tap_name}") do
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
54
|
+
execute "tap #{new_resource.tap_name}" do
|
|
55
|
+
command "#{homebrew_bin_path(new_resource.homebrew_path)} tap #{new_resource.tap_name} #{new_resource.url || ""}"
|
|
56
|
+
user new_resource.owner
|
|
57
|
+
default_env true
|
|
58
|
+
cwd ::Dir.home(new_resource.owner)
|
|
59
|
+
login true
|
|
60
|
+
end
|
|
59
61
|
end
|
|
60
62
|
end
|
|
61
63
|
end
|
|
@@ -63,21 +65,33 @@ class Chef
|
|
|
63
65
|
action :untap, description: "Remove a Homebrew tap." do
|
|
64
66
|
if tapped?(new_resource.tap_name)
|
|
65
67
|
converge_by("untap #{new_resource.tap_name}") do
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
68
|
+
execute "untap #{new_resource.tap_name}" do
|
|
69
|
+
command "#{homebrew_bin_path(new_resource.homebrew_path)} untap #{new_resource.tap_name}"
|
|
70
|
+
user new_resource.owner
|
|
71
|
+
default_env true
|
|
72
|
+
cwd ::Dir.home(new_resource.owner)
|
|
73
|
+
login true
|
|
74
|
+
end
|
|
70
75
|
end
|
|
71
76
|
end
|
|
72
77
|
end
|
|
73
78
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
79
|
+
action_class do
|
|
80
|
+
# Is the passed tap already tapped
|
|
81
|
+
#
|
|
82
|
+
# @return [Boolean]
|
|
83
|
+
def tapped?(name)
|
|
84
|
+
brew_path = ::File.dirname(homebrew_bin_path(new_resource.homebrew_path))
|
|
85
|
+
base_path = [
|
|
86
|
+
"#{brew_path}/../homebrew",
|
|
87
|
+
"#{brew_path}/../Homebrew",
|
|
88
|
+
"/opt/homebrew",
|
|
89
|
+
"/usr/local/Homebrew",
|
|
90
|
+
"/home/linuxbrew/.linuxbrew",
|
|
91
|
+
].filter_map { |x| x if Dir.exist?(x) }.first
|
|
92
|
+
tap_dir = name.gsub("/", "/homebrew-")
|
|
93
|
+
::File.directory?("#{base_path}/Library/Taps/#{tap_dir}")
|
|
94
|
+
end
|
|
81
95
|
end
|
|
82
96
|
end
|
|
83
97
|
end
|
|
@@ -19,15 +19,13 @@
|
|
|
19
19
|
#
|
|
20
20
|
|
|
21
21
|
require_relative "../resource"
|
|
22
|
-
require_relative "../mixin/
|
|
22
|
+
require_relative "../mixin/homebrew"
|
|
23
23
|
require "chef-utils/dist" unless defined?(ChefUtils::Dist)
|
|
24
24
|
|
|
25
25
|
class Chef
|
|
26
26
|
class Resource
|
|
27
27
|
class HomebrewUpdate < Chef::Resource
|
|
28
|
-
include Chef::Mixin::
|
|
29
|
-
|
|
30
|
-
unified_mode true
|
|
28
|
+
include Chef::Mixin::Homebrew
|
|
31
29
|
|
|
32
30
|
provides(:homebrew_update) { true }
|
|
33
31
|
|
|
@@ -80,9 +78,9 @@ class Chef
|
|
|
80
78
|
end
|
|
81
79
|
|
|
82
80
|
execute "brew update" do
|
|
83
|
-
command
|
|
84
|
-
default_env true
|
|
81
|
+
command "#{homebrew_bin_path} update"
|
|
85
82
|
user find_homebrew_uid
|
|
83
|
+
login true
|
|
86
84
|
notifies :touch, "file[#{BREW_STAMP}]", :immediately
|
|
87
85
|
end
|
|
88
86
|
end
|
|
@@ -24,7 +24,6 @@ class Chef
|
|
|
24
24
|
class Resource
|
|
25
25
|
class InspecWaiverFileEntry < Chef::Resource
|
|
26
26
|
provides :inspec_waiver_file_entry
|
|
27
|
-
unified_mode true
|
|
28
27
|
|
|
29
28
|
description "Use the **inspec_waiver_file_entry** resource to add or remove entries from an InSpec waiver file. This can be used in conjunction with the Compliance Phase."
|
|
30
29
|
introduced "17.1"
|
|
@@ -137,11 +136,11 @@ class Chef
|
|
|
137
136
|
def load_waiver_file_to_hash(file_name)
|
|
138
137
|
if %r{(/|C:\\).*(.yaml|.yml)}i.match?(file_name)
|
|
139
138
|
if ::File.exist?(file_name)
|
|
140
|
-
hash = ::YAML.
|
|
139
|
+
hash = ::YAML.safe_load_file(file_name, permitted_classes: [Date])
|
|
141
140
|
if hash == false || hash.nil? || hash == ""
|
|
142
141
|
{}
|
|
143
142
|
else
|
|
144
|
-
::YAML.
|
|
143
|
+
::YAML.safe_load_file(file_name, permitted_classes: [Date])
|
|
145
144
|
end
|
|
146
145
|
else
|
|
147
146
|
{}
|
data/lib/chef/resource/ksh.rb
CHANGED
|
@@ -21,8 +21,7 @@ require_relative "../resource"
|
|
|
21
21
|
class Chef
|
|
22
22
|
class Resource
|
|
23
23
|
class Launchd < Chef::Resource
|
|
24
|
-
|
|
25
|
-
provides :launchd
|
|
24
|
+
provides :launchd, os: "darwin"
|
|
26
25
|
|
|
27
26
|
description "Use the **launchd** resource to manage system-wide services (daemons) and per-user services (agents) on the macOS platform."
|
|
28
27
|
introduced "12.8"
|
|
@@ -130,6 +129,9 @@ class Chef
|
|
|
130
129
|
property :abandon_process_group, [ TrueClass, FalseClass ],
|
|
131
130
|
description: "If a job dies, all remaining processes with the same process ID may be kept running. Set to true to kill all remaining processes."
|
|
132
131
|
|
|
132
|
+
property :associated_bundle_identifiers, Array,
|
|
133
|
+
description: "This optional key indicates which bundles the Login Items Added by Apps panel associates with the helper executable."
|
|
134
|
+
|
|
133
135
|
property :debug, [ TrueClass, FalseClass ],
|
|
134
136
|
description: "Sets the log mask to `LOG_DEBUG` for this job."
|
|
135
137
|
|
|
@@ -200,7 +202,11 @@ class Chef
|
|
|
200
202
|
description: "The first argument of `execvp`, typically the file name associated with the file to be executed. This value must be specified if `program_arguments` is not specified, and vice-versa."
|
|
201
203
|
|
|
202
204
|
property :program_arguments, Array,
|
|
203
|
-
description: "The second argument of `execvp`. If program is not specified, this property must be specified and will be handled as if it were the first argument."
|
|
205
|
+
description: "The second argument of `execvp`. If program is not specified, this property must be specified and will be handled as if it were the first argument.",
|
|
206
|
+
coerce: proc { |args|
|
|
207
|
+
# Cast all values to a string. Launchd only supports string values
|
|
208
|
+
args.map(&:to_s)
|
|
209
|
+
}
|
|
204
210
|
|
|
205
211
|
property :queue_directories, Array,
|
|
206
212
|
description: "An array of non-empty directories which, if any are modified, will cause a job to be started."
|
data/lib/chef/resource/link.rb
CHANGED
data/lib/chef/resource/locale.rb
CHANGED
|
@@ -21,7 +21,6 @@ require "chef-utils/dist" unless defined?(ChefUtils::Dist)
|
|
|
21
21
|
class Chef
|
|
22
22
|
class Resource
|
|
23
23
|
class Locale < Chef::Resource
|
|
24
|
-
unified_mode true
|
|
25
24
|
provides :locale
|
|
26
25
|
|
|
27
26
|
description "Use the **locale** resource to set the system's locale on Debian and Windows systems. Windows support was added in Chef Infra Client 16.0"
|
data/lib/chef/resource/log.rb
CHANGED
|
@@ -54,10 +54,6 @@ class Chef
|
|
|
54
54
|
resource_class.run_context = run_context
|
|
55
55
|
resource_class.class_from_file(filename)
|
|
56
56
|
|
|
57
|
-
if !resource_class.unified_mode && !deprecated_class(resource_class) && cookbook_name.to_s != "chef_client_updater"
|
|
58
|
-
Chef.deprecated :unified_mode, "The #{resource_class.resource_name} resource in the #{cookbook_name} cookbook should declare `unified_mode true`", filename
|
|
59
|
-
end
|
|
60
|
-
|
|
61
57
|
# Make a useful string for the class (rather than <Class:312894723894>)
|
|
62
58
|
resource_class.instance_eval do
|
|
63
59
|
define_singleton_method(:to_s) do
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
#
|
|
2
|
+
# Author:: Joshua Timberman (<jtimberman@chef.io>)
|
|
3
|
+
# Author:: William Theaker (<william.theaker+chef@gusto.com>)
|
|
4
|
+
# Copyright:: Copyright (c) Chef Software Inc.
|
|
5
|
+
#
|
|
6
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
|
+
# you may not use this file except in compliance with the License.
|
|
8
|
+
# You may obtain a copy of the License at
|
|
9
|
+
#
|
|
10
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
#
|
|
12
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
13
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
+
# See the License for the specific language governing permissions and
|
|
16
|
+
# limitations under the License.
|
|
17
|
+
#
|
|
18
|
+
|
|
19
|
+
require_relative "../resource"
|
|
20
|
+
|
|
21
|
+
class Chef
|
|
22
|
+
class Resource
|
|
23
|
+
class MacosPkg < Chef::Resource
|
|
24
|
+
provides(:macos_pkg) { true }
|
|
25
|
+
|
|
26
|
+
description "Use the **macos_pkg** resource to install a macOS `.pkg` file, optionally downloading it from a remote source. A `package_id` property must be provided for idempotency. Either a `file` or `source` property is required."
|
|
27
|
+
introduced "18.1"
|
|
28
|
+
examples <<~DOC
|
|
29
|
+
**Install osquery**:
|
|
30
|
+
|
|
31
|
+
```ruby
|
|
32
|
+
macos_pkg 'osquery' do
|
|
33
|
+
checksum '1fea8ac9b603851d2e76c5fc73138a468a3075a3002c8cb1fd7fff53b889c4dd'
|
|
34
|
+
package_id 'io.osquery.agent'
|
|
35
|
+
source 'https://pkg.osquery.io/darwin/osquery-5.8.2.pkg'
|
|
36
|
+
action :install
|
|
37
|
+
end
|
|
38
|
+
```
|
|
39
|
+
DOC
|
|
40
|
+
|
|
41
|
+
allowed_actions :install
|
|
42
|
+
default_action :install
|
|
43
|
+
|
|
44
|
+
property :checksum, String,
|
|
45
|
+
description: "The sha256 checksum of the `.pkg` file to download."
|
|
46
|
+
|
|
47
|
+
property :file, String,
|
|
48
|
+
description: "The absolute path to the `.pkg` file on the local system."
|
|
49
|
+
|
|
50
|
+
property :headers, Hash,
|
|
51
|
+
description: "Allows custom HTTP headers (like cookies) to be set on the `remote_file` resource.",
|
|
52
|
+
desired_state: false
|
|
53
|
+
|
|
54
|
+
property :package_id, String,
|
|
55
|
+
description: "The package ID registered with `pkgutil` when a `pkg` or `mpkg` is installed.",
|
|
56
|
+
required: true
|
|
57
|
+
|
|
58
|
+
property :source, String,
|
|
59
|
+
description: "The remote URL used to download the `.pkg` file."
|
|
60
|
+
|
|
61
|
+
property :target, String,
|
|
62
|
+
description: "The device to install the package on.",
|
|
63
|
+
default: "/"
|
|
64
|
+
|
|
65
|
+
load_current_value do |new_resource|
|
|
66
|
+
if shell_out("pkgutil --pkg-info '#{new_resource.package_id}'").exitstatus == 0
|
|
67
|
+
Chef::Log.debug "#{new_resource.package_id} is already installed. To upgrade, try \"sudo pkgutil --forget '#{new_resource.package_id}'\""
|
|
68
|
+
else
|
|
69
|
+
current_value_does_not_exist!
|
|
70
|
+
end
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
action :install, description: "Installs the pkg." do
|
|
74
|
+
if new_resource.source.nil? && new_resource.file.nil?
|
|
75
|
+
raise "Must provide either a file or source property for macos_pkg resources."
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
if current_resource.nil?
|
|
79
|
+
if new_resource.source
|
|
80
|
+
remote_file pkg_file do
|
|
81
|
+
source new_resource.source
|
|
82
|
+
headers new_resource.headers if new_resource.headers
|
|
83
|
+
checksum new_resource.checksum if new_resource.checksum
|
|
84
|
+
end
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
converge_by "install #{pkg_file}" do
|
|
88
|
+
install_cmd = "installer -pkg #{pkg_file} -target #{new_resource.target}"
|
|
89
|
+
|
|
90
|
+
execute install_cmd do
|
|
91
|
+
action :run
|
|
92
|
+
end
|
|
93
|
+
end
|
|
94
|
+
end
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
action_class do
|
|
98
|
+
# @return [String] the path to the pkg file
|
|
99
|
+
def pkg_file
|
|
100
|
+
@pkg_file ||= if new_resource.file.nil?
|
|
101
|
+
uri = URI.parse(new_resource.source)
|
|
102
|
+
filename = ::File.basename(uri.path)
|
|
103
|
+
"#{Chef::Config[:file_cache_path]}/#{filename}"
|
|
104
|
+
else
|
|
105
|
+
new_resource.file
|
|
106
|
+
end
|
|
107
|
+
end
|
|
108
|
+
end
|
|
109
|
+
end
|
|
110
|
+
end
|
|
111
|
+
end
|
|
@@ -23,7 +23,6 @@ autoload :Plist, "plist"
|
|
|
23
23
|
class Chef
|
|
24
24
|
class Resource
|
|
25
25
|
class MacosUserDefaults < Chef::Resource
|
|
26
|
-
unified_mode true
|
|
27
26
|
|
|
28
27
|
# align with apple's marketing department
|
|
29
28
|
provides(:macos_userdefaults) { true }
|
|
@@ -72,7 +71,7 @@ class Chef
|
|
|
72
71
|
|
|
73
72
|
property :global, [TrueClass, FalseClass],
|
|
74
73
|
description: "Determines whether or not the domain is global.",
|
|
75
|
-
deprecated:
|
|
74
|
+
deprecated: "As of Chef Infra Client 17.8 the `global` property is no longer necessary.",
|
|
76
75
|
default: false,
|
|
77
76
|
desired_state: false
|
|
78
77
|
|
|
@@ -94,7 +93,7 @@ class Chef
|
|
|
94
93
|
description: "The value type of the preference key.",
|
|
95
94
|
equal_to: %w{bool string int float array dict},
|
|
96
95
|
desired_state: false,
|
|
97
|
-
deprecated:
|
|
96
|
+
deprecated: "As of Chef Infra Client 17.8 the `type` property is no longer necessary."
|
|
98
97
|
|
|
99
98
|
property :user, [String, Symbol],
|
|
100
99
|
description: "The system user that the default will be applied to. Set :current for current user, :all for all users or pass a valid username",
|
|
@@ -105,7 +104,7 @@ class Chef
|
|
|
105
104
|
description: "Set to true if the setting you wish to modify requires privileged access. This requires passwordless sudo for the `/usr/bin/defaults` command to be setup for the user running #{ChefUtils::Dist::Infra::PRODUCT}.",
|
|
106
105
|
default: false,
|
|
107
106
|
desired_state: false,
|
|
108
|
-
deprecated:
|
|
107
|
+
deprecated: "As of Chef Infra Client 17.8 the `sudo` property is no longer necessary."
|
|
109
108
|
|
|
110
109
|
load_current_value do |new_resource|
|
|
111
110
|
Chef::Log.debug "#load_current_value: attempting to read \"#{new_resource.domain}\" value from preferences to determine state"
|
|
@@ -21,11 +21,12 @@ require_relative "package"
|
|
|
21
21
|
class Chef
|
|
22
22
|
class Resource
|
|
23
23
|
class MacportsPackage < Chef::Resource::Package
|
|
24
|
-
unified_mode true
|
|
25
24
|
provides :macports_package
|
|
26
25
|
|
|
27
26
|
description "Use the **macports_package** resource to manage packages for the macOS platform using the MacPorts package management system."
|
|
28
27
|
|
|
28
|
+
allowed_actions :install, :upgrade, :remove, :purge
|
|
29
|
+
|
|
29
30
|
property :package_name, String,
|
|
30
31
|
description: "An optional property to set the package name if it differs from the resource block's name.",
|
|
31
32
|
identity: true
|
data/lib/chef/resource/mdadm.rb
CHANGED
data/lib/chef/resource/mount.rb
CHANGED
|
@@ -21,8 +21,6 @@ class Chef
|
|
|
21
21
|
class NotifyGroup < Chef::Resource
|
|
22
22
|
provides :notify_group
|
|
23
23
|
|
|
24
|
-
unified_mode true
|
|
25
|
-
|
|
26
24
|
description "The notify_group resource does nothing, and always fires notifications which are set on it. Use it to DRY blocks of notifications that are common to multiple resources, and provide a single target for other resources to notify. Unlike most resources, its default action is :nothing."
|
|
27
25
|
introduced "15.8"
|
|
28
26
|
examples <<~DOC
|
data/lib/chef/resource/ohai.rb
CHANGED
|
@@ -25,7 +25,6 @@ require_relative "../provider/package/openbsd"
|
|
|
25
25
|
class Chef
|
|
26
26
|
class Resource
|
|
27
27
|
class OpenbsdPackage < Chef::Resource::Package
|
|
28
|
-
unified_mode true
|
|
29
28
|
provides :openbsd_package
|
|
30
29
|
provides :package, os: "openbsd"
|
|
31
30
|
|
|
@@ -49,6 +48,8 @@ class Chef
|
|
|
49
48
|
```
|
|
50
49
|
DOC
|
|
51
50
|
|
|
51
|
+
allowed_actions :install, :remove
|
|
52
|
+
|
|
52
53
|
property :package_name, String,
|
|
53
54
|
description: "An optional property to set the package name if it differs from the resource block's name.",
|
|
54
55
|
identity: true
|