Configuration


Munki and File System Permissions

The script assumes that if the repo is accessed from a network share that the share has been mapped as appropriate before it's run.

Munki Import

Auto Munki Importer uses munkiimport to import the packages.

Please ensure that munkiimport --configure has been run and has the correct configuration for the "Path to munki repo" and "pkginfo extension" options for the user that will be running the script.

Permissions

In addition to writing to the Munki repo, the script needs to also write to the data plists, and log files. While these files can be anywhere, the default locations are:-

  • /Library/​Application Support/​autoMunkiImporter
  • /Library/​Logs/​autoMunkiImporter


Auto Munki Importer Global Config

The default settings plist contains configuration for the script. It has a series of required keys, some of which may be overwritten by individual data plists.

A default settings plist is installed to /Library/​Application Support/​autoMunkiImporter/​_DefaultConfig.plist. You can however override this using the --settings /path/to/settings.plist command line paramater.

Please take the time to review the settings and change them as appropriate for your environment. If the email settings aren't changed, the script will exit during its initial checks, even if emailing reports is disabled.

Required Keys

Key

Type

Description

dataPlistPath
string

Location of data plist(s) (Default: /Library/​Application Support/​autoMunkiImporter/).

emailReports
boolean

Whether email reports should be sent (Default: True).

fromAddress
string

From email address to use for sending email (Default: replace_me@example.com). Needed regardless of whether emailReports is true or false.

gitEnabled
boolean

Whether to add and commit new pkginfos with git (Default: False).

gitPushAndPull
boolean

Whether to pull and push changes to and from a remote git repo (Default: False).

logFile
string

Path to the log file to use (Default: /Library/​Logs/​autoMunkiImporter/​autoMunkiImporter.log).

logFileMaxSizeInMBs
number

Size in MBs that log files can grow to until they are rolled (Default: 1MB).

makecatalogs
boolean

Whether makecatalogs should be run at the end of each import (Default: True).

maxNoOfLogsToKeep
number

Maximum number of logs files to keep (Default: 5).

smtpServer
string

SMTP server to use for sending email (Default: replace_me.example.com). Needed regardless of whether emailReports is true or false.

statusPlistPath
string

Path to status plist, which gives a summary of all applications being monitored (Default: /Library/​Logs/​autoMunkiImporter/​autoMunkiImporterStatus.plist).

subjectPrefix
string

Prefix to add to email subject lines (Default: [Auto Munki Import]). Needed regardless of whether emailReports is true or false.

toAddress
string

To email address to use for receiving email (Default: replace_me@example.com). Needed regardless of whether emailReports is true or false.

userAgent
string

The User Agent string to use when attempting to download applications (Default: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_5) AppleWebKit/536.26.14 (KHTML, like Gecko) Version/6.0.1 Safari/536.26.14). I recommendation you use Safari's User Agent for your primary OS (the default is for Lion).

Once you have installed the dependencies and configured the settings plist, Auto Munki Importer should have everything it needs to run. You can verify this by running autoMunkiImporter.pl --test. You should get "All tests passed..." if everything has been configured correctly.


Example Data Plists

The installer package contains the following example data plists that you can use as a starting point for automating your packaging. They are installed into /Library/​Application Support/​autoMunkiImporter.

  • Adobe Flash Player
  • Adobe Reader
  • Firefox (Extended Support Release)
  • Firefox (Public Release)
  • Flip4Mac WMV Quicktime Components
  • Google Chrome
  • Silverlight
  • Skype
  • VLC

In addition an empty _template.plist is included as a starting point for your own applications. It has all of the required and optional keys. Unused keys can be left blank.

If you plan on using this directory to host your data plists, you should review each of the examples and ensure they match your pkginfo names and locations of existing items and that they have the appropriate settings.


Launch Daemon

To fully automate importing packages into Munki, the script should be set to run as a Launch Daemon. An example plist appears below that uses the default install locations and will run at 5am each day. If you modify where the data plists, or the location of the script are you will need to make the appropriate changes.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>Label</key>
	<string>com.github.neographophobic.autoMunkiImporter</string>
	<key>ProgramArguments</key>
	<array>
		<string>/usr/local/autoMunkiImporter/autoMunkiImporter.pl</string>
		<string>--silent</string>
		<string>--data</string>
		<string>/Library/Application Support/autoMunkiImporter</string>
	</array>
	<key>StartCalendarInterval</key>
	<dict>
		<key>Hour</key>
		<integer>5</integer>
		<key>Minute</key>
		<integer>0</integer>
	</dict>
	<key>UserName</key>
	<string>REPLACE_ME</string>
</dict>
</plist>

You should set the UserName to match a user that has munkiimport configured, and has appropriate permissions as outlined above.

Save the plist to /Library/​LaunchDaemons/​com.github.neographophobic.autoMunkiImporter.plist, and then run sudo chown root:wheel /Library/​LaunchDaemons/​com.github.neographophobic.autoMunkiImporter.plist and sudo chmod 644 /Library/​LaunchDaemons/​com.github.neographophobic.autoMunkiImporter.plist.

You should then load it, so that launchd is aware of it and will run it at 5am tomorrow. To load the plist use sudo launchctl load /Library/​LaunchDaemons/​com.github.neographophobic.autoMunkiImporter.plist.