From 13eed061245f8ccb4b8245cc503c93f6d1b04fbf Mon Sep 17 00:00:00 2001 From: Timo Makinen Date: Sat, 1 Feb 2025 16:33:37 +0000 Subject: [PATCH] cups_server: Fix sharing options --- .../files/cups-ppd/Samsung_ML-3051ND.ppd | 219 ++++++++++++++++++ roles/cups_server/tasks/main.yml | 19 +- 2 files changed, 236 insertions(+), 2 deletions(-) create mode 100644 roles/cups_server/files/cups-ppd/Samsung_ML-3051ND.ppd diff --git a/roles/cups_server/files/cups-ppd/Samsung_ML-3051ND.ppd b/roles/cups_server/files/cups-ppd/Samsung_ML-3051ND.ppd new file mode 100644 index 0000000..2e13ae2 --- /dev/null +++ b/roles/cups_server/files/cups-ppd/Samsung_ML-3051ND.ppd @@ -0,0 +1,219 @@ +*PPD-Adobe: "4.3" +*% +*% For information on using this, and to obtain the required backend +*% script, consult http://www.openprinting.org/ +*% +*% This file is published under the GNU General Public License +*% +*% PPD-O-MATIC (4.0.0 or newer) generated this PPD file. It is for use with +*% all programs and environments which use PPD files for dealing with +*% printer capability information. The printer must be configured with the +*% "foomatic-rip" backend filter script of Foomatic 4.0.0 or newer. This +*% file and "foomatic-rip" work together to support PPD-controlled printer +*% driver option access with all supported printer drivers and printing +*% spoolers. +*% +*% To save this file on your disk, wait until the download has completed +*% (the animation of the browser logo must stop) and then use the +*% "Save as..." command in the "File" menu of your browser or in the +*% pop-up manu when you click on this document with the right mouse button. +*% DO NOT cut and paste this file into an editor with your mouse. This can +*% introduce additional line breaks which lead to unexpected results. +*% +*% You may save this file as 'Samsung-ML-3051ND-Postscript.ppd' +*% +*% +*FormatVersion: "4.3" +*FileVersion: "1.1" +*LanguageVersion: English +*LanguageEncoding: ISOLatin1 +*PCFileName: "POSTSCRI.PPD" +*Manufacturer: "Samsung" +*Product: "(ML-3051ND)" +*cupsVersion: 1.0 +*cupsManualCopies: True +*cupsModelNumber: 2 +*cupsFilter: "application/vnd.cups-postscript 100 foomatic-rip" +*cupsFilter: "application/vnd.cups-pdf 0 foomatic-rip" +*%pprRIP: foomatic-rip other +*ModelName: "Samsung ML-3051ND" +*ShortNickName: "Samsung ML-3051ND Postscript" +*NickName: "Samsung ML-3051ND Foomatic/Postscript (recommended)" +*PSVersion: "(3010.000) 550" +*PSVersion: "(3010.000) 651" +*PSVersion: "(3010.000) 652" +*PSVersion: "(3010.000) 653" +*PSVersion: "(3010.000) 704" +*PSVersion: "(3010.000) 705" +*PSVersion: "(3010.000) 800" +*PSVersion: "(3010.000) 815" +*PSVersion: "(3010.000) 850" +*PSVersion: "(3010.000) 860" +*PSVersion: "(3010.000) 861" +*PSVersion: "(3010.000) 862" +*PSVersion: "(3010.000) 863" +*PSVersion: "(3010.000) 864" +*PSVersion: "(3010.000) 870" +*LanguageLevel: "3" +*ColorDevice: False +*DefaultColorSpace: Gray +*FileSystem: False +*Throughput: "1" +*LandscapeOrientation: Plus90 +*TTRasterizer: Type42 +*1284DeviceID: "MFG:Samsung;MDL:ML-3051ND;DRV:DPostscript,R1,M0,TP;" + +*driverName Postscript: "" +*driverType P/PostScript: "" +*driverUrl: "http://partners.adobe.com/public/developer/ps/index_specs.html" +*driverObsolete: False +*driverManufacturerSupplied: False + + + + +*HWMargins: 18 36 18 36 +*VariablePaperSize: True +*MaxMediaWidth: 100000 +*MaxMediaHeight: 100000 +*NonUIOrderDependency: 100 AnySetup *CustomPageSize +*CustomPageSize True: "pop pop pop +<>setpagedevice" +*End +*ParamCustomPageSize Width: 1 points 36 100000 +*ParamCustomPageSize Height: 2 points 36 100000 +*ParamCustomPageSize Orientation: 3 int 0 0 +*ParamCustomPageSize WidthOffset: 4 points 0 0 +*ParamCustomPageSize HeightOffset: 5 points 0 0 + +*FoomaticIDs: Samsung-ML-3051ND Postscript +*FoomaticRIPCommandLine: "cat%A%B%Z" +*FoomaticRIPNoPageAccounting: True + +*OpenGroup: General/General + +*OpenUI *PageSize/Page Size: PickOne +*OrderDependency: 100 AnySetup *PageSize +*DefaultPageSize: Letter +*PageSize Letter/US Letter: "<>setpagedevice" +*PageSize A4/A4: "<>setpagedevice" +*PageSize 11x17/11x17: "<>setpagedevice" +*PageSize A3/A3: "<>setpagedevice" +*PageSize A5/A5: "<>setpagedevice" +*PageSize B5/B5 (JIS): "<>setpagedevice" +*PageSize Env10/Envelope #10: "<>setpagedevice" +*PageSize EnvC5/Envelope C5: "<>setpagedevice" +*PageSize EnvDL/Envelope DL: "<>setpagedevice" +*PageSize EnvISOB5/Envelope B5: "<>setpagedevice" +*PageSize EnvMonarch/Envelope Monarch: "<>setpagedevice" +*PageSize Executive/Executive: "<>setpagedevice" +*PageSize Legal/US Legal: "<>setpagedevice" +*CloseUI: *PageSize + +*OpenUI *PageRegion: PickOne +*OrderDependency: 100 AnySetup *PageRegion +*DefaultPageRegion: Letter +*PageRegion Letter/US Letter: "<>setpagedevice" +*PageRegion A4/A4: "<>setpagedevice" +*PageRegion 11x17/11x17: "<>setpagedevice" +*PageRegion A3/A3: "<>setpagedevice" +*PageRegion A5/A5: "<>setpagedevice" +*PageRegion B5/B5 (JIS): "<>setpagedevice" +*PageRegion Env10/Envelope #10: "<>setpagedevice" +*PageRegion EnvC5/Envelope C5: "<>setpagedevice" +*PageRegion EnvDL/Envelope DL: "<>setpagedevice" +*PageRegion EnvISOB5/Envelope B5: "<>setpagedevice" +*PageRegion EnvMonarch/Envelope Monarch: "<>setpagedevice" +*PageRegion Executive/Executive: "<>setpagedevice" +*PageRegion Legal/US Legal: "<>setpagedevice" +*CloseUI: *PageRegion + +*DefaultImageableArea: Letter +*ImageableArea Letter/US Letter: "18 36 594 756" +*ImageableArea A4/A4: "18 36 577 806" +*ImageableArea 11x17/11x17: "18 36 774 1188" +*ImageableArea A3/A3: "18 36 824 1155" +*ImageableArea A5/A5: "18 36 403 559" +*ImageableArea B5/B5 (JIS): "18 36 498 693" +*ImageableArea Env10/Envelope #10: "18 36 279 648" +*ImageableArea EnvC5/Envelope C5: "18 36 441 613" +*ImageableArea EnvDL/Envelope DL: "18 36 294 588" +*ImageableArea EnvISOB5/Envelope B5: "18 36 481 673" +*ImageableArea EnvMonarch/Envelope Monarch: "18 36 261 504" +*ImageableArea Executive/Executive: "18 36 504 720" +*ImageableArea Legal/US Legal: "18 36 594 972" + +*DefaultPaperDimension: Letter +*PaperDimension Letter/US Letter: "612 792" +*PaperDimension A4/A4: "595 842" +*PaperDimension 11x17/11x17: "792 1224" +*PaperDimension A3/A3: "842 1191" +*PaperDimension A5/A5: "421 595" +*PaperDimension B5/B5 (JIS): "516 729" +*PaperDimension Env10/Envelope #10: "297 684" +*PaperDimension EnvC5/Envelope C5: "459 649" +*PaperDimension EnvDL/Envelope DL: "312 624" +*PaperDimension EnvISOB5/Envelope B5: "499 709" +*PaperDimension EnvMonarch/Envelope Monarch: "279 540" +*PaperDimension Executive/Executive: "522 756" +*PaperDimension Legal/US Legal: "612 1008" + +*OpenUI *Duplex/Double-Sided Printing: PickOne +*OrderDependency: 130 AnySetup *Duplex +*DefaultDuplex: None +*Duplex DuplexNoTumble/Long Edge (Standard): "<>setpagedevice" +*Duplex DuplexTumble/Short Edge (Flip): "<>setpagedevice" +*Duplex None/Off: "<>setpagedevice" +*CloseUI: *Duplex + +*OpenUI *Resolution/Resolution: PickOne +*OrderDependency: 90 AnySetup *Resolution +*DefaultResolution: 600x600dpi +*Resolution 150x150dpi/150x150 DPI: "<>setpagedevice" +*Resolution 300x300dpi/300x300 DPI: "<>setpagedevice" +*Resolution 600x600dpi/600x600 DPI: "<>setpagedevice" +*Resolution 1200x1200dpi/1200x1200 DPI: "<>setpagedevice" +*CloseUI: *Resolution + +*CloseGroup: General + + +*% Generic boilerplate PPD stuff as standard PostScript fonts and so on + +*DefaultFont: Courier +*Font AvantGarde-Book: Standard "(001.006S)" Standard ROM +*Font AvantGarde-BookOblique: Standard "(001.006S)" Standard ROM +*Font AvantGarde-Demi: Standard "(001.007S)" Standard ROM +*Font AvantGarde-DemiOblique: Standard "(001.007S)" Standard ROM +*Font Bookman-Demi: Standard "(001.004S)" Standard ROM +*Font Bookman-DemiItalic: Standard "(001.004S)" Standard ROM +*Font Bookman-Light: Standard "(001.004S)" Standard ROM +*Font Bookman-LightItalic: Standard "(001.004S)" Standard ROM +*Font Courier: Standard "(002.004S)" Standard ROM +*Font Courier-Bold: Standard "(002.004S)" Standard ROM +*Font Courier-BoldOblique: Standard "(002.004S)" Standard ROM +*Font Courier-Oblique: Standard "(002.004S)" Standard ROM +*Font Helvetica: Standard "(001.006S)" Standard ROM +*Font Helvetica-Bold: Standard "(001.007S)" Standard ROM +*Font Helvetica-BoldOblique: Standard "(001.007S)" Standard ROM +*Font Helvetica-Narrow: Standard "(001.006S)" Standard ROM +*Font Helvetica-Narrow-Bold: Standard "(001.007S)" Standard ROM +*Font Helvetica-Narrow-BoldOblique: Standard "(001.007S)" Standard ROM +*Font Helvetica-Narrow-Oblique: Standard "(001.006S)" Standard ROM +*Font Helvetica-Oblique: Standard "(001.006S)" Standard ROM +*Font NewCenturySchlbk-Bold: Standard "(001.009S)" Standard ROM +*Font NewCenturySchlbk-BoldItalic: Standard "(001.007S)" Standard ROM +*Font NewCenturySchlbk-Italic: Standard "(001.006S)" Standard ROM +*Font NewCenturySchlbk-Roman: Standard "(001.007S)" Standard ROM +*Font Palatino-Bold: Standard "(001.005S)" Standard ROM +*Font Palatino-BoldItalic: Standard "(001.005S)" Standard ROM +*Font Palatino-Italic: Standard "(001.005S)" Standard ROM +*Font Palatino-Roman: Standard "(001.005S)" Standard ROM +*Font Symbol: Special "(001.007S)" Special ROM +*Font Times-Bold: Standard "(001.007S)" Standard ROM +*Font Times-BoldItalic: Standard "(001.009S)" Standard ROM +*Font Times-Italic: Standard "(001.007S)" Standard ROM +*Font Times-Roman: Standard "(001.007S)" Standard ROM +*Font ZapfChancery-MediumItalic: Standard "(001.007S)" Standard ROM +*Font ZapfDingbats: Special "(001.004S)" Standard ROM + diff --git a/roles/cups_server/tasks/main.yml b/roles/cups_server/tasks/main.yml index 9b4bcc3..1c44960 100644 --- a/roles/cups_server/tasks/main.yml +++ b/roles/cups_server/tasks/main.yml @@ -36,6 +36,13 @@ line: "#Listen 631" notify: Restart cups +- name: Share printers + ansible.builtin.lineinfile: + path: /etc/cups/cupsd.conf + line: "Port 631" + insertbefore: "^Listen .*.sock" + notify: Restart cups + - name: Set ssl listen port ansible.builtin.lineinfile: path: /etc/cups/cupsd.conf @@ -86,11 +93,11 @@ force: true notify: Restart cups -- name: Disable printer advertising +- name: Enable printer sharing ansible.builtin.lineinfile: path: /etc/cups/cupsd.conf regexp: "^Browsing .*" - line: "Browsing No" + line: "Browsing Yes" notify: Restart cups - name: Disable unauthenticated access from cups @@ -147,3 +154,11 @@ name: cups enabled: true state: started + +- name: Copy ppd files + ansible.builtin.copy: + dest: /usr/local/share/cups-ppd/ + src: cups-ppd/ + mode: "0644" + owner: root + group: "{{ ansible_wheel }}"