Managing Printers With Munki

934 views
Skip to first unread message

Adam M. Anklewicz

unread,
Dec 4, 2014, 11:06:03 AM12/4/14
to munk...@googlegroups.com
There are a lot of problems with Managing Printers With Munki page on the wiki and would like to make some major changes, but I’d like to make sure I’m not in the wrong in my opinions on the document.

  1. Introduction: Mentioning the downfalls of MCX without mentioning how Munki can relieve this
  2. PKG vs NOPKG: It seems silly that the nopkg method is second, as it requires no extra software, and honestly seems easier.
  3. There’s a lot of mentions of I, that should probably change. ("I am using The Luggage to build the packages to install the printers." Should be, “The following method uses The Luggage, however any packager can be used."
  4. All examples seem to use different printers and different versions. This should be merged to one for example purposes.
  5. Even before the PKG or NOPKG methods should be the data that must be used, a collection of all variables, and how to find out printer options.
  6. “There are some pros and cons to this approach, but here’s the method” leaves you hanging, no need to have this and it will be addressed later in the file.
  7.  Replace "As of Munki 0.8.3.1634, there is now a "nopkg" type for package-free installation.  This allows us to run scripts directly in Munki without having to create packages to install.  We can use this "nopkg" type to run all of our printer installs from Munki pkginfos, which allows for easy editing in the future.” with "Requirements: Munki 0.8.3.1634 or later.”
  8. Why is there a step 1.5, it should either be 1, 2, 3 or just Step 1, create three necessary scripts. Probably three steps.
  9. Makes the call "makepkginfo --installcheck_script=installcheck_script.sh --uninstall_script=uninstall_script.sh > printer.pkginfo” and forgets to include postintall_script.sh
  10. Has the super-vague instruction "Fill in the rest of the important things into the pkginfo”. Later says these are description, display_name, name, and version. If we have before all the possible variables, we can just tell the user to run "/usr/local/munki/makepkginfo —name=NAME —displayname=DISPLAYNAME —description=DESCRIPTION —pkgvers=VERSION -c CATALOG —developer=DEVELOPER —category=CATEGORY --nopkg --installcheck_script=installcheck_script.sh --uninstall_script=uninstall_script.sh --postinstall_script=postinstall_script.sh > NOPKGNAME.pkginfo”
  11. "Throw your pkginfo into your Munki repo and makecatalogs.  Add it to a manifest, and test it out!” should be two steps, “Place in /PATH/TO/munki_repo/pkginfo” then another step of run makecatalogs

Chase Thompson-Baugh

unread,
Dec 4, 2014, 10:42:07 PM12/4/14
to munk...@googlegroups.com
Some of the items seem a bit "nit-picking" to me (#3 and #8 don't seem crucial to readability) but I see no problem with the rest. #5 would have been quite helpful for me when I was just starting out with Munki (though I use Puppet for these things now). I know it's not up to me too.

Graham Gilbert

unread,
Dec 5, 2014, 6:25:17 AM12/5/14
to munk...@googlegroups.com
Shameless plug on my front: I made a script that can help automate the generation of nopkg pkginfos: https://github.com/grahamgilbert/printer-pkginfo

--
You received this message because you are subscribed to the Google Groups "munki-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to munki-dev+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Adam M. Anklewicz

unread,
Dec 5, 2014, 7:25:54 AM12/5/14
to munk...@googlegroups.com
Chase, those two are definitely nitpicky, but I figure if I’m cleaning it up…

Graham, why didn’t you reply sooner, I spent most of yesterday making a script, and it’s not working quite right (mostly because I don’t really know what I was doing, and made it up as I went along). I guess I spent some time learning, and that was valuable… I guess.

A.E. van Bochoven

unread,
Dec 5, 2014, 7:51:08 AM12/5/14
to munk...@googlegroups.com
On 04 Dec 2014, at 17:06, Adam M. Anklewicz <ad...@ANKLEWICZ.COM> wrote:

There are a lot of problems with Managing Printers With Munki page on the wiki and would like to make some major changes, but I’d like to make sure I’m not in the wrong in my opinions on the document.

  1. Even before the PKG or NOPKG methods should be the data that must be used, a collection of all variables, and how to find out printer options.

Her you should mention/explain lpoptions -p your-printer-queue -l which is invaluable for determining printer options.

-Arjen

Timothy Sutton

unread,
Dec 5, 2014, 9:43:53 AM12/5/14
to munk...@googlegroups.com
I would not advocate nopkg over pkg as a deployment strategy.

Some people prefer nopkg it's more 'lightweight' or because they intend to only ever deploy this printer using Munki, others prefer pkg because they add all of their logic into a pkg that is portable and completely usable outside Munki.

Tim


> On Dec 4, 2014, at 11:06 AM, Adam M. Anklewicz <ad...@ANKLEWICZ.COM> wrote:
> • PKG vs NOPKG: It seems silly that the nopkg method is second, as it requires no extra software, and honestly seems easier.

zack.m...@bsd7.org

unread,
Dec 5, 2014, 12:09:19 PM12/5/14
to munk...@googlegroups.com
I use another PKG method that installs the driver by copying out of a DMG, should I ever need to add that driver to another lab. It isn't the "cleanest" of the methods, but as Tim says, maybe having it instead of NOPKG vs PKG first, instead having it as Recommended Deoployments: 1. NoPkg, 2. Pkg, 3. etc

Nick McSpadden

unread,
Dec 5, 2014, 12:16:10 PM12/5/14
to munki-dev
That page is fairly old, and hasn't been touched in a while.  I wrote the "nopkg" part of it (and left the first part, written by someone else, completely untouched), and although I haven't updated it, it's still the strategy I use today.  If I had to do it all over again now, I'd probably switch back to using packages for it, but there are some nice advantages to using nopkg.  The obvious downside, as Tim Sutton pointed out, is that it's tied to Munki and won't work outside of it.  Packages give a lot more flexibility / freedom to use other tools.  For now, since I don't plan to stop using Munki any time soon, the nopkg method works fine.

Mostly what I see wrong with the wiki page is that, as Adam stated in the OP, there's a lot of "fill in the blanks" that aren't really well described or explained.  I fear that going too far into depth of how lpoptions works would drag the page off topic a bit, but if that's the kind of thing people want to see explored more fully, that's something that can be fleshed out.

At the time, I didn't write it to be a step-by-step recipe so much as a general explanation for how you could make it work.  I see how there could still be a lot of confusion left over from the blank spaces I glossed over (as Adam suggests in #10-11), but again, easy to fix.


--
You received this message because you are subscribed to the Google Groups "munki-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to munki-dev+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
--
Nick McSpadden
Client Systems Manager
Schools of the Sacred Heart, San Francisco

Nick McSpadden

unread,
May 16, 2015, 12:18:19 AM5/16/15
to munki-dev
I'm reviving an old shambling dead thread with some new life.

After doing some experimentation, I've concluded that the current scripts used in the nopkg printer method are fairly fragile and a bit unnecessary.  It seemed logical at the time, but I think there are better ways of doing it now.

I've developed a script that will generate Munki nopkg printer pkginfos, either with command line arguments or with a CSV file with a list of printers:

Rather than relying on file-based versioning (which was essentially recreating the Apple pkg receipt, extremely poorly), the script now simply compares the lpoptions between the existing printer queue and what's specified in the pkginfo.  If there's a mismatch of any kind, the installcheck_script will return 0 and decide to install.

The postflight script now simply deletes the existing queue and reinstalls with the specified options.

The uninstall_script now simply deletes the existing queue.

I think this new method is much cleaner and more logical (if not just as ugly, because lpoptions output is bananas).

Any feedback would be welcome.  I'd like to update the Munki wiki as well, if others agree.

Adam M. Anklewicz

unread,
May 16, 2015, 8:40:19 AM5/16/15
to munk...@googlegroups.com
I look forward to playing with this when I get back to the office on Tuesday.

Mike Pullen

unread,
May 16, 2015, 10:00:29 AM5/16/15
to munk...@googlegroups.com

I look forward to playing with this as well. Have been struggling with some peculiar anomalies with our printer deployment nopkg scripts taking a long long time to run on 10.10 (they sometimes hang then show wierd errors with lpadmin and cupsenable...)

Jonathan Cohen

unread,
May 16, 2015, 3:32:49 PM5/16/15
to munk...@googlegroups.com
I've been a fan of the nopkg printer installers.  It really simplified things for our users.  This looks to smooth the process out on the management side. Thank you.

Tim Sutton

unread,
May 16, 2015, 9:21:12 PM5/16/15
to munk...@googlegroups.com
This script looks pretty useful!

I can echo that in my environment it's been helpful to do the
installcheck_script method of checking for the existence of the print
queue rather than a simple pkg receipt. Although in my case it's been
enough to simply `lpstat -v | grep -q <queue name>` rather than go
through to ensure every option is just so.

For us however, the aspect of the printers we deliver through Munki
that's near-impossible for mortals to configure by hand hasn't been
the printer options, but rather the spooler URLs and user presets
required for network accounting. We've had way more consistent results
by having users only use Munki to manage the printers and let it
reinstall them if a user removes it by accident.

Tim

zack.m...@bsd7.org

unread,
May 18, 2015, 2:03:05 PM5/18/15
to munk...@googlegroups.com
I had actually switched to using yours a while ago, glad to see it updated! Now to re-add the customized options I had made :)

zack.m...@bsd7.org

unread,
May 18, 2015, 2:10:53 PM5/18/15
to munk...@googlegroups.com
Correction:
You implemented everything I had added haha. Awesome update Nick!

Nick McSpadden

unread,
May 18, 2015, 4:53:47 PM5/18/15
to munki-dev
I've cleaned up the Munki wiki page on managing printers a bit.  Feedback is welcome:

Bertrand Chatain

unread,
May 20, 2015, 11:36:34 AM5/20/15
to munk...@googlegroups.com
Sorry for this maybay studid question but i'm stuck at the beginning

bertrandchatain$ python /Users/bertrandchatain/Desktop/print_generator.py --csv /Users/bertrandchatain/Desktop/printer.csv
Traceback (most recent call last):
  File "/Users/bertrandchatain/Desktop/print_generator.py", line 28, in <module>
    f = open('AddPrinter-Template.plist', 'rb')
IOError: [Errno 2] No such file or directory: 'AddPrinter-Template.plist'

i'm not sure what i must do at line 28
modify the path to 'AddPrinter-Template.plist' ? and what is "rb" ?

the py file and the plist are in the same folder

thanks for yours helps

Nick McSpadden

unread,
May 20, 2015, 11:39:33 AM5/20/15
to munki-dev
That error is because it's complaining it can't find "AddPrinter-Template.plist" in the directory that you are running the script from.

Since you did this:
python /Users/bertrandchatain/Desktop/print_generator.py
That suggests to me that your present working directory isn't actually /Users/bertrandchatain/Desktop/ where the script and plist are.

Try navigating to the directory first and then running it:
cd /Users/bertrandchatain/Desktop/
python print_generator.py --csv printer.csv

Jonathan Cohen

unread,
May 22, 2015, 12:12:19 PM5/22/15
to munk...@googlegroups.com
I ran into an install issue once I got my new plist into my Munki Repo.  It installed the printer with the correct driver and some of the setting but put a display name of DISPLAY_NAME and did not set the correct address of the printer.  I feel like I missed something but I'm not sure where I went wrong.

What I ran to create the plist

./print_generator.py --printername="MaintenanceWorkCentre" --driver="Generic_PCL_OSX.ppd" --address="x.x.x.x" --location="Maintenance Office" --displayname="MaintenanceWorkCentre" --desc="Maintenance Multi-Function Printer" --version=0.1

My resulting plist that I added to my repo

<?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>autoremove</key>
<false/>
<key>catalogs</key>
<array>
<string>beta</string>
</array>
<key>description</key>
<string>Maintenance Multi-Function Printer</string>
<key>display_name</key>
<string>MaintenanceWorkCentre</string>
<key>category</key>
        <string>Printers and Scanners</string>

<key>requires</key>
<string>Generic_PCLDriver_Installer</string>

<key>installcheck_script</key>
<string>#!/usr/bin/python
import subprocess
import sys

printerOptions = {  }

cmd = ['/usr/bin/lpoptions', '-p', 'MaintenanceWorkCentre', '-l']
proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
(lpoptOut, lpoptErr) = proc.communicate()

if lpoptErr:
    sys.exit(0)

for option in lpoptOut.splitlines():
    for myOption in printerOptions.keys():
        optionName = option.split("/", 1)[0]
        optionValues = option.split("/",1)[1].split(":")[1].strip().split(" ")
        for opt in optionValues:
            if "*" in opt:
                actualOptionValue = opt.replace('*', '')
                break
        if optionName == myOption:
            if not printerOptions[myOption] == actualOptionValue:
                sys.exit(0)
                
sys.exit(1)</string>
<key>installer_type</key>
<string>nopkg</string>
<key>minimum_os_version</key>
<string>10.7.0</string>
<key>name</key>
<string>AddPrinter-MaintenanceWorkCentre</string>
<key>postinstall_script</key>
<string>#!/usr/bin/python
import subprocess
import sys

# Populate these options if you want to set specific options for the printer. E.g. duplexing installed, etc.
printerOptions = {  }

cmd = [ '/usr/sbin/lpadmin', '-x', 'MaintenanceWorkCentre' ]
proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
(lpadminxOut, lpadminxErr) = proc.communicate()

# Install the printer
cmd = [ '/usr/sbin/lpadmin',
        '-p', 'MaintenanceWorkCentre',
        '-L', 'Maintenance Office',
        '-D', 'DISPLAY_NAME',
        '-v', 'lpd://ADDRESS',
        '-P', '/Library/Printers/PPDs/Contents/Resources/Generic_PCL_OSX.ppd',
        '-E',
        '-o', 'printer-is-shared=false',
        '-o', 'printer-error-policy=abort-job' ]

for option in printerOptions.keys():
    cmd.append("-o")
    cmd.append(str(option) + "=" +  str(printerOptions[option]))

proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
(lpadminOut, lpadminErr) = proc.communicate()

if lpadminErr:
    print "Error: %s" % lpadminErr
    sys.exit(1)
print "Results: %s" % lpadminOut    
sys.exit(0)</string>
<key>unattended_install</key>
<true/>
<key>uninstall_method</key>
<string>uninstall_script</string>
<key>uninstall_script</key>
<string>#!/bin/bash
/usr/sbin/lpadmin -x MaintenanceWorkCentre</string>
<key>uninstallable</key>
<true/>
<key>version</key>
<string>0.1</string>
</dict>
</plist>


CUPS printer information after MSC install


<Printer MaintenanceWorkCentre>

UUID urn:uuid:8d333376-db9e-36d3-7df6-32a5944f1ee2

Info DISPLAY_NAME

Location Maintenance Office

MakeModel Generic PCL Laser Printer

DeviceURI lpd://ADDRESS

State Idle

StateTime 1432310434

Type 12356

Accepting Yes

Shared No

JobSheets none none

QuotaPeriod 0

PageLimit 0

KLimit 0

OpPolicy default

ErrorPolicy abort-job

</Printer>

Screen Shot 2015-05-22 at 11.09.21 AM.png

Nick McSpadden

unread,
May 22, 2015, 12:19:06 PM5/22/15
to munki-dev
Whoops.  I just pushed a fix to address that.

Also note that if you don't specify a "displayname", it's the same as the "printername" - so if you want it to be identical, you don't need to specify it in both places.

Jonathan Cohen

unread,
May 22, 2015, 1:58:31 PM5/22/15
to munk...@googlegroups.com
Thank you,

Jonathan Cohen

unread,
May 22, 2015, 2:44:01 PM5/22/15
to munk...@googlegroups.com
Ran into another issue.  I used the updated tool to make the new pkginfo file, which worked and put in the correct settings for the device and address.  I tried to indicate the new version at 0.3 and added it to my repo.  Here is the the pkginfo file and associated output.

<?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>autoremove</key>
<false/>
<key>catalogs</key>
<array>
<string>testing</string>
</array>
<key>description</key>
<string></string>
<key>display_name</key>
<string>Maintenance WC3325</string>
        '-D', 'Maintenance WC3325',
        '-v', 'lpd://10.0.10.92',
        '-P', '/Library/Printers/PPDs/Contents/Resources/Generic_PCL_OSX.ppd',
        '-E',
        '-o', 'printer-is-shared=false',
        '-o', 'printer-error-policy=abort-job' ]

