For a number of years I have used the same Imaging workflow, during which time I thought the process was fairly common (with FSTAB being an exception).
However, after speaking to a few fellow Casper Admins it has become clear that my workflow isn’t as common as I thought. So the post below outlines what we do.
In Casper Admin we create a “Standard Configuration” often naming is “<OS Version> Base” as per the below;
Under the “Management” tab, we specify the details of the management account:
Then due to us using FSTAB to split the Macs HD into 33% Macintosh HD & 67% Users HD, we specify the creation of the Users HD partition under the “Partitions” tab as a Journaled HFS+ Volume with 67% or up to 670GB of the target drive.
Whereas if the Mac has already been partitioned, (as when re-imaging), Casper Imaging will see this & this step will be skipped:
This preservation of partitions if great if using FSTAB to partition your Macs HD’s to have the user data on a separate partition as the data on that partition is then preserved.
This includes when partitioning as per the above, but when doing so the “Recovery HD” is not the last partition as you may expect.
The above is taken from my mac, as you can see the “Recovery HD” is the middle of the 3 partitions. Whilst this still works to boot into & to send lock or wipe commands to the Mac, it’s worth noting that FileVault2 will only encrypt the OS volume.
With the “Base Standard Configuration” created, it is then used as the parent for others, as shown below:
In the configurations above, you can see we have various “Smart Configurations” with the “Base Standard Configuration” that we created earlier being the parent, & the “Smart Configurations” being split depending on what version of CS6 is to be installed.
The content of these “Smart Configurations” is only 2 items, will all other items coming from the “Base Standard Configuration.”
Next we populate the “Base Standard Configuration” with the items wanted within it, as we’re using “Smart Configurations” the “Base Standard Configuration”should hold all items that are wanted except for the items that differentiate the “Smart Configuration”.
As with anything within the JSS, timing is important. When creating configurations it’s important to set the correct priorities of items in Casper Admin as, trying to install updates for an application without it being installed will fail.
Below is an example of what we follow for items, note we also prefix the items with their priority.
Generally we follow the below, this is a loose guide;
- Priority 1: OS.dmg’s
- Priority 2: OS updates (this was used more pre-App Store OS delivery, now we create a new OS.dmg with the latest “Install Mac OSX.app” using AutoDMG).
- Priority 3-9: OS updates, such as printer drivers as well as items affecting the User environment.
- Priority 10: Application installs.
- Priority 12: Application updates &/or settings.
- Priority 14: Application plugins (Adobe Creative Suite plugins for example).
- Priority 20: Imaging post flight triggers.
So as mentioned that’s a rough outline, & with Casper Admin having priorities of 1-20 we leave some free just incase.
Adding DMGs & PKGs to a configuration
The way Casper Imaging block copies DMGs means that we usually deploy DMGs to the target drive during imaging.
However as PKGs can have pre or post flight scripts as well as dependencies on whether or not they are being installed from the boot volume &/or have an active user session running.
So another rule of thumb we follow is to set each PKG to “Install on boot drive after imaging”.
Once logged into the “Adobe Install” account, you should see the below screen on the Macs screen:
The Mac will now be installing all the cached PKGs, whilst logged in as a user account with no conflicting processes.
The last part of the workflow is the “Postflight script” as shown in the “Smart Configurations” above. The reasoning behind putting this script as part of “Smart Configuration” instead of the “Standard Configuration” is that it allows us to create other “Smart Configurations” what install all the items from the “Standard Configuration” with a different “Postflight script”.
The “Postflight script” is set to run “At Reboot” & triggers a policy with the trigger “OSXPostflightconfig”
In the JSS the policy looks like the below, & the policy is set to “Ongoing” at triggered via the above custom trigger:
Any needed “Software Updates” are installed from the Network Segment defined software update server for the imaged Mac.
Next we run a collection of scripts:
These are set to “Before” or “After” depending on what the script is, for example you could have a “Before” script that sets the Macs time to your NTP. Then an “After” script that does the “AD Binding”.
The only script of note is the below:
We report back that “Dummy Receipt” (it’s not really a dummy receipt, but close enough), as an “Management Level” Extension Attribute. All policies are then scoped on the value of that Extension Attribute as a base value for the policies “Smart Group”. The “Management Level” Extension Attribute is below:
As you can see we use a number of “Dummy Receipt” for various things, but in context of this post the “Management Level” values are:
- Managed (for clients)
- Supervised (for clients with special use cases, such as meeting room Macs)
- Sedna (for our Macs running Sedna Presenter digital signage).
- Server (for our Mac servers, this includes our Casper DP’s & JSS box)
The benefit of doing this, is that no policies are run on the newly imaged Mac until this file is in place & the Mac has ran an inventory update.
After the scripts have run we bind to our Active Directory:
Lastly, we perform some maintenance tasks:
Managed Preferences & Profiles
The Mac then restarts & pulls down the required “Managed Preferences” & “Configuration Profiles”.
As mentioned above, we create a “Dummy Receipt” & scope Smart Groups for polices using that value returned via an EA as a base for the group. Well we use the same method is used when scoping “Managed Preferences” & “Configuration Profiles”, with the exception that we also scope via OS version.
The above workflow can also be easily tailored for when you wish to preserve the Macs shipped OS, this can happen if the Macs build is a bespoke “fork” of OSX.
In order to use the above when “No Imaging” do the following:
- Boot up the Mac & run through the setup assistant creating an administrator account.
- Once logged in, enable root & login as root (this stops you being prompted every 5 minutes for administrative credentials).
- Download & launch Casper Imaging.
- Select the wanted configuration.
- Press “Show Custom”
- Remove the OS.dmg & any OS updates you have added.
- Select your normal options in “Casper Imaging” except “Erase”.
- Once “Casper Imaging” has installed all items, login as the administrator account created at step 1 & disable the root account. (Of course, if this is a workflow you wish to employ regularly you could add a script to the “Post flight policy” that disables root).
I hope you’ve found the above of some use, this workflow has remained largely unchanged since 10.6.x but with people querying how I do it & some potential changes are coming with Yosemite I thought it was about time I blogged it.