Compare commits

..

No commits in common. "7a1feec74eb0ad2c4bafd1d79824855ce416c7e1" and "89b7e687583c35d9694ff86357e327ed7c746399" have entirely different histories.

View File

@ -1,36 +1,17 @@
# "ClassroomColor": "Dell C2660dn Color Laser PS", # install the driver inf
{% set printers = { "PNPUtil.exe /add-driver \\\\ucs\\software\\drivers\\dell\\c2660dn_PS\\DLPRFAL.inf /install":
"ClassroomColor_HP": "HP LJ300-400 color M351-M451 PCL6 Class Driver",
"Classroom_MFP": "Brother MFC-9970CDW Printer"
}
%}
# install all printer driver inf files
"PNPUtil.exe /add-driver \\\\ucs\\software\\drivers\\printers\\*.inf /subdirs /install":
cmd.run: cmd.run:
- shell: powershell - shell: powershell
# TODO: ideally would actually check for success better - unless: Get-PrinterDriver -Name 'Dell C2660dn Color Laser PS'
- success_retcodes: [1]
{% for printer, driver in printers.items() %}
# add the driver as a printer driver # add the driver as a printer driver
"Add-PrinterDriver -Name '{{ driver }}'": "Add-PrinterDriver -Name 'Dell C2660dn Color Laser PS'":
cmd.run: cmd.run:
- shell: powershell - shell: powershell
- unless: Get-PrinterDriver -Name '{{ driver }}' - unless: Get-PrinterDriver -Name 'Dell C2660dn Color Laser PS'
# add the printer # add the printer
"Add-Printer -Name '{{ printer | replace('_', ' ')}}' -PortName 'http://ucs.sawtooth.claremontmakerspace.org:631/printers/{{ printer }}' -DriverName '{{ driver }}'": "Add-Printer -Name ClassroomColor -PortName 'http://ucs.sawtooth.claremontmakerspace.org:631/printers/ClassroomColor' -DriverName 'Dell C2660dn Color Laser PS'":
cmd.run: cmd.run:
- shell: powershell - shell: powershell
- unless: Get-Printer -Name '{{ printer | replace('_', ' ') }}' - unless: Get-Printer -Name ClassroomColor
{% endfor %}
# enable duplexer for Classroom HP
"Set-PrinterProperty -PrinterName 'ClassroomColor HP' -PropertyName Config:DuplexUnit -Value Installed":
cmd.run:
- shell: powershell
- unless:
- if ($(Get-PrinterProperty -PrinterName "ClassroomColor HP" -PropertyName Config:DuplexUnit).value -eq "Installed") { exit 0 } else { exit 1 }