for option in printerOptions.keys():
    cmd.append("-o")
    cmd.append(str(option) + "=" +  str(printerOptions[option]))

proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
(lpadminOut, lpadminErr) = proc.communicate()

if lpadminErr:
    print "Error: %s" % lpadminErr
    sys.exit(1)
print "Results: %s" % lpadminOut    
sys.exit(0)</string>
<key>unattended_install</key>
<true/>
<key>uninstall_method</key>
<string>uninstall_script</string>
<key>uninstall_script</key>
<string>#!/bin/bash
/usr/sbin/lpadmin -x MaintenanceWorkCentre</string>
<key>uninstallable</key>
<true/>
<key>version</key>
<string>0.3</string>
</dict>
</plist>


 * Processing manifest item AddPrinter-MaintenanceWorkCentre for optional install

    Looking for detail for: AddPrinter-MaintenanceWorkCentre, version latest...

    Considering 1 items with name AddPrinter-MaintenanceWorkCentre from catalog testing

    Considering item AddPrinter-MaintenanceWorkCentre, version 0.3 with minimum os version required 10.7.0

    Our OS version is 10.10.3

    Found AddPrinter-MaintenanceWorkCentre, version 0.3 in catalog testing

    Running installcheck_script for AddPrinter-MaintenanceWorkCentre

    installcheck_script returned 1

    Running installcheck_script for AddPrinter-MaintenanceWorkCentre

    installcheck_script returned 1

    Adding AddPrinter-MaintenanceWorkCentre to the optional install list


