Monthly Archives: June 2013

Configuring Munki Clients for Munkiwebadmin

So you have  munki and munkwebadmin setup and now need to make sure your clients are checking in to munkiwebadmin. Here’s how I do it.

1. Install munki tools on client machines.

– Go here and download the munki tools.

http://code.google.com/p/munki/downloads/list

– Either install manually on each machine or push out the installer package with ARD. BE WARNED it will force an immediate restart.

2. Edit URL in Client scripts.

– Go to  /Users/Shared/munkiwebadmin_env/munkiwebadmin/scripts/For Clients on the machine you installed munki on.

– Right click on “post flight” file, select “open with”. I use gedit with a custom theme, Xcode is another good choice, but you can use Text Editor if nothing else.

– Change the first line BASEURL to the IP or DNS name of your munki machine. Make sure to leave the port 8000 . If you choose to use the DNS name make sure you have correct DNS records by doing a forward and reverse lookup.

basaeurl

Example

BASEURL="IP of munki machine:8000"

– Save the file when finished.
– Repeat this step on the “preflight” and “Report_broken_Client” files.

3. Copy scripts to client machine
– Copy the files to the client machine, put them in the /usr/local/munki folder.

– Again, lots of options on how to get them to the client. Manual is fine for testing, in a production environment I would consider an installer package. I’m just using ARD to copy from my machine to the clients.

– Make sure the files copied have a 755 permission set. Without getting too deep the easiest way to make sure they have the right permissions, is to right click the /usr/local/munki folder and say “Get Info”. Select the lock in the bottom right and authenticate as an admin.Then click the gear and select “Apply to enclosed items …”. This will propagate the permission down to the files you just added.

munki755

4 Run Managed Software Update on the client

– Run Manage Software Update was installed by munki tools. You can find it in /Applications/Utilities

– After you run it, open munkiwebadmin

5. Log into munkwebadmin

– Open a web browser and go to your munkiwebadmin IP, in my case it’s 192.168.10.26:8000

– You should see a new client machine has checked in.

munkiwedadmin-client

Install Printers On A Mac From The Command Line

I found myself setting up a mac from scratch this morning. It’s sort of a one off situation so applying one of my standard images didn’t seem to make sense.

Though when it came time to install the printers I realized I was going to have to add them one by one. I decommissioned our aging Mac print server a few months ago and have moved to IP based printing.

I’ve thought about using munki to manage printers and just haven’t got around to it. So I was stuck with manual setups and that thought kind of got under my skin.

So I finally made a script to add my printers all in one swoop. The basic command is below. You’ll need to wrap it in a shell script, or I just pasted the commands into Apple Remote Desktop and ran them as root on my remote machines.

Command:

/usr/sbin/lpadmin -p "name of printer" -E -v lpd://"printer IP or DNS"/"queue name" -P "path to PPD file" -D "description"

Example:

/usr/sbin/lpadmin -p "DC_3FL_PRINT_B&W" -E -v lpd://"192.168.10.99"/"DC_3FL_PRINT_B&W" -P "/Library/Printers/PPDs/Contents/Resources/HP LaserJet 9050.gz" -D "DC_3FL_PRINT_B&W"

This only works of course if you have the print drivers already installed. If they are not, you need to install them a head of time or copy them before you run this command like in the example below. I choose to copy the ppd file and not run an installer since I know exactly what ppd files I need.

The below command copies the ppd from a network share to the clients printer ppd folder. a simple “copy- source-destination”. Then sets up the desired printer.

cp /Volumes/dcfiles/Transfer\ then\ delete/nscott/PRINTERS/CNR3235X1.PPD.gz /Library/Printers/PPDs/Contents/Resources\
/usr/sbin/lpadmin -p "DC_1FL_ARC_COPY_B&W" -E -v lpd://"192.168.10.133"/"DC_1FL_ARC_COPY_B&W" -P "/Library/Printers/PPDs/Contents/Resources/CNR3235X1.PPD.gz" -D "DC_1FL_ARC_COPY_B&W"

SWITCHES
-p : configures said printer
-E : enables printer to accept jobs
-v : Sets printer URL
-P : Specifies a ppd file to use
-D : creates a text description for the printer

If you wanted to remove a printer instead of add you would just replace the first -p, used to configure a printer, with -x, used to delete a printer.