summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2020-09-04 10:47:15 -0700
committerGitHub <noreply@github.com>2020-09-04 10:47:15 -0700
commitae28c2cf8eaa95240e2d27bf25c0dd072943f284 (patch)
treeedfaa18707e583dff5abe200ae7ba9fda068408f
parent67651c3ce11a699064b67e582ec82a218a6bca91 (diff)
parent92aa38336073df5f289a9caabf52981aad0718ca (diff)
downloadchef-ae28c2cf8eaa95240e2d27bf25c0dd072943f284.tar.gz
Merge pull request #10386 from chef/remove_profile
Allow removing profiles in osx_profile on Big Sur
-rw-r--r--lib/chef/resource/osx_profile.rb9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/chef/resource/osx_profile.rb b/lib/chef/resource/osx_profile.rb
index 23a4e86505..c3ff099436 100644
--- a/lib/chef/resource/osx_profile.rb
+++ b/lib/chef/resource/osx_profile.rb
@@ -80,10 +80,6 @@ class Chef
end
def check_resource_semantics!
- if mac? && node["platform_version"] =~ ">= 11.0"
- raise "The osx_profile resource is not available on macOS Big Sur or above due to Apple's removal of support for CLI profile installation"
- end
-
if action == :remove
if new_profile_identifier
if invalid_profile_name?(new_profile_identifier)
@@ -97,6 +93,11 @@ class Chef
end
if action == :install
+ # we only do this check for the install action so that profiles can still be removed on macOS 11+
+ if mac? && node["platform_version"] =~ ">= 11.0"
+ raise "The osx_profile resource is not available on macOS Big Sur or above due to Apple's removal of support for CLI profile installation"
+ end
+
if new_profile_hash.is_a?(Hash) && !new_profile_hash.include?("PayloadIdentifier")
raise "The specified profile does not seem to be valid"
end