diff options
author | Tim Smith <tsmith@chef.io> | 2017-12-18 16:26:42 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-12-18 16:26:42 -0800 |
commit | 3bc234908d800189739653f2ea1d1eabeaa28df8 (patch) | |
tree | 3fab454568d5efdda87b6c6009db2fa1278fbe46 | |
parent | 8a9b960ed4e09cae79cef43abfdcc86b81b2040e (diff) | |
parent | 8dadb5e568f7258e4c6aa74d16e3b90ee32ce58a (diff) | |
download | chef-3bc234908d800189739653f2ea1d1eabeaa28df8.tar.gz |
Merge pull request #6685 from chef/osx_profile
Modernize osx_profile resource
-rw-r--r-- | lib/chef/resource/osx_profile.rb | 50 |
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 |