* Processing manifest item AddPrinter-MaintenanceWorkCentre for install

    Looking for detail for: AddPrinter-MaintenanceWorkCentre, version latest...

    Considering 1 items with name AddPrinter-MaintenanceWorkCentre from catalog testing

    Considering item AddPrinter-MaintenanceWorkCentre, version 0.3 with minimum os version required 10.7.0

    Our OS version is 10.10.3

    Found AddPrinter-MaintenanceWorkCentre, version 0.3 in catalog testing

    Running installcheck_script for AddPrinter-MaintenanceWorkCentre

    installcheck_script returned 1

    AddPrinter-MaintenanceWorkCentre version 0.3 (or newer) is already installed.

    Looking for updates for: AddPrinter-MaintenanceWorkCentre

    Looking for updates for: AddPrinter-MaintenanceWorkCentre-0.3

    Looking for updates for: AddPrinter-MaintenanceWorkCentre--0.3


MSC recognizes that it is installed (indicating version 0.3 as the current version) and allows for removal of the printer. When removing the printer, it removes without issue.  If I then re-install the printer, it installs with the updated information from version 0.3 (correct address and such).

Thoughts?


Jonathan Cohen

unread,
May 22, 2015, 2:48:46 PM5/22/15
to munk...@googlegroups.com
Did the versioning not trigger correctly on the post-install script because the address of the printer in question was different from version 0.1 to 0.3?

Nick McSpadden

unread,
May 22, 2015, 3:23:30 PM5/22/15
to munki-dev
The installcheck_script compares the options that are specified by lpoptions.  If there is no change in any of the printer options, and the printername is the same, the pkginfo won't overwrite the existing print queue, because it thinks it's installed.  The idea is that the reinstall will trigger if the queue is removed, or you have new options to specify.

The version number of the pkginfo is more for admin sanity than anything else - the version number isn't actually used to make any determination about installing.

But that raises the good idea that I should make a check on *all* specifiable options - including the address, display name, etc.  Could you please file a GitHub issue about that?


