2025-06-26-13-33-49: Cronjob
This commit is contained in:
commit
29049c8da1
127 changed files with 7089 additions and 0 deletions
67
roles/lmn_printer/tasks/main.yml
Normal file
67
roles/lmn_printer/tasks/main.yml
Normal file
|
|
@ -0,0 +1,67 @@
|
|||
---
|
||||
- name: Install cups
|
||||
ansible.builtin.apt:
|
||||
name:
|
||||
- cups
|
||||
|
||||
- name: Disable cups printer browsing
|
||||
ansible.builtin.lineinfile:
|
||||
dest: /etc/cups/cupsd.conf
|
||||
regexp: '^(Browsing ).*'
|
||||
line: '\1No'
|
||||
backrefs: true
|
||||
|
||||
- name: Listen on all Interfaces
|
||||
ansible.builtin.lineinfile:
|
||||
dest: /etc/cups/cupsd.conf
|
||||
line: 'Listen *:631'
|
||||
regexp: '^Listen localhost'
|
||||
state: present
|
||||
|
||||
- name: Allow access from localhost and from VM
|
||||
ansible.builtin.blockinfile:
|
||||
dest: /etc/cups/cupsd.conf
|
||||
block: |
|
||||
Allow localhost
|
||||
Allow 192.168.122.0/24
|
||||
insertafter: "<Location {{ item }}>"
|
||||
marker: "# {mark} ANSIBLE MANAGED BLOCK {{ item }}"
|
||||
state: present
|
||||
loop:
|
||||
- "/"
|
||||
- "/admin"
|
||||
|
||||
- name: Allow group role-teacher to manage printers
|
||||
ansible.builtin.lineinfile:
|
||||
dest: /etc/cups/cups-files.conf
|
||||
line: "SystemGroup root lpadmin {{ printer_admin_group }}"
|
||||
regexp: '^SystemGroup'
|
||||
state: present
|
||||
when: printer_admin_group | length > 0
|
||||
|
||||
- name: Disable cups-browsed
|
||||
ansible.builtin.systemd:
|
||||
name: cups-browsed.service
|
||||
state: stopped
|
||||
enabled: false
|
||||
|
||||
- name: Install install-printers.sh
|
||||
ansible.builtin.template:
|
||||
src: install-printers.sh.j2
|
||||
dest: /usr/local/bin/install-printers.sh
|
||||
mode: '0755'
|
||||
|
||||
- name: Install lmn-install-printers sudoers
|
||||
ansible.builtin.copy:
|
||||
src: 90-lmn-install-printers
|
||||
dest: /etc/sudoers.d/
|
||||
mode: '0660'
|
||||
owner: root
|
||||
group: root
|
||||
|
||||
- name: Run printer script from /etc/profile.d/
|
||||
ansible.builtin.copy:
|
||||
dest: /etc/profile.d/lmn-printer.sh
|
||||
mode: '0644'
|
||||
content: |
|
||||
[[ "${UID}" -gt 10000 ]] && (sudo /usr/local/bin/install-printers.sh > /dev/null &)
|
||||
Loading…
Add table
Add a link
Reference in a new issue