Anpassung Powerpoint
This commit is contained in:
+49
-2
@@ -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`):
|
||||
|
||||
|
||||
Reference in New Issue
Block a user