diff --git a/README.md b/README.md new file mode 100644 index 0000000..fd30e2d --- /dev/null +++ b/README.md @@ -0,0 +1,130 @@ +# Ansible-Präsentation — Übersicht + +Moderne Präsentation über Ansible mit begleitendem Handout und einem +lauffähigen Beispiel-Projekt. Alles in Python generiert und reproduzierbar. + +--- + +## Inhalt des Ordners + +``` +ansible_präsentation/ +├── ansible_praesentation.pptx # Die fertige Präsentation (19 Folien, 16:9) +├── create_presentation.py # Python-Skript, das die .pptx erzeugt +├── handout.md # Handout (Markdown-Quelle) +├── handout.docx # Handout (druckbar/editierbar, für OnlyOffice) +├── assets/ +│ ├── ansible_mark_red.png # Ansible-Logo (rot) — Quelle: Wikimedia Commons +│ ├── ansible_mark_white.png # Ansible-Logo (weiß) +│ ├── ansible_logo.svg # Logo-Quelldatei (SVG) +│ └── architektur.png # Architektur-Diagramm (automatisch erzeugt) +└── Beispiel/ # Lauffähiges Beispiel-Playbook (siehe unten) +``` + +--- + +## 1. Die Präsentation (`ansible_praesentation.pptx`) + +19 Folien, 16:9, in den Ansible-Brandfarben (Rot `#EE0000`, Anthrazit `#1A1918`). + +| # | Titel | Inhalt | +|---|-------|--------| +| 1 | Titel | Agenda, Ansible-Logo | +| 2 | Was ist Ansible? | Definition, Merkmale (agentenlos, idempotent, …) | +| 3 | Architektur | Control Node, Managed Nodes (Diagramm) | +| 4 | Vier Kernkonzepte | Playbooks, Inventory, Module, Rollen | +| 5 | YAML-Syntax | Grundregeln + Inventory-Beispiel | +| 6 | Playbook | site.yml mit Tasks & FQCN | +| 7 | Module | 6 Modul-Kategorien | +| 8 | Ad-hoc-Befehle | `ansible`-CLI ohne Playbook | +| 9 | Jinja2 | `{{ variable }}`, Filter, `.j2`-Templates | +| 10 | Gather Facts | Facts auslesen, Custom Facts, `gather_facts` | +| 11 | Variablen & Präzedenz | Quellen + Reihenfolge (wer gewinnt) | +| 12 | FQCN (Definition) | `namespace.collection.modul` | +| 13 | FQCN (Praxis) | Beispiele + Warum | +| 14 | Collections | Was sie sind (6 Bestandteile) | +| 15 | Collections nutzen | Galaxy, Installation, Struktur | +| 16 | Rollen (Konzept) | Wiederverwendbarkeit, Kapselung | +| 17 | Rollen (Struktur) | `roles/webserver/` Verzeichnisbaum | +| 18 | Praxisbeispiel | Playbook mit Rolle + Variablen | +| 19 | Zusammenfassung | Key-Takeaways + Quellen | + +**Design-Hinweis:** Die Präsentation nutzt die Schriftarten **Carlito** (Body) +und **DejaVu Sans Mono** (Code), da Calibri/Consolas auf Linux oft fehlen und +OnlyOffice sonst substituiert (was zu gebrochenen Sonderzeichen führt). + +--- + +## 2. Skript neu ausführen (`create_presentation.py`) + +Das Skript erzeugt die `.pptx` vollständig reproduzierbar. + +**Voraussetzungen:** +```bash +pip install python-pptx matplotlib Pillow +``` + +**Ausführen:** +```bash +python3 create_presentation.py +``` + +Das Skript: +- erzeugt das Architektur-Diagramm (`assets/architektur.png`) selbst per matplotlib, +- nutzt die Logo-PNGs aus `assets/` (Quelle: Wikimedia Commons), +- setzt die Folien aus Python-Code zusammen (jede Folie ist eine Funktion/Sektion). + +--- + +## 3. Das Handout (`handout.md` / `handout.docx`) + +Kompakte Referenz mit: + +1. YAML-Grundsyntax +2. Ad-hoc-Befehle +3. Jinja2 (Variablen auflösen, Filter, `.j2`) +4. Gather Facts +5. Wo Variablen definiert werden +6. Variablen-Präzedenz (Auflösungs-Reihenfolge) +7. Module & FQCN +8. Vollständiges Beispiel + +Das `.docx` wird aus dem `.md` per pandoc erzeugt: +```bash +pandoc handout.md -o handout.docx +``` + +--- + +## 4. Das Beispiel-Projekt (`Beispiel/`) + +Ein vollständiges, lauffähiges Ansible-Projekt, das Rollen-Struktur, +Variablen-Präzedenz und Templating für **localhost** demonstriert. + +Siehe `Beispiel/README.md` für Details. Kurz: + +```bash +cd Beispiel +ansible-playbook site.yml --check # Trockenlauf +ansible-playbook site.yml # echt ausführen +``` + +Die Struktur zeigt: +- `roles/webserver/` mit tasks, handlers, templates, defaults, vars, meta +- Variablen-Präzedenz: `defaults` (80) → `host_vars` (8080) → `-e` (gewinnt) +- Jinja2-Templates (`nginx.conf.j2`, `index.html.j2` mit Schleife + Filter) +- Facts (`ansible_distribution`, `ansible_hostname`, …) +- FQCN (`ansible.builtin.*`) + +**Hinweis:** Das Beispiel nutzt `apt` (Debian/Ubuntu). Auf Manjaro/Arch +verwendet man stattdessen `community.general.pacman` (Anpassung in +`Beispiel/README.md` beschrieben). + +--- + +## Quellen & Lizenz + +- Ansible-Dokumentation: https://docs.ansible.com +- Ansible Galaxy: https://galaxy.ansible.com +- Ansible-Repository: https://github.com/ansible/ansible +- Ansible-Logo: Wikimedia Commons (https://commons.wikimedia.org/wiki/File:Ansible_logo.svg) diff --git a/ansible_praesentation.pptx b/ansible_praesentation.pptx index c778fdb..d237610 100644 Binary files a/ansible_praesentation.pptx and b/ansible_praesentation.pptx differ diff --git a/create_presentation.py b/create_presentation.py index 954e81a..4b8f7bd 100644 --- a/create_presentation.py +++ b/create_presentation.py @@ -614,27 +614,19 @@ text(s, 0.55, 1.5, 12.2, 0.7, (".", {})], size=13, color=BLACK, leading=1.15) -# Links: Facts als 2-Spalten-Raster (Name oben, Beschreibung darunter) -text(s, 0.55, 2.4, 6.6, 0.3, "WAS MAN AUSLESEN KANN", size=11, bold=True, color=RED) -facts = [ +# Links: Facts als einzelne Spalte (breite Schlüssel-Spalte -> kein Umbruch) +text(s, 0.55, 2.4, 6.8, 0.3, "WAS MAN AUSLESEN KANN", size=11, bold=True, color=RED) +kv_rows(s, 0.55, 2.9, 6.8, [ ("ansible_os_family", "Betriebssystem-Familie"), ("ansible_distribution", "z.B. Ubuntu, Debian"), ("ansible_hostname", "Hostname des Systems"), ("ansible_default_ipv4.address", "IP-Adresse"), ("ansible_memtotal_mb", "Arbeitsspeicher (MB)"), ("ansible_processor_vcpus", "CPU-Kerne"), -] -for i, (name, desc) in enumerate(facts): - col = i % 2 - row = i // 2 - cx = 0.55 + col * 3.3 - cy = 2.9 + row * 1.3 - text(s, cx, cy, 3.2, 0.35, name, size=11.5, bold=True, - color=DARKRED, font=FONT_MONO) - text(s, cx, cy + 0.38, 3.2, 0.5, desc, size=11, color=GRAY, leading=1.0) +], key_w=3.5, name_size=12, desc_size=11, gap=0.6) # Rechts: ein einzelner, klarer Code-Block (Zugriff + Custom Facts) -code_block(s, 7.25, 2.4, 5.55, [ +code_block(s, 7.55, 2.4, 5.2, [ "# Zugriff im Playbook", "- name: OS anzeigen", " ansible.builtin.debug:",