--
You received this message because you are subscribed to the Google Groups "munki-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to munki-dev+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Bertrand Chatain

unread,
May 25, 2015, 8:16:49 AM5/25/15
to munk...@googlegroups.com
Hello, i've made some heavy test with lion and yosemite clients. Fresh or under mcx and never see any printer queue appear.
I have try canon, epson, and xerox printer with no luck.



please find one of my pkginfo, maybay you will see on error
thanks for yours helps

<?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>autoremove</key>
<false/>
<key>catalogs</key>
<array>
<string>testing</string>
</array>
<key>description</key>
<string>MUNKI_CX21</string>
<key>display_name</key>
<string>MUNKI_CX21</string>
<key>installcheck_script</key>
<string>#!/usr/bin/python
import subprocess
import sys

printerOptions = {  }

cmd = ['/usr/bin/lpoptions', '-p', 'MUNKI_CX21', '-l']
proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
(lpoptOut, lpoptErr) = proc.communicate()

if lpoptErr:
    sys.exit(0)

for option in lpoptOut.splitlines():
    for myOption in printerOptions.keys():
        optionName = option.split("/", 1)[0]
        optionValues = option.split("/",1)[1].split(":")[1].strip().split(" ")
        for opt in optionValues:
            if "*" in opt:
                actualOptionValue = opt.replace('*', '')
                break
        if optionName == myOption:
            if not printerOptions[myOption] == actualOptionValue:
                sys.exit(0)
                
sys.exit(1)</string>
<key>installer_type</key>
<string>nopkg</string>
<key>minimum_os_version</key>
<string>10.7.0</string>
<key>name</key>
<string>AddPrinter-MUNKI_CX21</string>
<key>postinstall_script</key>
<string>#!/usr/bin/python
import subprocess
import sys

# Populate these options if you want to set specific options for the printer. E.g. duplexing installed, etc.
printerOptions = {  }

cmd = [ '/usr/bin/lpadmin', '-x', 'MUNKI_CX21' ]
proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
(lpadminxOut, lpadminxErr) = proc.communicate()

# Install the printer
cmd = [ '/usr/sbin/lpadmin',
        '-p', 'MUNKI_CX21',
        '-L', '',
        '-D', 'MUNKI_CX21',
        '-v', 'lpd://172.16.48.5',
        '-P', '/Library/Printers/PPDs/Contents/Resources//Library/Printers/PPDs/Contents/Resources/EPSON AL-CX21.gz',
        '-E',
        '-o', 'printer-is-shared=false',
        '-o', 'printer-error-policy=abort-job' ]

for option in printerOptions.keys():
    cmd.append("-o")
    cmd.append(str(option) + "=" +  str(printerOptions[option]))

proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
(lpadminOut, lpadminErr) = proc.communicate()

if lpadminErr:
    print "Error: %s" % lpadminErr
    sys.exit(1)
print "Results: %s" % lpadminOut    
sys.exit(0)</string>
<key>unattended_install</key>
<true/>
<key>uninstall_method</key>
<string>uninstall_script</string>
<key>uninstall_script</key>
<string>#!/bin/bash
/usr/sbin/lpadmin -x MUNKI_CX21</string>
<key>uninstallable</key>
<true/>
<key>version</key>
<string>1.0</string>
</dict>
</plist>

Nikolai Vincent Vaags

unread,
May 26, 2015, 7:17:00 AM5/26/15
to munk...@googlegroups.com
This is nice!

I've been using the previous printer template script along with my own script for generating copies based on a csv file, similar to what you have here.

I've altered my own generating script to work with the new template. I'll post it here, since it (along with a slightly altered AddPrinter-Template.plist) has a couple of additional features:
1 - it extracts and creates icons from the drivers (if the driver is installed on the computer running the script)
2 - it works with both direct lpd connections, along with SMB servers and whatever other protocols.

the minus is that it is a slightly ugly bash script, and only accepts csv files. But it has worked well for me, and these extra features should be relatively easy to add to the python generator script I would guess.
Creator: http://kujeger.net/munkistuff/PrintCreator.sh
Template: http://kujeger.net/munkistuff/AddPrinter-Template2.plist
Example csv: http://kujeger.net/munkistuff/Template2.csv

Generic printer icon: http://kujeger.net/munkistuff/icons/Printer.png

(whole thing zipped: http://kujeger.net/munkistuff/PrintCreator_2.zip)

--nikolai

Jonathan Cohen

unread,
May 26, 2015, 7:54:41 AM5/26/15
to munk...@googlegroups.com
At first look I think that it is the path to your print driver. When entering the option into the script you only need the final file name, the script adds the path. I noticed that your driver path is doubled up.

For the driver option just type in EPSON AL-CX21.gz and I suspect that it will start working.

Bertrand Chatain

unread,
May 26, 2015, 10:06:02 AM5/26/15
to munk...@googlegroups.com
hello

i have try with your tip but no luck
here is the log from a lion client


May 26 2015 16:02:07 +0200 Installing MUNKI_XEROX_US_V3 (2 of 3)

May 26 2015 16:02:07 +0200     Running postinstall_script for AddPrinter-MUNKI_XEROX_US_V3

May 26 2015 16:02:07 +0200     Traceback (most recent call last):

May 26 2015 16:02:07 +0200       File "/tmp/munki-aQZ7bh/postinstall_script", line 9, in <module>

May 26 2015 16:02:07 +0200         proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)

May 26 2015 16:02:07 +0200       File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 672, in __init__

May 26 2015 16:02:07 +0200       File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1202, in _execute_child

May 26 2015 16:02:07 +0200     OSError: [Errno 2] No such file or directory

May 26 2015 16:02:07 +0200 ERROR: Running postinstall_script for AddPrinter-MUNKI_XEROX_US_V3 failed.

May 26 2015 16:02:07 +0200 ERROR: ------------------------------------------------------------------------------

May 26 2015 16:02:07 +0200 ERROR:  Traceback (most recent call last):

May 26 2015 16:02:07 +0200 ERROR:    File "/tmp/munki-aQZ7bh/postinstall_script", line 9, in <module>

May 26 2015 16:02:07 +0200 ERROR:      proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)

May 26 2015 16:02:07 +0200 ERROR:    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 672, in __init__

May 26 2015 16:02:07 +0200 ERROR:    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1202, in _execute_child

May 26 2015 16:02:07 +0200 ERROR:  OSError: [Errno 2] No such file or directory

May 26 2015 16:02:07 +0200 ERROR: ------------------------------------------------------------------------------

May 26 2015 16:02:07 +0200 WARNING: Postinstall script for AddPrinter-MUNKI_XEROX_US_V3 returned 1

