1
0
Fork 0

add cups print server

This commit is contained in:
Massaki Archambault 2023-11-18 02:42:26 -05:00
parent e0b043634c
commit 77a556dc21
4 changed files with 65 additions and 1 deletions

5
hosts
View File

@ -39,6 +39,10 @@ all:
- uuid: 649a9370-5cad-4553-93c8-cf0af25208dd
name: jirost
level: 4
cups:
hosts:
cups:
ansible_host: cups.local
k3s:
children:
k3s-server:
@ -73,6 +77,7 @@ all:
k3s:
plex:
minecraft-server:
cups:
vars:
ansible_user: ansible
ansible_password: !vault |

View File

@ -25,3 +25,7 @@
- hosts: minecraft-server
roles:
- minecraft-server
- hosts: cups
roles:
- cups

View File

@ -0,0 +1,5 @@
- name: Restart cups
service:
name: cups
enabled: true
state: restarted

View File

@ -0,0 +1,50 @@
- 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