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`

Properties

  • content

    Array of Hashes containing the payload data for the profile. Each hash is a key/value store represnting the payload settings a given PayloadType.

    • This content can be complicated to construct manually.

    • Required Keys: PayloadIdentifier, PayloadType

    • You should always include a unique PayloadIdentifier key/value for each Hash in the Array.

    • You should always include an appropriate PayloadType key/value for each Hash in the Array.

    • Other Payload keys (PayloadDescription, etc.) will be ignored.

    Corresponds to the PayloadContent key.

  • description (defaults to: Installed by Puppet)

    String that describes what this profile does. Corresponds to the PayloadDescription key.

  • displayname

    String displayed as the title common name for this profile. Corresponds to the PayloadDisplayName key.

  • ensure (defaults to: present)

    The basic property that the resource should be in.

    Supported values:
    • present
    • absent
  • organization (defaults to: Simon Fraser University)

    String that describes the org that prodcued the profile. Corresponds to the PayloadOrganization key.

  • removaldisallowed (defaults to: false)

    Bool: whether or not to allow the removal of the profile. Setting this to false means it can be removed. Don’t blame me for the stupid double-negative name, blame Apple. Corresponds to the PayloadRemovalDisallowed key.

    Supported values:
    • true
    • false

Parameters

  • name (namevar)
  • provider

    The specific backend to use for this ‘mobileconfig` resource. You will seldom need to specify this — Puppet will usually discover the appropriate provider for your platform.