Browse files

Module name complies with puppet forge suggested name.

Reworded some of the README for clarity.
Corrected a localization problem with the printers fact.
  • Loading branch information...
1 parent 3dc6f92 commit b152b6e0e5aa16e2ce759af5e47456010c16aa6e @mosen committed Jul 30, 2012
Showing with 14 additions and 14 deletions.
  1. +2 −2 Modulefile
  2. +11 −11
  3. +1 −1 lib/facter/printers.rb
@@ -1,7 +1,7 @@
-name 'cups'
+name 'mosen-cups'
author 'mosen'
description 'CUPS printer management'
source ''
summary 'This module manages printers and printer default options in CUPS via the cups command line utilities'
license 'GPLv3'
-version '0.0.1'
+version '1.0.0'
@@ -11,25 +11,21 @@ Limitations:
+ It currently does not set default printers.
+ It does not set vendor ppd options (where an external process is responsible for modifying the ppd).
-This document is loosely based upon puppetlabs-firewall README, so credit to the maintainers of puppetlabs-firewall for
-establishing the format.
### Installation
-This module should be checked out or otherwise copied into your modulepath.
+This module should be cloned or otherwise copied into your modulepath.
If you are not sure where your module path is try this command:
puppet --configprint modulepath
-This module uses Ruby based providers so your Puppet configuration
-(ie. puppet.conf) must include the following items:
+This module provides new types in the form of plugins, so your Puppet configuration
+(ie. puppet.conf) must include a pluginsync directive like this:
pluginsync = true
-The module will not operate normally without these features enabled for the
+Without pluginsync, any manifest with a `printer` resource in it will throw an error.
### Examples
@@ -55,7 +51,9 @@ More advanced install using most of the available properties:
uri => "lpd://localhost/printer_a",
description => "This is the printer description",
location => "Main office",
- ppd => "/Library/Printers/PPDs/Printer.ppd", # PPD file will be autorequired
+ ppd => "/Library/Printers/PPDs/Printer.ppd", # Full path to vendor PPD
+ # OR
+ model => "", # A valid model, you can list these with lpinfo -m
enabled => true, # Enabled by default
shared => false, # Disabled by default
options => { media => 'A4' }, # Hash of options ( name => value )
@@ -71,6 +69,7 @@ For instance if you wanted to default the media option to 'A4' for all printers:
You can also set printer_defaults to ensure => absent, if you want the option to be unset.
+### Facts
The module provides access to one additional facter fact "printers", which provides a comma separated list of installed
@@ -93,15 +92,16 @@ if the vendor has supplied a PPD with Apple extensions i.e You see a UI which al
you need to generate your own ppd first for distribution.
I would recommend doing a manual installation of the printer with the customizations from the ui picker, and then using
-the resulting PPD as the printer description.
+the resulting PPD as the printer description. On OS X you can retrieve the ppd from /private/etc/cups/ppd after you have
+customized the printer features.
### Contributing
You can issue a pull request and send me a message if you like, and I will consider taking the patch upstream :)
### Testing
-The tests are really only basic at the moment.
+The tests need a lot of improvement, but you can run them with RSpec in the typical way:
Make sure you have:
@@ -3,7 +3,7 @@
Facter.add(:printers) do
setcode do
- stdin, stdout, stderr = Open3.popen3('/usr/bin/lpstat -p')
+ stdin, stdout, stderr = Open3.popen3('LANG=C /usr/bin/lpstat -p')
printers =
printers = printers.split("\n").map do |line|

0 comments on commit b152b6e

Please sign in to comment.