Fix implementing printing from virtual machines.

Already installed "IPP everywhere" printers have to be replaced by
"driverless" printers.

Fix Listen address in cupsd.conf because VMBridge IP is not yet avaible
when cups is starting.
This commit is contained in:
Raphael Dannecker 2024-03-13 13:06:47 +01:00
parent 9bce299c55
commit eab3b75bff
2 changed files with 24 additions and 3 deletions

View file

@ -268,6 +268,27 @@
chdir: /lmn/vm/ chdir: /lmn/vm/
when: not vm_usage_information.stat.exists when: not vm_usage_information.stat.exists
- name: Detect if IPP-Everywhere printers exist
ansible.builtin.shell:
cmd: grep "IPP Everywhere" /etc/cups/printers.conf
register: ipp_everywhere
failed_when: ipp_everywhere.rc >= 2
changed_when: False
- name: Delete old IPP-Everywhere printers
shell:
cmd: |
for p in $(lpstat -p | cut -d" " -f2); do
lpadmin -x "$p"
done
when: not ipp_everywhere.rc
- name: Remove Listen on VMBridge
lineinfile:
dest: /etc/cups/cupsd.conf
line: 'Listen 192.168.122.1:631'
state: absent
## bookworm fixes/hacks: ## bookworm fixes/hacks:
- name: Work around sddm hang on shutdown - name: Work around sddm hang on shutdown
ansible.builtin.lineinfile: ansible.builtin.lineinfile:

View file

@ -12,11 +12,11 @@
line: '\1No' line: '\1No'
backrefs: yes backrefs: yes
- name: Listen on VMBridge - name: Listen on all Interfaces
lineinfile: lineinfile:
dest: /etc/cups/cupsd.conf dest: /etc/cups/cupsd.conf
line: 'Listen 192.168.122.1:631' line: 'Listen *:631'
insertafter: 'Listen localhost:631' regexp: '^Listen localhost'
state: present state: present
- name: Allow access from localhost and from VM - name: Allow access from localhost and from VM