May 26 2015 16:02:07 +0200 Installing MUNKI_XEROX_V2 (3 of 3)

May 26 2015 16:02:07 +0200     Running postinstall_script for AddPrinter-MUNKI_XEROX_V2

May 26 2015 16:02:07 +0200     Traceback (most recent call last):

May 26 2015 16:02:07 +0200       File "/tmp/munki-aQZ7bh/postinstall_script", line 9, in <module>

May 26 2015 16:02:07 +0200         proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)

May 26 2015 16:02:07 +0200       File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 672, in __init__

May 26 2015 16:02:07 +0200       File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1202, in _execute_child

May 26 2015 16:02:07 +0200     OSError: [Errno 2] No such file or directory

May 26 2015 16:02:07 +0200 ERROR: Running postinstall_script for AddPrinter-MUNKI_XEROX_V2 failed.

May 26 2015 16:02:07 +0200 ERROR: ------------------------------------------------------------------------------

May 26 2015 16:02:07 +0200 ERROR:  Traceback (most recent call last):

May 26 2015 16:02:07 +0200 ERROR:    File "/tmp/munki-aQZ7bh/postinstall_script", line 9, in <module>

May 26 2015 16:02:07 +0200 ERROR:      proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)

May 26 2015 16:02:07 +0200 ERROR:    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 672, in __init__

May 26 2015 16:02:07 +0200 ERROR:    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1202, in _execute_child

May 26 2015 16:02:07 +0200 ERROR:  OSError: [Errno 2] No such file or directory

May 26 2015 16:02:07 +0200 ERROR: ------------------------------------------------------------------------------

May 26 2015 16:02:07 +0200 WARNING: Postinstall script for AddPrinter-MUNKI_XEROX_V2 returned 1

May 26 2015 16:02:07 +0200 ###    End managed installer session    ###

May 26 2015 16:02:07 +0200 Finishing...

Nick McSpadden

unread,
May 26, 2015, 11:05:25 AM5/26/15
to munki-dev
Bertrand,

As Jonathan Cohen pointed out, the problem is here:
# Install the printer
cmd = [ '/usr/sbin/lpadmin',
        '-p', 'MUNKI_CX21',
        '-L', '',
        '-D', 'MUNKI_CX21',
        '-v', 'lpd://172.16.48.5',
        '-P', '/Library/Printers/PPDs/Contents/Resources//Library/Printers/PPDs/Contents/Resources/EPSON AL-CX21.gz',
        '-E',
        '-o', 'printer-is-shared=false',
        '-o', 'printer-error-policy=abort-job' ]

Specifically:  
'/Library/Printers/PPDs/Contents/Resources//Library/Printers/PPDs/Contents/Resources/EPSON AL-CX21.gz',
Does that path exist on your clients?  I'm willing to bet it doesn't.

The path you are looking for is almost certainly:
 /Library/Printers/PPDs/Contents/Resources/EPSON AL-CX21.gz

The printer generator script does not take a whole path to the driver file - only the name of the file that is located in /Library/Printers/PPDs/Contents/Resources/.

Please let me know if I need to make that clearer in the documentation.

--
You received this message because you are subscribed to the Google Groups "munki-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to munki-dev+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Bertrand Chatain

unread,
May 26, 2015, 11:30:51 AM5/26/15
to munk...@googlegroups.com
Hello

i have cleared all my pkginfo files to be sure that i use the good file.

the error is the same

May 26 2015 17:23:56 +0200 ### Beginning managed installer session ###
May 26 2015 17:23:56 +0200 Processing installs
May 26 2015 17:23:56 +0200 Installing MUNKI_XEROX_US_V3 (1 of 2)
May 26 2015 17:23:56 +0200     Running postinstall_script for AddPrinter-MUNKI_XEROX_US_V3
May 26 2015 17:23:56 +0200     Traceback (most recent call last):
May 26 2015 17:23:56 +0200       File "/tmp/munki-7S4TRl/postinstall_script", line 9, in <module>
May 26 2015 17:23:56 +0200         proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
May 26 2015 17:23:56 +0200       File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 672, in __init__
May 26 2015 17:23:56 +0200       File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1202, in _execute_child
May 26 2015 17:23:56 +0200     OSError: [Errno 2] No such file or directory
May 26 2015 17:23:56 +0200 ERROR: Running postinstall_script for AddPrinter-MUNKI_XEROX_US_V3 failed.
May 26 2015 17:23:56 +0200 ERROR: ------------------------------------------------------------------------------
May 26 2015 17:23:56 +0200 ERROR: Traceback (most recent call last):
May 26 2015 17:23:56 +0200 ERROR:  File "/tmp/munki-7S4TRl/postinstall_script", line 9, in <module>
May 26 2015 17:23:56 +0200 ERROR:    proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
May 26 2015 17:23:56 +0200 ERROR:  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 672, in __init__
May 26 2015 17:23:56 +0200 ERROR:  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1202, in _execute_child
May 26 2015 17:23:56 +0200 ERROR: OSError: [Errno 2] No such file or directory
May 26 2015 17:23:56 +0200 ERROR: ------------------------------------------------------------------------------
May 26 2015 17:23:56 +0200 WARNING: Postinstall script for AddPrinter-MUNKI_XEROX_US_V3 returned 1
May 26 2015 17:23:56 +0200 Installing MUNKI_CX21_US_V3 (2 of 2)
May 26 2015 17:23:56 +0200     Running postinstall_script for AddPrinter-MUNKI_CX21_US_V3
May 26 2015 17:23:56 +0200     Traceback (most recent call last):
May 26 2015 17:23:56 +0200       File "/tmp/munki-7S4TRl/postinstall_script", line 9, in <module>
May 26 2015 17:23:56 +0200         proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
May 26 2015 17:23:56 +0200       File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 672, in __init__
May 26 2015 17:23:56 +0200       File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1202, in _execute_child
May 26 2015 17:23:56 +0200     OSError: [Errno 2] No such file or directory
May 26 2015 17:23:56 +0200     
May 26 2015 17:23:56 +0200 ERROR: Running postinstall_script for AddPrinter-MUNKI_CX21_US_V3 failed.
May 26 2015 17:23:56 +0200 ERROR: ------------------------------------------------------------------------------
May 26 2015 17:23:56 +0200 ERROR: Traceback (most recent call last):
May 26 2015 17:23:56 +0200 ERROR:  File "/tmp/munki-7S4TRl/postinstall_script", line 9, in <module>
May 26 2015 17:23:56 +0200 ERROR:    proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
May 26 2015 17:23:56 +0200 ERROR:  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 672, in __init__
May 26 2015 17:23:56 +0200 ERROR:  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1202, in _execute_child
May 26 2015 17:23:56 +0200 ERROR: OSError: [Errno 2] No such file or directory
May 26 2015 17:23:56 +0200 ERROR: 
May 26 2015 17:23:56 +0200 ERROR: ------------------------------------------------------------------------------
May 26 2015 17:23:56 +0200 WARNING: Postinstall script for AddPrinter-MUNKI_CX21_US_V3 returned 1
May 26 2015 17:23:56 +0200 ###    End managed installer session    ###
May 26 2015 17:23:56 +0200 Finishing...
AddPrinter-MUNKI_CX21_US_V3-1.0.pkginfo
AddPrinter-MUNKI_XEROX_US_V3-1.0.pkginfo

