Anpassung Powerpoint

This commit is contained in:
jonnybravo
2026-09-14 12:43:09 +02:00
parent 993d5f2e2b
commit b3b961dbda
5 changed files with 286 additions and 143 deletions
+49 -2
View File
@@ -1,6 +1,6 @@
# Ansible — Syntax & Variablen-Handout
Kompakte Referenz zu YAML-Syntax, Ad-hoc-Befehlen, Jinja2, Facts, Variablen-Auflösung und FQCN.
Kompakte Referenz zu YAML-Syntax, Ad-hoc-Befehlen, Jinja2, Facts, Variablen-Auflösung, FQCN und ansible.cfg.
---
@@ -195,7 +195,54 @@ ansible.builtin.apt:
---
## 8. Vollständiges Beispiel
## 8. ansible.cfg — Konfiguration
INI-Datei, die Ansible global steuert. Ansible nutzt die **erste** gefundene
Datei (kein Zusammenführen):
1. `ANSIBLE_CONFIG` — Umgebungsvariable (expliziter Pfad)
2. `./ansible.cfg` — aktuelles Verzeichnis (Projekt)
3. `~/.ansible.cfg` — Home-Verzeichnis (Benutzer)
4. `/etc/ansible/ansible.cfg` — systemweit (Fallback)
Wichtige Werte:
| Sektion | Schlüssel | Bedeutung |
|---------------------------|--------------------|------------------------------------|
| `[defaults]` | `inventory` | Pfad zur Inventory-Datei |
| | `remote_user` | Standard-SSH-Benutzer |
| | `forks` | parallele Prozesse (Default 5) |
| | `host_key_checking`| SSH-Key-Prüfung (True/False) |
| | `gather_facts` | Facts automatisch sammeln |
| | `roles_path` | Suchpfad für Rollen |
| `[privilege_escalation]` | `become` | sudo aktivieren |
| | `become_method` | sudo / su |
| | `become_user` | Ziel-Benutzer (Default root) |
| `[ssh_connection]` | `pipelining` | Performance-Optimierung |
| | `ssh_args` | zusätzliche SSH-Argumente |
Beispiel:
```ini
[defaults]
inventory = ./inventory.yml
remote_user = admin
forks = 20
host_key_checking = False
gather_facts = True
roles_path = ./roles
[privilege_escalation]
become = True
become_method = sudo
[ssh_connection]
pipelining = True
```
---
## 9. Vollständiges Beispiel
**Playbook** (`deploy.yml`):