Anpassung Powerpoint

This commit is contained in:
jonnybravo
2026-09-14 13:10:02 +02:00
parent b3b961dbda
commit 5fbd0c1a61
7 changed files with 31 additions and 7 deletions
+19 -4
View File
@@ -42,11 +42,11 @@ ansible all -m ping
# Facts anzeigen
ansible webserver -m setup
# Paket installieren
ansible webserver -m apt -a "name=nginx state=present"
# Paket installieren (mit become/-b für Root-Rechte)
ansible webserver -b -m apt -a "name=nginx state=present"
# Dienst neu starten
ansible webserver -m service -a "name=nginx state=restarted"
# Dienst neu starten (mit become/-b)
ansible webserver -b -m service -a "name=nginx state=restarted"
```
Wichtige Optionen:
@@ -59,6 +59,21 @@ Wichtige Optionen:
| `-b` | become (sudo) |
| `-u` | Benutzer |
**Lokal gegen localhost:**
`localhost` ist kein echter Host im Netzwerk. Um direkt auf dem eigenen Rechner
zu laufen (ohne SSH), nutzt man im Playbook:
```yaml
- hosts: localhost # Hostname: localhost
connection: local # Connection-Typ: local (nicht "localhost"!)
gather_facts: true
become: true # sudo für z.B. Paket-Installation
```
> `hosts: localhost` (Host) und `connection: local` (Typ) sind zwei verschiedene
> Angaben — `localhost` ist der Hostname, `local` der Connection-Typ.
---
## 3. Jinja2 — Variablen auflösen