Nick McSpadden

unread,
May 26, 2015, 11:35:57 AM5/26/15
to munki-dev
Bertrand, 

The error suggests that you still haven't fixed your problem:
OSError: [Errno 2] No such file or directory

Please update your pkginfo with the correct path to the driver. 

Bertrand Chatain

unread,
May 27, 2015, 7:12:15 AM5/27/15
to munk...@googlegroups.com
hello,

i have try try and try but nothings seems to work for me.
I tried different path
Xerox\ Phaser\ 6128MFP-N.gz
Xerox Phaser 6128MFP-N.gz

I have try with csv method and cli method, no difference

always this error
May 27 2015 12:47:21 +0200 ERROR: Traceback (most recent call last):
May 27 2015 12:47:21 +0200 ERROR:  File "/tmp/munki-Bwzt3H/postinstall_script", line 9, in <module>
May 27 2015 12:47:21 +0200 ERROR:    proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
May 27 2015 12:47:21 +0200 ERROR:  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 672, in __init__
May 27 2015 12:47:21 +0200 ERROR:  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1202, in _execute_child
May 27 2015 12:47:21 +0200 ERROR: OSError: [Errno 2] No such file or directory

Is someone can send me a working printer pkginfo to compare ?

Thanks

Nick McSpadden

unread,
May 27, 2015, 9:32:57 AM5/27/15
to munki-dev
Apologies, Bertrand!  

I didn't notice earlier, but you have an earlier version of the script where I typed the path of the command incorrectly.  It's trying to do /usr/bin/lpadmin instead of the correct /usr/sbin/lpadmin - an embarrassing mistake on my part.  Please download the latest version from GitHub.

Bertrand Chatain

unread,
May 27, 2015, 11:35:35 AM5/27/15
to munk...@googlegroups.com
Yes that's it

my printer appear !

thansk all for your helps

Emiaj Oper

unread,
Aug 27, 2015, 4:16:15 PM8/27/15
to munki-dev
I've been trying to get a Ricoh on the floor to print in color and nothing I have configured seems to effect the outcome - it simply prints in black.  My process is pretty straightforward.  The drivers exist on the machine (having munki push those out ahead of the queue being created via the pkginfo), and the nopkg pkginfo is mapping the printer correctly and successfully prints, but never in color.

If I map directly to the printer via IP outside of using munki, it defaults to printing in color so I'm confused as to where I'm going wrong.

This is a list of options available for the Ricoh printer.  The ones bolded I've included in the pkginfo:

Option1/Option Tray: *None 1Cassette 2Cassette
Option20/Internal Tray 2: *False True
 Option25/Internal Shift Tray: *False True
 Option30/Finisher: *None Fin500 Fin1000 BookletFinisher
 RIPaperPolicy/Fit to Paper: *PromptUser NearestSizeAdjust NearestSizeNoAdjust
 PageSize/Media Size: A3 *A4 A5 A6 B4 B5 B6 Legal Letter HalfLetter 11x17 12x18 Executive F Folio FanFoldGermanLegal Env10 EnvMonarch EnvC5 EnvC6 DLEnv 8Kai 16Kai Custom.WIDTHxHEIGHT
 InputSlot/Media Source: MultiTray *1Tray 2Tray 3Tray 4Tray
 Duplex/Duplex: *None DuplexNoTumble DuplexTumble
 RICollate/Collate: *False True
 RIPrintMode/Toner Saving: *0rhit 5rhit
 Rimagesm/Image Smoothing: *Off On Auto 90ppi 150ppi 200ppi 300ppi
ColorModel/Color Mode: *CMYK Gray
 RPSBitsPerPixel/Gradation: 1BitsPerPixel *2BitsPerPixel 4BitsPerPixel
RPSRGBcorrect/Color Setting: None DetailNormal *DetailBright
 RPSColorRendDict/Color Profile: *Auto Photograph Business Colorimetric User Clpsimulation1 Clpsimulation2
 RPSDitherType/Dithering: *Auto Photo Letter User
 RPSBlackMode/Gray Reproduction (Text/Line Art): *gray 1Color 4Color grayText 1ColorText
RPSBlackOverPrint/Black Over Print: True *False
 RPSColorSep/Separate into CMYK: *None Cyan Magenta Yellow Black Red Green Blue KCyan KMagenta KYellow
 Rcmyksimulation/CMYK Simulation Profile: *Off USOffsetPrint Euroscale JapanColor PANTONE
 MediaType/Paper Type: *Auto Plain Recycled Special Special2 Special3 Color Letterhead Preprinted Labels Bond Cardstock OHP Thick Thick2 Thick3 Thin Middlethick None
 OutputBin/Destination: *Default InternalTray1 InternalTray2 InternalShiftTray FinisherKanoShiftTray FinisherKingUpperTray FinisherKingShiftTray FinisherTigUpperTray FinisherTigShiftTray FinisherTigBookletTray
 StapleLocation/Staple: *None UpperLeft UpperRight LowerLeft LowerRight LeftW RightW UpperW LowerW CenterW
 RIPunch/Punch: *None Left2 Left3 Left4 Right2 Right3 Right4 Upper2 Upper3 Upper4 Lower2 Lower3 Lower4
 RIOrientOvr/Orientation Override: *Off Landscape Portrait


<?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>autoremove</key>
 
<false/>
 
<key>catalogs</key>
 
<array>
 
<string>testing</string>

 
<string>production</string>
 
</array>
 
<key>description</key>
 
<string>RICOH Aficio MP 2500</string>
 
<key>display_name</key>
 
<string>KC Printer 3 - Ricoh MP 2500</string>
 
<key>installcheck_script</key>
 
<string>#!/usr/bin/python
import subprocess
import sys
import shlex


printerOptions = { "ColorModel":"CMYK", "RPSRGBcorrect":"DetailBright", "RPSBlackOverPrint":"False" }


cmd = ['/usr/bin/lpoptions', '-p', 'KCTYMO1.Printer3.Color', '-l']

proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
(lpoptLongOut, lpoptErr) = proc.communicate()


# lpoptions -p printername -l will still exit 0 even if printername does not exist
# but it will print to stderr
if lpoptErr:
    print lpoptErr
    sys.exit(0)


