docs: Implementierungsplan Boot-Optimierung
This commit is contained in:
parent
2ccfd8592b
commit
30548452bc
1 changed files with 135 additions and 0 deletions
135
docs/superpowers/plans/2026-03-27-boot-optimierung.md
Normal file
135
docs/superpowers/plans/2026-03-27-boot-optimierung.md
Normal file
|
|
@ -0,0 +1,135 @@
|
|||
# Boot-Optimierung Implementation Plan
|
||||
|
||||
> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
|
||||
|
||||
**Goal:** Boot-Zeit der Infoscreens verkürzen durch Entfernung von `network-online.target` aus dem morz-agent Service und Deinstallation von cloud-init.
|
||||
|
||||
**Architecture:** Zwei unabhängige Ansible-Änderungen — eine am systemd-Unit-Template, eine an den signage_base-Tasks. Kein Application-Code betroffen.
|
||||
|
||||
**Tech Stack:** Ansible, systemd, Debian/Raspberry Pi OS
|
||||
|
||||
---
|
||||
|
||||
## Dateien
|
||||
|
||||
- Modify: `ansible/roles/signage_player/templates/morz-agent.service.j2`
|
||||
- Modify: `ansible/roles/signage_base/tasks/main.yml`
|
||||
|
||||
---
|
||||
|
||||
### Task 1: network-online.target aus morz-agent.service entfernen
|
||||
|
||||
**Files:**
|
||||
- Modify: `ansible/roles/signage_player/templates/morz-agent.service.j2`
|
||||
|
||||
- [ ] **Step 1: Service-Template anpassen**
|
||||
|
||||
Aktuelle Zeilen 3–4:
|
||||
```
|
||||
After=network-online.target
|
||||
Wants=network-online.target
|
||||
```
|
||||
|
||||
Ersetzen durch:
|
||||
```
|
||||
After=network.target
|
||||
```
|
||||
|
||||
Die komplette Datei sieht danach so aus:
|
||||
```ini
|
||||
[Unit]
|
||||
Description=Morz Infoboard Player Agent
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User={{ signage_user }}
|
||||
Environment=DISPLAY=:0
|
||||
Environment=XAUTHORITY=/home/{{ signage_user }}/.Xauthority
|
||||
ExecStart={{ signage_binary_dest }}
|
||||
Restart=on-failure
|
||||
RestartSec=10
|
||||
StandardOutput=journal
|
||||
StandardError=journal
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
```
|
||||
|
||||
- [ ] **Step 2: Commit**
|
||||
|
||||
```bash
|
||||
git add ansible/roles/signage_player/templates/morz-agent.service.j2
|
||||
git commit -m "fix(ansible): network-online.target entfernen, network.target reicht"
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### Task 2: cloud-init deinstallieren in signage_base
|
||||
|
||||
**Files:**
|
||||
- Modify: `ansible/roles/signage_base/tasks/main.yml`
|
||||
|
||||
- [ ] **Step 1: cloud-init-Task ans Ende von signage_base/tasks/main.yml anhängen**
|
||||
|
||||
Folgenden Block **nach** dem letzten Task ("Ensure signage user exists") einfügen:
|
||||
|
||||
```yaml
|
||||
- name: Remove cloud-init (unnötig, bremst Boot)
|
||||
ansible.builtin.apt:
|
||||
name: cloud-init
|
||||
state: absent
|
||||
purge: true
|
||||
become: true
|
||||
failed_when: false
|
||||
|
||||
- name: Remove cloud-init config directory
|
||||
ansible.builtin.file:
|
||||
path: /etc/cloud
|
||||
state: absent
|
||||
become: true
|
||||
|
||||
- name: Remove cloud-init state directory
|
||||
ansible.builtin.file:
|
||||
path: /var/lib/cloud
|
||||
state: absent
|
||||
become: true
|
||||
```
|
||||
|
||||
Hinweis: `failed_when: false` beim apt-Task stellt sicher, dass der Play nicht bricht wenn cloud-init auf einer Maschine gar nicht installiert war. Die file-Tasks mit `state: absent` sind idempotent — kein `failed_when` nötig.
|
||||
|
||||
- [ ] **Step 2: Commit**
|
||||
|
||||
```bash
|
||||
git add ansible/roles/signage_base/tasks/main.yml
|
||||
git commit -m "fix(ansible): cloud-init deinstallieren und Verzeichnisse entfernen"
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### Task 3: Ansible-Playbook gegen einen Infoscreen ausführen und prüfen
|
||||
|
||||
- [ ] **Step 1: Playbook ausführen**
|
||||
|
||||
```bash
|
||||
cd ansible
|
||||
ansible-playbook site.yml -l <hostname> --tags signage_base,signage_player -v
|
||||
```
|
||||
|
||||
Erwartet: kein FAILED, Tasks für cloud-init und morz-agent.service zeigen `changed`.
|
||||
|
||||
- [ ] **Step 2: Auf dem Zielgerät prüfen**
|
||||
|
||||
```bash
|
||||
# cloud-init weg?
|
||||
ssh <user>@<hostname> "dpkg -l cloud-init 2>&1; ls /etc/cloud 2>&1; ls /var/lib/cloud 2>&1"
|
||||
# Erwartet: "dpkg-query: no packages found", "No such file or directory" (beide Pfade)
|
||||
|
||||
# Service-Unit korrekt?
|
||||
ssh <user>@<hostname> "systemctl cat morz-agent | grep -E 'After|Wants'"
|
||||
# Erwartet: "After=network.target" — kein Wants
|
||||
|
||||
# Boot-Zeit vergleichen
|
||||
ssh <user>@<hostname> "systemd-analyze"
|
||||
# Erwartet: deutlich kürzere Kernel + userspace Zeit als vorher
|
||||
```
|
||||
Loading…
Add table
Reference in a new issue