- name: Install cups and drivers
apt:
name:
- cups
- avahi-daemon
- hplip # https://openprinting.org/printer/HP/HP-LaserJet_1010
- name: Listen on all interfaces
lineinfile:
path: /etc/cups/cupsd.conf
regex: ^Listen .*:631
line: Listen *:631
notify: Restart cups
- name: Allow printer sharing via avahi
lineinfile:
path: /etc/cups/cupsd.conf
regex: ^Browsing
line: Browsing yes
notify: Restart cups
- name: Allow printer sharing via ipp
blockinfile:
path: /etc/cups/cupsd.conf
marker: "## {mark} PRINTER SHARING"
block: |
Order allow,deny
Allow localhost
Allow @LOCAL
notify: Restart cups
- name: Allow remote administration
blockinfile:
path: /etc/cups/cupsd.conf
marker: "## {mark} REMOTE ADMINSTRATION"
block: |
DefaultEncryption IfRequested
Order allow,deny
Allow from @LOCAL
AuthType Basic
Require user @SYSTEM
Order allow,deny
Allow from @LOCAL
notify: Restart cups