cmd = ['/usr/bin/lpoptions', '-p', 'KCTYMO1.Printer3.Color']

proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
(lpoptOut, lpoptErr) = proc.communicate()


#Note: lpoptions -p printername will never fail. If KCTYMO1.Printer3.Color does not exist, it
#will still exit 0, but just produce no output.  
#Thanks, cups, I was having a good day until now.


for option in lpoptLongOut.splitlines():

    for myOption in printerOptions.keys():
        optionName = option.split("/", 1)[0]
        optionValues = option.split("/",1)[1].split(":")[1].strip().split(" ")
        for opt in optionValues:
            if "*" in opt:
                actualOptionValue = opt.replace('*', '')
                break
        if optionName == myOption:
            if not printerOptions[myOption] == actualOptionValue:
                print "Found mismatch: %s is '%s', should be '%s'" % (myOption, printerOptions[myOption], actualOptionValue)
                sys.exit(0)


optionDict = dict()                
for builtOption in shlex.split(lpoptOut):
    optionDict[builtOption.split("=")[0]] = builtOption.split("=")[1]
   
comparisonDict = { "device-uri":"KCTYMO1.Printer3.Color", "printer-info":"KC Printer 3 - Ricoh C2500", "printer-location":"Kansas City", "printer-make-and-model":"RICOH Aficio MP 2500" }
for keyName in comparisonDict.keys():
    if not comparisonDict[keyName] == optionDict[keyName]:
        print "Settings mismatch: %s is '%s', should be '%s'" % (keyName, optionDict[keyName], comparisonDict[keyName])
        sys.exit(0)


sys.exit(1)
</string>

 
<key>installer_type</key>
 
<string>nopkg</string>
 
<key>minimum_os_version</key>
 
<string>10.7.0</string>
 
<key>name</key>

 
<string>AddPrinter_KCTYMO1.Printer3.Color</string>

 
<key>postinstall_script</key>
 
<string>#!/usr/bin/python
import subprocess
import sys


# Populate these options if you want to set specific options for the printer. E.g. duplexing installed, etc.
printerOptions = { "ColorModel":"CMYK", "RPSRGBcorrect":"DetailBright", "RPSBlackOverPrint":"False" }


cmd = [ '/usr/sbin/lpadmin', '-x', 'KCTYMO1.Printer3.Color' ]

proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
(lpadminxOut, lpadminxErr) = proc.communicate()



# Install the printer
cmd = [ '/usr/sbin/lpadmin',
        '-p', 'KCTYMO1.Printer3.Color',
        '-L', 'Kansas City',
        '-D', 'KC Printer 3',
        '-v', 'lpd://myprintserver/KCTYMO1.Printer3.Color',
        '-P', '/Library/Printers/PPDs/Contents/Resources/RICOH Aficio MP 2500',

        '-E',
        '-o', 'printer-is-shared=false',
        '-o', 'printer-error-policy=abort-job' ]


for option in printerOptions.keys():
    cmd.append("-o")
    cmd.append(str(option) + "=" +  str(printerOptions[option]))


proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
(lpadminOut, lpadminErr) = proc.communicate()


if lpadminErr:
    print "Error: %s" % lpadminErr
    sys.exit(1)
print "Results: %s" % lpadminOut    
sys.exit(0)
</string>

 
<key>unattended_install</key>
 
<true/>
 
<key>uninstall_method</key>
 
<string>uninstall_script</string>
 
<key>uninstall_script</key>
 
<string>
#!/bin/bash
/usr/sbin/lpadmin -x KCTYMO1.Printer3.Color
</string>

 
<key>uninstallable</key>
 
<true/>
 
<key>version</key>
 
<string>1.0</string>
</dict>
</plist>


Whether or not the job goes through the print server or directly to the printer doesn't seem to make a difference when it's mapped via this pkginfo; I've tried both and they kick off and prints in b/w.  Manually mapping to that printer via IP (outside of this automation I'm trying to setup) defaults the job in color.

Any ideas?

A.E. van Bochoven

unread,
Aug 27, 2015, 4:29:18 PM8/27/15
to munk...@googlegroups.com
I would diff

lpoptions -p KCTYMO1.Printer3.Color -l

with the manual install.

-Arjen
> --
> Find related discussion groups here:
> https://github.com/munki/munki/wiki/Discussion-Group
> ---
> You received this message because you are subscribed to the Google Groups "munki-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to munki-dev+...@googlegroups.com.
> To post to this group, send email to munk...@googlegroups.com.

Emiaj Oper

unread,
Aug 27, 2015, 4:55:40 PM8/27/15
to munki-dev
Thanks Arjen, this is manually mapped via IP.  Nothing is jumping out at me as having been missed:

lpoptions -p _10_115_17_17 -l
Option1/Option Tray: *None 1Cassette 2Cassette
Option20/Internal Tray 2: *False True
Option25/Internal Shift Tray: *False True
Option30/Finisher: *None Fin500 Fin1000 BookletFinisher
RIPaperPolicy/Fit to Paper: *PromptUser NearestSizeAdjust NearestSizeNoAdjust
PageSize/Media Size: A3 *A4 A5 A6 B4 B5 B6 Legal Letter HalfLetter 11x17 12x18 Executive F Folio FanFoldGermanLegal Env10 EnvMonarch EnvC5 EnvC6 DLEnv 8Kai 16Kai Custom.WIDTHxHEIGHT
InputSlot/Media Source: MultiTray *1Tray 2Tray 3Tray 4Tray
Duplex/Duplex: *None DuplexNoTumble DuplexTumble
RICollate/Collate: *False True
RIPrintMode/Toner Saving: *0rhit 5rhit
Rimagesm/Image Smoothing: *Off On Auto 90ppi 150ppi 200ppi 300ppi
ColorModel/Color Mode: *CMYK Gray
RPSBitsPerPixel/Gradation: 1BitsPerPixel *2BitsPerPixel 4BitsPerPixel
RPSRGBcorrect/Color Setting: None DetailNormal *DetailBright
RPSColorRendDict/Color Profile: *Auto Photograph Business Colorimetric User Clpsimulation1 Clpsimulation2
RPSDitherType/Dithering: *Auto Photo Letter User
RPSBlackMode/Gray Reproduction (Text/Line Art): *gray 1Color 4Color grayText 1ColorText
RPSBlackOverPrint/Black Over Print: True *False


Emiaj Oper

unread,
Aug 27, 2015, 5:01:16 PM8/27/15
to munki-dev

Emiaj Oper

unread,
Aug 27, 2015, 5:04:56 PM8/27/15
to munki-dev
Doesn't appear it's picking up the options I specified in the pkginfo.  Have I made an error in my syntax?

