Skip to content

Instantly share code, notes, and snippets.

@grahamgilbert
Created August 18, 2012 20:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save grahamgilbert/3389456 to your computer and use it in GitHub Desktop.
Save grahamgilbert/3389456 to your computer and use it in GitHub Desktop.
Location based printer setup
case $operatingsystem{
Darwin:{
##London is is on the 10.30.2.0 and 10.30.3.0 Subnets
if ($network_en0 == '10.30.2.0') or ($network_en1 == '10.30.2.0') or ($network_en0 == '10.30.3.0') or ($network_en1 == '10.30.3.0'){
printer { "Sharp_ARM316":
ensure => present,
uri => "lpd://sharparm316.ldn.example.com",
description => "Sharp ARM316",
shared => false,
ppd => "/Library/Printers/PPDs/Contents/Resources/SHARP AR-M316.PPD.gz", # PPD file will be autorequired
}
printer { "Xerox_WorkCentre_7120":
ensure => present,
uri => "lpd://xeroxwc7120.ldn.example.com",
description => "Xerox WorkCentre 7120",
shared => false,
ppd => "/Library/Printers/PPDs/Contents/Resources/Xerox WorkCentre 7120.gz", # PPD file will be autorequired
}
}
##San Francisco is on the 10.30.10.0 Subnet
if ($network_en0 == '10.30.10.0') or ($network_en1 == '10.30.10.0'){
printer { "Xerox_550":
ensure => present,
uri => "lpd://xerox550.sf.example.com",
description => "Xerox 550",
shared => false,
ppd => "/Library/Printers/PPDs/Contents/Resources/en.lproj/Xerox 550-560 Integrated Fiery", # PPD file will be autorequired
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment