add cups print server
This commit is contained in:
parent
e0b043634c
commit
77a556dc21
5
hosts
5
hosts
|
@ -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 |
|
||||
|
|
|
@ -24,4 +24,8 @@
|
|||
|
||||
- hosts: minecraft-server
|
||||
roles:
|
||||
- minecraft-server
|
||||
- minecraft-server
|
||||
|
||||
- hosts: cups
|
||||
roles:
|
||||
- cups
|
|
@ -0,0 +1,5 @@
|
|||
- name: Restart cups
|
||||
service:
|
||||
name: cups
|
||||
enabled: true
|
||||
state: restarted
|
|
@ -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
|
Loading…
Reference in New Issue