Anpassung für vault hinzugefügt

This commit is contained in:
2026-10-05 11:54:31 +02:00
parent 5fbd0c1a61
commit 3ceae1bf83
10 changed files with 248 additions and 77 deletions
+1 -1
View File
@@ -7,7 +7,7 @@ demonstriert:
- **Variablen-Vergabe** mit Präzedenz (defaults → vars → group_vars → host_vars)
- **Templating** mit Jinja2 (`.j2`-Dateien, Schleifen, Filter)
- **FQCN** (`ansible.builtin.*`)
- **Facts** (`ansible_distribution`, `ansible_hostname`, …)
- **Facts** (`ansible_facts['distribution']`, `ansible_facts['hostname']`, …)
- **Handler** (`notify` → Dienst neu starten)
---
+1 -1
View File
@@ -4,7 +4,7 @@
- name: Betriebssystem ausgeben (Facts nutzen)
ansible.builtin.debug:
msg: "Läuft auf {{ ansible_distribution }} {{ ansible_distribution_version }}"
msg: "Läuft auf {{ ansible_facts['distribution'] }} {{ ansible_facts['distribution_version'] }}"
- name: Pakete installieren
ansible.builtin.apt:
@@ -6,7 +6,7 @@
</head>
<body>
<h1>{{ app_name }}</h1>
<p>Betriebssystem: {{ ansible_distribution }} {{ ansible_distribution_version }}</p>
<p>Betriebssystem: {{ ansible_facts['distribution'] }} {{ ansible_facts['distribution_version'] }}</p>
<p>Installierte Pakete:</p>
<ul>
@@ -16,6 +16,6 @@ http {
index index.html;
# Fact des Zielsystems wird hier aufgelöst:
access_log /var/log/nginx/{{ ansible_hostname }}.access.log;
access_log /var/log/nginx/{{ ansible_facts['hostname'] }}.access.log;
}
}