Anpassung für vault hinzugefügt
This commit is contained in:
+1
-1
@@ -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)
|
||||
|
||||
---
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user