chef 17.10.163 → 18.0.169
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +19 -20
- data/README.md +7 -7
- data/Rakefile +3 -22
- data/{chef-universal-mingw32.gemspec → chef-universal-mingw-ucrt.gemspec} +8 -7
- data/chef.gemspec +17 -15
- data/lib/chef/api_client_v1.rb +9 -1
- data/lib/chef/application/exit_code.rb +3 -3
- data/lib/chef/client.rb +182 -0
- 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/waiver.rb +1 -1
- data/lib/chef/cookbook/syntax_check.rb +2 -2
- 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/exceptions.rb +8 -0
- data/lib/chef/http/authenticator.rb +170 -3
- data/lib/chef/http/ssl_policies.rb +4 -4
- data/lib/chef/mixin/checksum.rb +0 -6
- data/lib/chef/mixin/homebrew_user.rb +5 -15
- data/lib/chef/mixin/openssl_helper.rb +13 -17
- data/lib/chef/mixin/powershell_exec.rb +5 -28
- data/lib/chef/node/mixin/immutablize_array.rb +1 -0
- data/lib/chef/property.rb +5 -3
- data/lib/chef/provider/cron.rb +1 -5
- data/lib/chef/provider/file.rb +2 -2
- data/lib/chef/provider/group/windows.rb +1 -1
- data/lib/chef/provider/http_request.rb +11 -9
- data/lib/chef/provider/mount/linux.rb +5 -0
- data/lib/chef/provider/mount/mount.rb +8 -0
- data/lib/chef/provider/mount/windows.rb +1 -1
- data/lib/chef/provider/package/chocolatey.rb +1 -14
- data/lib/chef/provider/package/rubygems.rb +1 -1
- 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/windows.rb +1 -1
- data/lib/chef/provider/package/yum/yum_helper.py +14 -2
- data/lib/chef/provider/package/zypper/version.rb +60 -0
- data/lib/chef/provider/package/zypper.rb +47 -8
- data/lib/chef/provider/service/windows.rb +1 -1
- 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.rb +46 -14
- data/lib/chef/provider.rb +1 -1
- data/lib/chef/recipe.rb +1 -1
- data/lib/chef/resource/_rest_resource.rb +389 -0
- data/lib/chef/resource/alternatives.rb +0 -1
- data/lib/chef/resource/apt_package.rb +0 -1
- data/lib/chef/resource/apt_preference.rb +0 -1
- data/lib/chef/resource/apt_repository.rb +0 -1
- data/lib/chef/resource/apt_update.rb +0 -1
- data/lib/chef/resource/archive_file.rb +0 -1
- data/lib/chef/resource/bash.rb +0 -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 +14 -18
- 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 +1 -2
- data/lib/chef/resource/chef_client_trusted_certificate.rb +0 -1
- data/lib/chef/resource/chef_gem.rb +0 -1
- 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_package.rb +0 -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 +0 -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 +0 -1
- data/lib/chef/resource/execute.rb +0 -1
- data/lib/chef/resource/file.rb +0 -1
- data/lib/chef/resource/freebsd_package.rb +0 -1
- data/lib/chef/resource/gem_package.rb +0 -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 +0 -1
- 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 +8 -8
- data/lib/chef/resource/homebrew_package.rb +1 -2
- data/lib/chef/resource/homebrew_tap.rb +5 -6
- data/lib/chef/resource/homebrew_update.rb +0 -2
- 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 +0 -1
- data/lib/chef/resource/link.rb +0 -1
- data/lib/chef/resource/locale.rb +2 -6
- data/lib/chef/resource/log.rb +0 -1
- data/lib/chef/resource/lwrp_base.rb +0 -4
- data/lib/chef/resource/macos_userdefaults.rb +5 -10
- data/lib/chef/resource/macosx_service.rb +0 -1
- data/lib/chef/resource/macports_package.rb +0 -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 +0 -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 +0 -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 +0 -1
- data/lib/chef/resource/powershell_package.rb +0 -1
- data/lib/chef/resource/powershell_package_source.rb +0 -1
- data/lib/chef/resource/powershell_script.rb +0 -1
- data/lib/chef/resource/python.rb +0 -1
- data/lib/chef/resource/reboot.rb +0 -1
- data/lib/chef/resource/registry_key.rb +0 -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 +0 -3
- 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 +0 -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_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/service.rb +0 -1
- data/lib/chef/resource/smartos_package.rb +0 -1
- data/lib/chef/resource/snap_package.rb +0 -1
- data/lib/chef/resource/solaris_package.rb +0 -1
- data/lib/chef/resource/ssh_known_hosts_entry.rb +0 -1
- data/lib/chef/resource/sudo.rb +0 -1
- data/lib/chef/resource/support/client.erb +5 -6
- data/lib/chef/resource/swap_file.rb +0 -1
- data/lib/chef/resource/sysctl.rb +1 -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 +0 -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_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 +0 -1
- 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 +0 -1
- 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 +0 -1
- data/lib/chef/resource/windows_workgroup.rb +0 -1
- data/lib/chef/resource/yum_package.rb +0 -1
- data/lib/chef/resource/yum_repository.rb +0 -1
- data/lib/chef/resource/zypper_package.rb +0 -1
- data/lib/chef/resource/zypper_repository.rb +0 -1
- data/lib/chef/resource.rb +12 -5
- data/lib/chef/resources.rb +7 -0
- data/lib/chef/run_context.rb +3 -3
- data/lib/chef/secret_fetcher/azure_key_vault.rb +1 -1
- data/lib/chef/version.rb +1 -1
- data/lib/chef/win32/handle.rb +6 -7
- data/lib/chef/win32/registry.rb +7 -3
- data/spec/data/rubygems.org/sexp_processor-info +2 -1
- data/spec/data/trusted_certs/example.crt +20 -29
- data/spec/data/trusted_certs/example_no_cn.crt +34 -30
- data/spec/data/trusted_certs/opscode.pem +54 -33
- data/spec/functional/resource/chocolatey_package_spec.rb +20 -32
- data/spec/functional/resource/dsc_script_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/macos_userdefaults_spec.rb +4 -4
- data/spec/functional/resource/plist_spec.rb +25 -0
- data/spec/functional/resource/user/linux_user_spec.rb +127 -0
- data/spec/functional/resource/windows_certificate_spec.rb +1 -26
- data/spec/functional/resource/windows_font_spec.rb +12 -9
- data/spec/functional/resource/yum_package_spec.rb +1 -17
- data/spec/functional/resource/zypper_package_spec.rb +12 -10
- 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 +82 -3
- data/spec/integration/client/exit_code_spec.rb +1 -1
- data/spec/integration/client/ipv6_spec.rb +1 -1
- 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 +1 -5
- data/spec/support/platform_helpers.rb +0 -4
- data/spec/support/ruby_installer.rb +1 -1
- data/spec/support/shared/functional/windows_script.rb +2 -2
- data/spec/unit/application/client_spec.rb +0 -10
- data/spec/unit/client_spec.rb +70 -2
- data/spec/unit/compliance/reporter/chef_server_automate_spec.rb +1 -1
- data/spec/unit/cookbook/syntax_check_spec.rb +3 -0
- data/spec/unit/http/authenticator_spec.rb +68 -0
- data/spec/unit/mixin/checksum_spec.rb +0 -28
- data/spec/unit/mixin/homebrew_user_spec.rb +7 -30
- data/spec/unit/mixin/openssl_helper_spec.rb +1 -1
- data/spec/unit/mixin/powershell_exec_spec.rb +5 -5
- data/spec/unit/platform/query_helpers_spec.rb +2 -17
- data/spec/unit/provider/cron_spec.rb +0 -34
- data/spec/unit/provider/http_request_spec.rb +60 -72
- data/spec/unit/provider/mount/linux_spec.rb +10 -0
- data/spec/unit/provider/package/chocolatey_spec.rb +3 -20
- data/spec/unit/provider/package/rubygems_spec.rb +1 -1
- data/spec/unit/provider/package/zypper_spec.rb +32 -0
- data/spec/unit/provider/user/linux_spec.rb +51 -11
- data/spec/unit/provider/user_spec.rb +24 -6
- 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 +2 -2
- data/spec/unit/resource/cron_d_spec.rb +37 -1
- data/spec/unit/resource/macos_user_defaults_spec.rb +4 -4
- 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_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/sysctl_spec.rb +2 -2
- data/spec/unit/resource/user/linux_user_spec.rb +42 -0
- data/spec/unit/resource_spec.rb +8 -2
- data/spec/unit/util/dsc/local_configuration_manager_spec.rb +1 -1
- data/tasks/rspec.rb +1 -1
- metadata +106 -55
- data/spec/functional/assets/yumrepo-empty/repodata/01a3b-filelists.sqlite.bz2 +0 -0
- data/spec/functional/assets/yumrepo-empty/repodata/401dc-filelists.xml.gz +0 -0
- data/spec/functional/assets/yumrepo-empty/repodata/5dc1e-primary.sqlite.bz2 +0 -0
- data/spec/functional/assets/yumrepo-empty/repodata/6bf96-other.xml.gz +0 -0
- data/spec/functional/assets/yumrepo-empty/repodata/7c365-other.sqlite.bz2 +0 -0
- data/spec/functional/assets/yumrepo-empty/repodata/dabe2-primary.xml.gz +0 -0
- data/spec/functional/assets/yumrepo-empty/repodata/repomd.xml +0 -55
- data/spec/integration/client/fips_spec.rb +0 -29
- data/spec/integration/client/open_ssl_spec.rb +0 -20
- /data/spec/functional/assets/chocolatey_feed/{test-A.1.0.0.nupkg → test-A.1.0.nupkg} +0 -0
- /data/spec/functional/assets/chocolatey_feed/{test-A.1.5.0.nupkg → test-A.1.5.nupkg} +0 -0
- /data/spec/functional/assets/chocolatey_feed/{test-A.2.0.0.nupkg → test-A.2.0.nupkg} +0 -0
- /data/spec/functional/assets/chocolatey_feed/{test-B.1.0.0.nupkg → test-B.1.0.nupkg} +0 -0
- /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
@@ -21,7 +21,6 @@ require_relative "../resource"
|
|
21
21
|
class Chef
|
22
22
|
class Resource
|
23
23
|
class WindowsShortcut < Chef::Resource
|
24
|
-
unified_mode true
|
25
24
|
|
26
25
|
provides(:windows_shortcut) { true }
|
27
26
|
|
@@ -58,7 +57,7 @@ class Chef
|
|
58
57
|
description: "Icon to use for the shortcut. Accepts the format of `path, index`, where index is the icon file to use. See Microsoft's [documentation](https://msdn.microsoft.com/en-us/library/3s9bx7at.aspx) for details"
|
59
58
|
|
60
59
|
load_current_value do |new_resource|
|
61
|
-
require "win32ole" if RUBY_PLATFORM.match?(/mswin|
|
60
|
+
require "win32ole" if RUBY_PLATFORM.match?(/mswin|mingw|windows/)
|
62
61
|
|
63
62
|
link = WIN32OLE.new("WScript.Shell").CreateShortcut(new_resource.shortcut_name)
|
64
63
|
name new_resource.shortcut_name
|
@@ -21,7 +21,6 @@ require_relative "../resource"
|
|
21
21
|
class Chef
|
22
22
|
class Resource
|
23
23
|
class WindowsUserPrivilege < Chef::Resource
|
24
|
-
unified_mode true
|
25
24
|
|
26
25
|
provides :windows_user_privilege
|
27
26
|
description "The windows_user_privilege resource allows to add a privilege to a principal or (User/Group).\n Ref: https://docs.microsoft.com/en-us/windows/security/threat-protection/security-policy-settings/user-rights-assignment"
|
data/lib/chef/resource.rb
CHANGED
@@ -662,7 +662,6 @@ class Chef
|
|
662
662
|
all_props = {}
|
663
663
|
|
664
664
|
self.class.sensitive_properties.map do |p|
|
665
|
-
|
666
665
|
all_props[p.name.to_s] = p.sensitive? ? '"*sensitive value suppressed*"' : value_to_text(p.get(self))
|
667
666
|
rescue Chef::Exceptions::ValidationFailed
|
668
667
|
# This space left intentionally blank, the property was probably required or had an invalid default.
|
@@ -1499,10 +1498,18 @@ class Chef
|
|
1499
1498
|
# @param partial [String] the code fragment to eval against the class
|
1500
1499
|
#
|
1501
1500
|
def self.use(partial)
|
1502
|
-
|
1503
|
-
|
1504
|
-
|
1505
|
-
|
1501
|
+
if partial =~ /^core::(.*)/
|
1502
|
+
partial = $1
|
1503
|
+
dirname = ::File.dirname(partial)
|
1504
|
+
basename = ::File.basename(partial, ".rb")
|
1505
|
+
basename = basename[1..] if basename.start_with?("_")
|
1506
|
+
class_eval IO.read(::File.expand_path("resource/#{dirname}/_#{basename}.rb", __dir__))
|
1507
|
+
else
|
1508
|
+
dirname = ::File.dirname(partial)
|
1509
|
+
basename = ::File.basename(partial, ".rb")
|
1510
|
+
basename = basename[1..] if basename.start_with?("_")
|
1511
|
+
class_eval IO.read(::File.expand_path("#{dirname}/_#{basename}.rb", ::File.dirname(caller_locations.first.path)))
|
1512
|
+
end
|
1506
1513
|
end
|
1507
1514
|
|
1508
1515
|
# The cookbook in which this Resource was defined (if any).
|
data/lib/chef/resources.rb
CHANGED
@@ -124,6 +124,13 @@ require_relative "resource/route"
|
|
124
124
|
require_relative "resource/ruby"
|
125
125
|
require_relative "resource/ruby_block"
|
126
126
|
require_relative "resource/script"
|
127
|
+
require_relative "resource/selinux_boolean"
|
128
|
+
require_relative "resource/selinux_fcontext"
|
129
|
+
require_relative "resource/selinux_install"
|
130
|
+
require_relative "resource/selinux_module"
|
131
|
+
require_relative "resource/selinux_permissive"
|
132
|
+
require_relative "resource/selinux_port"
|
133
|
+
require_relative "resource/selinux_state"
|
127
134
|
require_relative "resource/service"
|
128
135
|
require_relative "resource/sudo"
|
129
136
|
require_relative "resource/sysctl"
|
data/lib/chef/run_context.rb
CHANGED
@@ -413,9 +413,9 @@ class Chef
|
|
413
413
|
logger.warn(<<~ERROR_MESSAGE)
|
414
414
|
MissingCookbookDependency:
|
415
415
|
Recipe `#{recipe_name}` is not in the run_list, and cookbook '#{cookbook_name}'
|
416
|
-
is not a dependency of any cookbook in the run_list.
|
417
|
-
first add a dependency
|
418
|
-
|
416
|
+
is not a dependency of any cookbook in the run_list. To load this recipe,
|
417
|
+
first add a dependency of the cookbook '#{cookbook_name}' into the metadata
|
418
|
+
of the cookbook which depends on '#{cookbook_name}'.
|
419
419
|
ERROR_MESSAGE
|
420
420
|
end
|
421
421
|
|
@@ -59,7 +59,7 @@ class Chef
|
|
59
59
|
end
|
60
60
|
|
61
61
|
def validate!
|
62
|
-
raise Chef::Exceptions::Secret::ConfigurationInvalid, "You may only specify one (these are mutually exclusive): :
|
62
|
+
raise Chef::Exceptions::Secret::ConfigurationInvalid, "You may only specify one (these are mutually exclusive): :object_id, :client_id, or :mi_res_id" if [config_object_id, client_id, mi_res_id].count { |x| !x.nil? } > 1
|
63
63
|
end
|
64
64
|
|
65
65
|
private
|
data/lib/chef/version.rb
CHANGED
data/lib/chef/win32/handle.rb
CHANGED
@@ -26,10 +26,6 @@ class Chef
|
|
26
26
|
class Handle
|
27
27
|
extend Chef::ReservedNames::Win32::API::Process
|
28
28
|
|
29
|
-
# See http://msdn.microsoft.com/en-us/library/windows/desktop/ms683179(v=vs.85).aspx
|
30
|
-
# The handle value returned by the GetCurrentProcess function is the pseudo handle (HANDLE)-1 (which is 0xFFFFFFFF)
|
31
|
-
CURRENT_PROCESS_HANDLE = 4294967295
|
32
|
-
|
33
29
|
def initialize(handle)
|
34
30
|
@handle = handle
|
35
31
|
ObjectSpace.define_finalizer(self, Handle.close_handle_finalizer(handle))
|
@@ -38,13 +34,16 @@ class Chef
|
|
38
34
|
attr_reader :handle
|
39
35
|
|
40
36
|
def self.close_handle_finalizer(handle)
|
37
|
+
proc { close_handle(handle) }
|
38
|
+
end
|
39
|
+
|
40
|
+
def self.close_handle(handle)
|
41
41
|
# According to http://msdn.microsoft.com/en-us/library/windows/desktop/ms683179(v=vs.85).aspx, it is not necessary
|
42
42
|
# to close the pseudo handle returned by the GetCurrentProcess function. The docs also say that it doesn't hurt to call
|
43
43
|
# CloseHandle on it. However, doing so from inside of Ruby always seems to produce an invalid handle error.
|
44
|
-
|
45
|
-
|
44
|
+
# The recommendation is to use GetCurrentProcess instead of the const (HANDLE)-1, to ensure we're making the correct comparison.
|
45
|
+
return if handle == GetCurrentProcess()
|
46
46
|
|
47
|
-
def self.close_handle(handle)
|
48
47
|
unless CloseHandle(handle)
|
49
48
|
Chef::ReservedNames::Win32::Error.raise!
|
50
49
|
end
|
data/lib/chef/win32/registry.rb
CHANGED
@@ -20,7 +20,7 @@ require_relative "../reserved_names"
|
|
20
20
|
require_relative "api"
|
21
21
|
require_relative "../mixin/wide_string"
|
22
22
|
|
23
|
-
if RUBY_PLATFORM.match?(/mswin|
|
23
|
+
if RUBY_PLATFORM.match?(/mswin|mingw|windows/)
|
24
24
|
require "win32/api"
|
25
25
|
module Win32
|
26
26
|
autoload :Registry, File.expand_path("../monkey_patches/win32/registry", __dir__)
|
@@ -32,7 +32,7 @@ class Chef
|
|
32
32
|
class Win32
|
33
33
|
class Registry
|
34
34
|
|
35
|
-
if RUBY_PLATFORM.match?(/mswin|
|
35
|
+
if RUBY_PLATFORM.match?(/mswin|mingw|windows/)
|
36
36
|
include Chef::ReservedNames::Win32::API::Registry
|
37
37
|
extend Chef::ReservedNames::Win32::API::Registry
|
38
38
|
end
|
@@ -293,7 +293,11 @@ class Chef
|
|
293
293
|
end
|
294
294
|
|
295
295
|
def machine_architecture
|
296
|
-
node
|
296
|
+
if node.nil?
|
297
|
+
::RbConfig::CONFIG["target_cpu"] == "x64" ? :x86_64 : :i386
|
298
|
+
else
|
299
|
+
node[:kernel][:machine].to_sym
|
300
|
+
end
|
297
301
|
end
|
298
302
|
|
299
303
|
def assert_architecture!
|
@@ -46,4 +46,5 @@
|
|
46
46
|
4.14.0 |checksum:99a20cc5e7b901f6b493a8ca5e13439b73b19671eaaca68a00216c4f66765edc
|
47
47
|
4.14.1 |checksum:0fa8731445cf4a0c01570ec29aac4b50a0451ce66b1b31ad768f5035e3af7b90,ruby:~> 2.2
|
48
48
|
4.15.0 |checksum:a5ec27d8055ad47444cfb7ce860bad8af2365772a82892f4a8a0d97e8e9e3b34,ruby:~> 2.2
|
49
|
-
4.15.1 |checksum:9291a0f2247f50d15068ee6965b67cd7b678b0d273e18adf3c0b2ea4a890125c,ruby
|
49
|
+
4.15.1 |checksum:9291a0f2247f50d15068ee6965b67cd7b678b0d273e18adf3c0b2ea4a890125c,ruby:>= 2.1
|
50
|
+
4.16.1 |checksum:5caadbf4bbe5ab539cb892a5bcf74ca33a2f2a897cecafdee4a63be79b4819dc,ruby:>= 2.1
|
@@ -1,31 +1,22 @@
|
|
1
1
|
-----BEGIN CERTIFICATE-----
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
/
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
9pFspp2U05KRqTukVW2YJnWKfMR4VIBzOEA1maGwVMgnC3YPm3qsYqxXqr/jLDCg
|
23
|
-
/EFoozne5/mNmvhSKWOUB1gsuv+3wiUOL6aZETY7RJPQADpHhJntCSeapb5DWhyr
|
24
|
-
ZzUPGHbAyWqbfwmt7b9Pga4fQOihxi4Nf2ZnnMy32HQVqz2sOU7Fo/5rfejEQfGP
|
25
|
-
jxt9b69Hydc3MQJF+eQVYS+NzaZyCX05kLqcGmIP4WKhjx3BkMaZVwjmYfE9WgKR
|
26
|
-
Lcwq0aoz4Guh7Q0yICUc0PvxWLAkiXYFhthg05ZplTd+HgY3XCdO4DyG7lgL4b9t
|
27
|
-
T6oqZ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zcw/uX6wL7birt
|
55
|
+
fbaSkpilvVX529pSzB2Lvi9xWOoGMM578dpQ0h3PwhmmvKhhCWP+pI05k3oSkYCP
|
56
|
+
ng==
|
36
57
|
-----END CERTIFICATE-----
|
@@ -22,16 +22,8 @@ describe Chef::Resource::ChocolateyPackage, :windows_only, :choco_installed do
|
|
22
22
|
include Chef::Mixin::ShellOut
|
23
23
|
|
24
24
|
let(:package_name) { "test-A" }
|
25
|
+
let(:package_list) { proc { shell_out!("choco list -lo -r #{Array(package_name).join(" ")}").stdout.chomp } }
|
25
26
|
let(:package_source) { File.join(CHEF_SPEC_ASSETS, "chocolatey_feed") }
|
26
|
-
let(:package_list) do
|
27
|
-
if provider.query_command == "list"
|
28
|
-
# using result of query_command because that indicates which "search" command to use
|
29
|
-
# which coincides with the package list output
|
30
|
-
proc { shell_out!("choco search -lo #{Array(package_name).join(" ")}").stdout.chomp }
|
31
|
-
else
|
32
|
-
proc { shell_out!("choco list #{Array(package_name).join(" ")}").stdout.chomp }
|
33
|
-
end
|
34
|
-
end
|
35
27
|
|
36
28
|
let(:run_context) do
|
37
29
|
Chef::RunContext.new(Chef::Node.new, {}, Chef::EventDispatch::Dispatcher.new)
|
@@ -62,16 +54,12 @@ describe Chef::Resource::ChocolateyPackage, :windows_only, :choco_installed do
|
|
62
54
|
ENV["Path"] = ENV.delete("Path")
|
63
55
|
end
|
64
56
|
|
65
|
-
after(:each) do
|
66
|
-
provider.instance_variable_set(:@get_choco_version, nil)
|
67
|
-
end
|
68
|
-
|
69
57
|
context "installing a package" do
|
70
58
|
after { remove_package }
|
71
59
|
|
72
60
|
it "installs the latest version" do
|
73
61
|
subject.run_action(:install)
|
74
|
-
expect(package_list.call).to
|
62
|
+
expect(package_list.call).to eq("#{package_name}|2.0")
|
75
63
|
end
|
76
64
|
|
77
65
|
it "does not install if already installed" do
|
@@ -81,19 +69,19 @@ describe Chef::Resource::ChocolateyPackage, :windows_only, :choco_installed do
|
|
81
69
|
end
|
82
70
|
|
83
71
|
it "installs version given" do
|
84
|
-
subject.version "1.0
|
72
|
+
subject.version "1.0"
|
85
73
|
subject.run_action(:install)
|
86
|
-
expect(package_list.call).to
|
74
|
+
expect(package_list.call).to eq("#{package_name}|1.0")
|
87
75
|
end
|
88
76
|
|
89
77
|
it "installs new version if one is already installed" do
|
90
|
-
subject.version "1.0
|
78
|
+
subject.version "1.0"
|
91
79
|
subject.run_action(:install)
|
92
|
-
expect(package_list.call).to
|
80
|
+
expect(package_list.call).to eq("#{package_name}|1.0")
|
93
81
|
|
94
|
-
subject.version "2.0
|
82
|
+
subject.version "2.0"
|
95
83
|
subject.run_action(:install)
|
96
|
-
expect(package_list.call).to
|
84
|
+
expect(package_list.call).to eq("#{package_name}|2.0")
|
97
85
|
end
|
98
86
|
|
99
87
|
context "installing multiple packages" do
|
@@ -101,7 +89,7 @@ describe Chef::Resource::ChocolateyPackage, :windows_only, :choco_installed do
|
|
101
89
|
|
102
90
|
it "installs both packages" do
|
103
91
|
subject.run_action(:install)
|
104
|
-
expect(package_list.call).to
|
92
|
+
expect(package_list.call).to eq("test-A|2.0\r\ntest-B|1.0")
|
105
93
|
end
|
106
94
|
end
|
107
95
|
|
@@ -113,13 +101,13 @@ describe Chef::Resource::ChocolateyPackage, :windows_only, :choco_installed do
|
|
113
101
|
it "installs with an option as a string" do
|
114
102
|
subject.options "--force --confirm"
|
115
103
|
subject.run_action(:install)
|
116
|
-
expect(package_list.call).to
|
104
|
+
expect(package_list.call).to eq("#{package_name}|2.0")
|
117
105
|
end
|
118
106
|
|
119
107
|
it "installs with multiple options as a string" do
|
120
108
|
subject.options "--force --confirm"
|
121
109
|
subject.run_action(:install)
|
122
|
-
expect(package_list.call).to
|
110
|
+
expect(package_list.call).to eq("#{package_name}|2.0")
|
123
111
|
end
|
124
112
|
|
125
113
|
context "when multiple options passed as string" do
|
@@ -149,7 +137,7 @@ describe Chef::Resource::ChocolateyPackage, :windows_only, :choco_installed do
|
|
149
137
|
it "installs with multiple options as an array" do
|
150
138
|
subject.options [ "--force", "--confirm" ]
|
151
139
|
subject.run_action(:install)
|
152
|
-
expect(package_list.call).to
|
140
|
+
expect(package_list.call).to eq("#{package_name}|2.0")
|
153
141
|
end
|
154
142
|
end
|
155
143
|
|
@@ -157,24 +145,24 @@ describe Chef::Resource::ChocolateyPackage, :windows_only, :choco_installed do
|
|
157
145
|
after { remove_package }
|
158
146
|
|
159
147
|
it "upgrades to a specific version" do
|
160
|
-
subject.version "1.0
|
148
|
+
subject.version "1.0"
|
161
149
|
subject.run_action(:install)
|
162
|
-
expect(package_list.call).to
|
150
|
+
expect(package_list.call).to eq("#{package_name}|1.0")
|
163
151
|
|
164
|
-
subject.version "1.5
|
152
|
+
subject.version "1.5"
|
165
153
|
subject.run_action(:upgrade)
|
166
|
-
expect(package_list.call).to
|
154
|
+
expect(package_list.call).to eq("#{package_name}|1.5")
|
167
155
|
end
|
168
156
|
|
169
157
|
it "upgrades to the latest version if no version given" do
|
170
|
-
subject.version "1.0
|
158
|
+
subject.version "1.0"
|
171
159
|
subject.run_action(:install)
|
172
|
-
expect(package_list.call).to
|
160
|
+
expect(package_list.call).to eq("#{package_name}|1.0")
|
173
161
|
|
174
162
|
subject2 = Chef::Resource::ChocolateyPackage.new("test-A", run_context)
|
175
163
|
subject2.source package_source
|
176
164
|
subject2.run_action(:upgrade)
|
177
|
-
expect(package_list.call).to
|
165
|
+
expect(package_list.call).to eq("#{package_name}|2.0")
|
178
166
|
end
|
179
167
|
end
|
180
168
|
|
@@ -182,7 +170,7 @@ describe Chef::Resource::ChocolateyPackage, :windows_only, :choco_installed do
|
|
182
170
|
it "removes an installed package" do
|
183
171
|
subject.run_action(:install)
|
184
172
|
remove_package
|
185
|
-
expect(package_list.call).to
|
173
|
+
expect(package_list.call).to eq("")
|
186
174
|
end
|
187
175
|
end
|
188
176
|
|
@@ -263,7 +263,7 @@ describe Chef::Resource::DscScript, :windows_powershell_dsc_only, :ruby64_only d
|
|
263
263
|
dsc_test_resource.cwd(dsc_environment_fail_etc_directory)
|
264
264
|
expect {
|
265
265
|
dsc_test_resource.run_action(:run)
|
266
|
-
}.to raise_error(
|
266
|
+
}.to raise_error(ChefPowerShell::PowerShellExceptions::PowerShellCommandFailed, /#{exception_message_signature}/)
|
267
267
|
end
|
268
268
|
end
|
269
269
|
end
|