133 lines
4.6 KiB
Markdown
133 lines
4.6 KiB
Markdown
# 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 (21 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`)
|
|
|
|
21 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 | ansible.cfg | Konfiguration, Suchreihenfolge (wer gewinnt) |
|
|
| 6 | ansible.cfg Parameter | Wichtige Werte in [defaults], [privilege_escalation], [ssh_connection] |
|
|
| 7 | YAML-Syntax | Grundregeln + Inventory-Beispiel |
|
|
| 8 | Playbook | site.yml mit Tasks & FQCN |
|
|
| 9 | Module | 6 Modul-Kategorien |
|
|
| 10 | Ad-hoc-Befehle | `ansible`-CLI ohne Playbook |
|
|
| 11 | Jinja2 | `{{ variable }}`, Filter, `.j2`-Templates |
|
|
| 12 | Gather Facts | Facts auslesen, Custom Facts, `gather_facts` |
|
|
| 13 | Variablen & Präzedenz | Quellen + Reihenfolge (wer gewinnt) |
|
|
| 14 | FQCN (Definition) | `namespace.collection.modul` |
|
|
| 15 | FQCN (Praxis) | Beispiele + Warum |
|
|
| 16 | Collections | Was sie sind (6 Bestandteile) |
|
|
| 17 | Collections nutzen | Galaxy, Installation, Struktur |
|
|
| 18 | Rollen (Konzept) | Wiederverwendbarkeit, Kapselung |
|
|
| 19 | Rollen (Struktur) | `roles/webserver/` Verzeichnisbaum |
|
|
| 20 | Praxisbeispiel | Playbook mit Rolle + Variablen |
|
|
| 21 | 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)
|