Zack McCauley - WardsParadox

Hi, I’m a macadmin for a school district in Montana. Never stop learning.

Hello-IT Setup and Deployment

2017-05-12

I have recently been playing with a tool called Hello IT. It has been a wonderful tool in testing and I am getting excited to send it out here in our district. I believe it will help our staff be able to communicate to us effectively. Our current layout looks like this: helloIT Menu Layout

To do this was pretty easy once I got a good explanation from @ygini on the {% icon fa-apple fg-lg >}}MacAdmins.org slack. He pointed out many flaws with my understanding. Take for example script items. You can choose path or script as the way to call the script. It's much easier to use the script method. Drop your script in the CustomScript directory, check it's permissions and call it the script like this:

<dict>
  <key>functionIdentifier</key>
  <string>public.script.item</string>
  <key>settings</key>
  <dict>
    <key>script</key>
    <string>com.github.ygini.hello-it.wardsparadox.serialnumber.sh</string>
    <key>title</key>
    <string>SNInfo</string>
  </dict>
</dict>

Let's break the preferences down a bit. Each item is stored inside a dict. There is a key called functionIdentifier that tells HITp which type of item it is. You can create custom items but I have not had a need for that. There are [public.open.application, public.open.resource, public.quit, public.script.item, public.separator, public.submenu, public.test.http, public.title] available as functionIdentifier's. You can find all of the explanations for each of these on the Wiki.

To build a deployment package, I recommend munki-pkg as it is simple, it wraps native frameworks and is incredibly quick to get going. First create a new munkipkg project:

$: munkipkg --create hello-it-deployment
$: cd ./hello-it-deployment

At this point you will notice a folder structure like such:

.
├── build
├── build-info.plist
├── payload
└── scripts

Edit the build-info.plist and change several things to match the appropriate settings down below.

<?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>distribution_style</key>
	<false/>
	<key>identifier</key>
	<string>com.github.yourusername.hello-it-deployment</string>
	<key>install_location</key>
	<string>/Library/Application Support/CustomScripts</string>
	<key>name</key>
	<string>hello-it-deployment-${version}.pkg</string>
	<key>ownership</key>
	<string>recommended</string>
	<key>postinstall_action</key>
	<string>none</string>
	<key>suppress_bundle_relocation</key>
	<true/>
	<key>version</key>
	<string>1.0</string>
</dict>
</plist>

Once all the scripts you want to deploy are in the payload folder, you will need to change the permissions and ownership so they run correctly. To do this run (assuming you are still in the same directory inside your terminal session):

$: sudo chown -R root:wheel payload
$: sudo chmod -R 755 payload

Your package is now ready to be built. Go over all the files again, make sure your build-info.plist is correct, and build your package.

 $: munkipkg build /path/to/hello-it-deployment

This will create a package in the build directory of your project. You can use munkiimport or any other deployment tool to deploy this package now. If using munki, make sure to mark this as an update_for for the Hello IT App. I recommend deploying the app and using the "KeepAlive" feature mentioned in the wiki.

You will also need to deploy the preferences for your setup. I highly recommend using a configuration profile to do this. It makes management incredibly easy to maintain and update. I have tried to document the dict's needed for the scripts in the Repo, but if you have custom scripts, all I can do is recommend checking my example configuration profile in the main repo here

Sidenote:

If you have custom scripts that can be generalized, please make a fork of the main repo, adjust your scripts to be in reverse domain format such as com.github.yourusername.hello-it.scriptname.sh, add a ReadMe.md following the templates in the repo and move them to a folder with the same script name. We can add so much to Hello IT and make it better with more community scripts.