diff --git a/ansible/inventory.ini b/ansible/inventory.ini index c8696ab..718c443 100644 --- a/ansible/inventory.ini +++ b/ansible/inventory.ini @@ -1,8 +1,9 @@ [rdp_clients] -thin-client-01 ansible_host=192.168.178.241 +#thin-client-01 ansible_host=192.168.178.241 #thin-client-02 ansible_host=192.168.0.29 #thin-client-03 ansible_host=192.168.0.23 -#thin-client-04 ansible host=192.168.0. +#thin-client-04 ansible_host=192.168.0.32 +thin-client-05 ansible_host=192.168.0.37 [rdp_clients:vars] ansible_user=root #ansible_ssh_private_key_file=~/.ssh/id_rsa diff --git a/ansible/playbook.yml b/ansible/playbook.yml index c86bfde..579de3f 100644 --- a/ansible/playbook.yml +++ b/ansible/playbook.yml @@ -105,7 +105,7 @@ name: "{{ thin_client_user }}" password: "{{ thin_client_password }}" shell: /bin/bash - groups: audio,video,bluetooth,plugdev,netdev,sudo + groups: audio,video,bluetooth,plugdev,netdev,sudo,lpadmin append: yes - name: Allow rdpuser to use sudo for package installation @@ -564,6 +564,54 @@ autoremove: yes ignore_errors: yes + # === PRINTER SUPPORT (CUPS) === + - name: Enable and start CUPS service + systemd: + name: cups + enabled: yes + state: started + ignore_errors: yes + + - name: Create PolicyKit rules directory + file: + path: /etc/polkit-1/rules.d + state: directory + mode: '0755' + + - name: Create PolicyKit rule for CUPS (lpadmin group) + copy: + dest: /etc/polkit-1/rules.d/49-allow-lpadmin.rules + mode: '0644' + content: | + // Allow lpadmin group to manage printers without authentication + polkit.addRule(function(action, subject) { + if ((action.id == "org.opensuse.cupspkhelper.mechanism.all-edit" || + action.id.indexOf("org.opensuse.cupspkhelper.mechanism.") == 0) && + subject.isInGroup("lpadmin")) { + return polkit.Result.YES; + } + }); + + - name: Create directory for legacy PolicyKit configuration + file: + path: /etc/polkit-1/localauthority/50-local.d + state: directory + mode: '0755' + ignore_errors: yes + + - name: Create legacy PolicyKit configuration for CUPS + copy: + dest: /etc/polkit-1/localauthority/50-local.d/49-allow-lpadmin-cups.pkla + mode: '0644' + content: | + [Allow lpadmin group to manage printers] + Identity=unix-group:lpadmin + Action=org.opensuse.cupspkhelper.mechanism.* + ResultAny=yes + ResultInactive=yes + ResultActive=yes + ignore_errors: yes + - name: Disable unnecessary services systemd: name: "{{ item }}" @@ -571,7 +619,6 @@ state: stopped loop: - ModemManager - - cups ignore_errors: yes - name: Final message diff --git a/files/branding/boot-logo.png b/files/branding/boot-logo.png index 2fea727..f41644a 100644 Binary files a/files/branding/boot-logo.png and b/files/branding/boot-logo.png differ diff --git a/files/branding/generate-grub-background.py b/files/branding/generate-grub-background.py new file mode 100644 index 0000000..ad30f54 --- /dev/null +++ b/files/branding/generate-grub-background.py @@ -0,0 +1,70 @@ +#!/usr/bin/env python3 +""" +GRUB Background Generator +Einfaches Hintergrundbild für GRUB Bootloader +""" + +from PIL import Image, ImageDraw, ImageFont +import os + +# Farben +BG_BLACK = (12, 12, 15) +TEXT_WHITE = (230, 230, 230) +TEXT_GRAY = (120, 120, 120) +ACCENT_CYAN = (100, 200, 255) + +# Bildgröße (GRUB Standard) +WIDTH = 1920 +HEIGHT = 1080 + +# Erstelle Bild +img = Image.new('RGB', (WIDTH, HEIGHT), BG_BLACK) +draw = ImageDraw.Draw(img) + +# Versuche Font zu laden +try: + font_paths = [ + '/usr/share/fonts/truetype/dejavu/DejaVuSansMono-Bold.ttf', + '/usr/share/fonts/truetype/liberation/LiberationMono-Bold.ttf', + ] + + font_large = None + font_small = None + + for font_path in font_paths: + if os.path.exists(font_path): + font_large = ImageFont.truetype(font_path, 72) + font_small = ImageFont.truetype(font_path, 36) + break + + if not font_large: + raise Exception("No font found") + +except: + print("Font nicht gefunden, nutze Default") + font_large = ImageFont.load_default() + font_small = ImageFont.load_default() + +# Zentrierter Text +main_text = "RDP THIN CLIENT" +bbox = draw.textbbox((0, 0), main_text, font=font_large) +text_width = bbox[2] - bbox[0] +text_x = (WIDTH - text_width) // 2 +text_y = (HEIGHT // 2) - 100 + +draw.text((text_x, text_y), main_text, font=font_large, fill=TEXT_WHITE) + +# Subtext +sub_text = "HackerSoft · Hacker-Net Telekommunikation" +bbox = draw.textbbox((0, 0), sub_text, font=font_small) +text_width = bbox[2] - bbox[0] +sub_x = (WIDTH - text_width) // 2 +sub_y = text_y + 120 + +draw.text((sub_x, sub_y), sub_text, font=font_small, fill=ACCENT_CYAN) + +# Speichern +output_path = os.path.join(os.path.dirname(__file__), 'grub-background.png') +img.save(output_path, 'PNG') +print(f"GRUB Background erstellt: {output_path}") +print(f"Größe: {WIDTH}x{HEIGHT}") diff --git a/files/branding/grub-background.png b/files/branding/grub-background.png index 9ff599f..f41644a 100644 Binary files a/files/branding/grub-background.png and b/files/branding/grub-background.png differ