1
0
Fork 0
home-stack-ansible/roles/cups/tasks/main.yaml

50 lines
1.1 KiB
YAML

- 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: |
<Location />
Order allow,deny
Allow localhost
Allow @LOCAL
</Location>
notify: Restart cups
- name: Allow remote administration
blockinfile:
path: /etc/cups/cupsd.conf
marker: "## {mark} REMOTE ADMINSTRATION"
block: |
DefaultEncryption IfRequested
<Location /admin>
Order allow,deny
Allow from @LOCAL
</Location>
<Location /admin/conf>
AuthType Basic
Require user @SYSTEM
Order allow,deny
Allow from @LOCAL
</Location>
notify: Restart cups