A.E. van Bochoven

unread,
Aug 27, 2015, 5:17:13 PM8/27/15
to munk...@googlegroups.com
You could start by running the lpadmin command manually, so take the install script out of the equation.

By the way, we also have RICOH printers, but all my ppds end in .gz

'/Library/Printers/PPDs/Contents/Resources/RICOH MP 2501.gz'

-Arjen

Emiaj Oper

unread,
Aug 27, 2015, 5:47:07 PM8/27/15
to munki-dev
Not sure why the drivers I pulled from Ricoh didn't include that extension.   The Ricoh driver bundle seemed to cover all 3 models of Ricoh's we have, and a slew of drivers we'll never use.   The HP drivers I downloaded include .gz.   Seems odd to me, but I'm fairly new to CUPS and OS X so I see things that don't make sense to me regularly - figured it had something to do with the fact they were bundled together.

John Putnam

unread,
Aug 28, 2015, 9:42:51 AM8/28/15
to munki-dev
I just encountered a similar issue. The files that I downloaded from Ricoh's web site are just the PPD files. To get the files that end in .gz I had to install the Ricoh Printer Drivers v2.5 for OS X from the Apple downloads page.

Emiaj Oper

unread,
Aug 28, 2015, 10:50:55 AM8/28/15
to munki-dev
That was the problem!  After I downloaded the Ricoh drivers from Apple and pointed to the correct one - it worked as expected.

Thanks for the help Arjen and John!   I really appreciate it.

Happy Friday

Kostas Backas-Gmail

unread,
Aug 28, 2015, 4:15:27 PM8/28/15
to munk...@googlegroups.com
Can you please share where did you get the Ricoh drivers from Apple? I have an installation of a c5501 that prints garbage with drivers from the Ricoh page?

Best regards

Kostas

Emiaj Oper

unread,
Aug 28, 2015, 5:16:22 PM8/28/15
to munki-dev
https://support.apple.com/kb/DL902?locale=en_US should work.

That driver is in the bundle.
To unsubscribe from this group and stop receiving emails from it, send an email to munki-dev+unsubscribe@googlegroups.com.

Eric Dannewitz

unread,
Sep 3, 2015, 6:04:38 PM9/3/15
to munki-dev
I have sort of a similar problem with my 10.10 installs. We used DeployStudio with the Macs downloading a package to install 10.10.4, munki 2, and create two users. That works great. Then when that was done, they macs would be netbooted again to do some binding to our OD, setting Wifi passwords, setting up Munki, naming them. That worked great too.

Now, I noticed that none of these computers seem to have PPDs for Printers. So when I go to ARD and give it a:
lpadmin -p "5B-LJP2015" -v "lpd://5A-LJP2015" -D "5A-LJP2015" -L "5A Classroom" -P "/Library/Printers/PPDs/Contents/Resources/HP LaserJet P2015.gz" -E

It returns an error as the .gz files aren't there. 

How does one fix this?

On Thursday, December 4, 2014 at 8:06:03 AM UTC-8, Adam M. Anklewicz wrote:
There are a lot of problems with Managing Printers With Munki page on the wiki and would like to make some major changes, but I’d like to make sure I’m not in the wrong in my opinions on the document.

  1. Introduction: Mentioning the downfalls of MCX without mentioning how Munki can relieve this
  1. PKG vs NOPKG: It seems silly that the nopkg method is second, as it requires no extra software, and honestly seems easier.
  1. There’s a lot of mentions of I, that should probably change. ("I am using The Luggage to build the packages to install the printers." Should be, “The following method uses The Luggage, however any packager can be used."
  2. All examples seem to use different printers and different versions. This should be merged to one for example purposes.
  3. Even before the PKG or NOPKG methods should be the data that must be used, a collection of all variables, and how to find out printer options.
  4. “There are some pros and cons to this approach, but here’s the method” leaves you hanging, no need to have this and it will be addressed later in the file.
  5.  Replace "As of Munki 0.8.3.1634, there is now a "nopkg" type for package-free installation.  This allows us to run scripts directly in Munki without having to create packages to install.  We can use this "nopkg" type to run all of our printer installs from Munki pkginfos, which allows for easy editing in the future.” with "Requirements: Munki 0.8.3.1634 or later.”
  6. Why is there a step 1.5, it should either be 1, 2, 3 or just Step 1, create three necessary scripts. Probably three steps.
  7. Makes the call "makepkginfo --installcheck_script=installcheck_script.sh --uninstall_script=uninstall_script.sh > printer.pkginfo” and forgets to include postintall_script.sh
  8. Has the super-vague instruction "Fill in the rest of the important things into the pkginfo”. Later says these are description, display_name, name, and version. If we have before all the possible variables, we can just tell the user to run "/usr/local/munki/makepkginfo —name=NAME —displayname=DISPLAYNAME —description=DESCRIPTION —pkgvers=VERSION -c CATALOG —developer=DEVELOPER —category=CATEGORY --nopkg --installcheck_script=installcheck_script.sh --uninstall_script=uninstall_script.sh --postinstall_script=postinstall_script.sh > NOPKGNAME.pkginfo”
  9. "Throw your pkginfo into your Munki repo and makecatalogs.  Add it to a manifest, and test it out!” should be two steps, “Place in /PATH/TO/munki_repo/pkginfo” then another step of run makecatalogs

Nick McSpadden

unread,
Sep 3, 2015, 6:08:23 PM9/3/15
to munk...@googlegroups.com
On Thu, Sep 3, 2015 at 3:04 PM, Eric Dannewitz <edann...@rdschool.org> wrote:
Now, I noticed that none of these computers seem to have PPDs for Printers. So when I go to ARD and give it a:
lpadmin -p "5B-LJP2015" -v "lpd://5A-LJP2015" -D "5A-LJP2015" -L "5A Classroom" -P "/Library/Printers/PPDs/Contents/Resources/HP LaserJet P2015.gz" -E

It returns an error as the .gz files aren't there. 

How does one fix this?

 
You're telling lpadmin to install a printer queue using a driver at this location: 
/Library/Printers/PPDs/Contents/Resources/HP LaserJet P2015.gz

If that file doesn't exist at that location, it's not going to work.  Simple as that.

If you want to fix it, make sure that driver you're telling lpadmin to use exists at that location before you run that command.   Either install the HP Printer driver package, or use ARD or some other tool to make sure the appropriate file you expect to be there ends up at that location during deployment.

--
--
Nick McSpadden
nmcsp...@gmail.com

Ryan Manly

unread,
Sep 4, 2015, 11:29:43 AM9/4/15
to munk...@googlegroups.com
Set you printer installation pkgsinfo to require the driver installer pkg.
Reply all
Reply to author
Forward
0 new messages