summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2017-12-15 17:33:40 -0800
committerTim Smith <tsmith@chef.io>2017-12-15 18:00:20 -0800
commit8dadb5e568f7258e4c6aa74d16e3b90ee32ce58a (patch)
tree7e4cf9b8e35c3ca20e9c3c87111a85b5dadcf4e3 /lib
parent10252cc8f4f855d5de65efb645583f89bf8771f2 (diff)
downloadchef-8dadb5e568f7258e4c6aa74d16e3b90ee32ce58a.tar.gz
Modernize osx_profile resource
Signed-off-by: Tim Smith <tsmith@chef.io>
Diffstat (limited to 'lib')
-rw-r--r--lib/chef/resource/osx_profile.rb50
1 files changed, 10 insertions, 40 deletions
diff --git a/lib/chef/resource/osx_profile.rb b/lib/chef/resource/osx_profile.rb
index 8142e1fd96..1d13a8851e 100644
--- a/lib/chef/resource/osx_profile.rb
+++ b/lib/chef/resource/osx_profile.rb
@@ -20,6 +20,12 @@ require "chef/resource"
class Chef
class Resource
+ # Use the osx_profile resource to manage configuration profiles (.mobileconfig files)
+ # on the macOS platform. The osx_profile resource installs profiles by using
+ # the uuidgen library to generate a unique ProfileUUID, and then using the
+ # profiles command to install the profile on the system.
+ #
+ # @since 12.7
class OsxProfile < Chef::Resource
provides :osx_profile, os: "darwin"
provides :osx_config_profile, os: "darwin"
@@ -29,46 +35,10 @@ class Chef
default_action :install
allowed_actions :install, :remove
- def initialize(name, run_context = nil)
- super
- @profile_name = name
- @profile = nil
- @identifier = nil
- @path = nil
- end
-
- def profile_name(arg = nil)
- set_or_return(
- :profile_name,
- arg,
- :kind_of => [ String ]
- )
- end
-
- def profile(arg = nil)
- set_or_return(
- :profile,
- arg,
- :kind_of => [ String, Hash ]
- )
- end
-
- def identifier(arg = nil)
- set_or_return(
- :identifier,
- arg,
- :kind_of => [ String ]
- )
- end
-
- def path(arg = nil)
- set_or_return(
- :path,
- arg,
- :kind_of => [ String ]
- )
- end
-
+ property :profile_name, String, name_property: true
+ property :profile, [ String, Hash ]
+ property :identifier, String
+ property :path, String
end
end
end