Use the plist resource to manage property list files (plists) and their content.
A plist resource instance represents the state of a single key-value pair in
the delared plist
path. Since each plist resource instance represents only one
setting, you may end up with several plist resource calls in a given recipe. Although
this may seem like overkill, it allows us to have a fully idempotent resource with
chef-client run, the client knows to check the state of the plist
before changing any values. It also makes sure that the plist is in binary format
so that the settings can be interpreted correctly by the operating system.
Want to learn more? See the Property List Programming Guide.
The full syntax for all of the properties that are available to the plist resource is:
plist 'description' do path String # defaults to 'description' if not specified entry String value TrueClass, FalseClass, String, Integer, Float action Symbol # defaults to :set if not specified encoding String # defaults to 'binary' if not specified. end
This resource has the following actions:
Show invisible files
plist 'show hidden files' do path '/Users/vagrant/Library/Preferences/com.apple.finder.plist' entry 'AppleShowAllFiles' value true end
path is the absolute path to the
com.apple.finder.plist plist file
entry is the representing the plist entry
value is the entry's value to boolean type: