Resource Type: mobileconfig
- Defined in:
- lib/puppet/type/mobileconfig.rb
- Providers:
-
default
Overview
Dynamically create and manage OS X .mobileconfig profiles
A custom Puppet type for delivering policy via OS X profiles.
When you define a Mobileconfig resource, a .mobileconfig file containing the settings you specified oin the resource is automatically generated and installed.
Use of this custom type can be complicated if you don’t understand the basic structure of a .mobileconfig file.
If you need to do some trench work with profiles, I recommend you abstract the mobileconfig resource by wrappping it in a parameterized Puppet class, as per the various classes in this module. See the activedirectory.pp file for an example of this pattern.
USAGE ====
# Create an Array of 1 or more PayloadContent Hashes # - You can stack multiple PayloadContent Hashes inside the Array # - Each Hash is a single payload # - Each payload contains key/value pairs representing the settings you want # to manage # - You MUST include a PayloadType key for this to work
$content = [{ ‘contents-immutable’ => true,
'largesize' => 128,
'orientation' => 'left',
'tilesize' => 128,
'autohide' => true,
'PayloadType' => 'com.apple.dock'
}]
# The resource name MUST be unique! # - Only the :name and :content properties are required mobileconfig { ‘puppetlabs.dock.alacarte’:
ensure => present,
displayname => 'Puppet Labs: Dock Settings',
description => 'Dock configuration. Installed by Puppet.',
organization => 'Puppet Labs',
content => $options,
}
# You can remove an existing profile just like any other Puppet resource mobileconfig { ‘puppetlabs.dock.alacarte’:
ensure => absent,
}
# Use the puppet resource command to get a list of installed profiles: ‘sudo puppet resource mobileconfig`
# Remove the profile using puppet resource… ‘sudo puppet resource mobileconfig puppetlabs.dock.alacarte ensure=absent`