Regeln, Standards, Kontextstruktur und Werkzeuge übernommen; 2nd-brain- Inhalte (Stacks, Ansible-Inventar, Architektur, Knowledge) entfernt. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
40 lines
1.1 KiB
YAML
40 lines
1.1 KiB
YAML
---
|
||
## @brief Rolle example – Ablauf: prüfen → Geheimnisse → installieren → konfigurieren → testen
|
||
|
||
- name: Plattform prüfen (Debian >= 13 erwartet)
|
||
ansible.builtin.assert:
|
||
that:
|
||
- ansible_facts['os_family'] == 'Debian'
|
||
- ansible_facts['distribution_major_version'] | int >= 13
|
||
fail_msg: "{{ inventory_hostname }}: {{ ansible_facts['distribution'] }} {{ ansible_facts['distribution_version'] }} – Rolle ist für Debian >= 13 gebaut."
|
||
quiet: true
|
||
tags: [always]
|
||
|
||
- name: Geheimnisse laden
|
||
ansible.builtin.import_tasks: secrets.yml
|
||
tags: [always]
|
||
|
||
- name: Installieren
|
||
ansible.builtin.import_tasks: install.yml
|
||
tags: [install]
|
||
|
||
- name: Konfigurieren
|
||
ansible.builtin.import_tasks: config.yml
|
||
tags: [config]
|
||
|
||
- name: Handler jetzt ausführen (Config-Check vor Restart)
|
||
ansible.builtin.meta: flush_handlers
|
||
tags: [always]
|
||
|
||
- name: Dienst aktiv und gestartet
|
||
ansible.builtin.service:
|
||
name: "{{ example_service }}"
|
||
state: started
|
||
enabled: true
|
||
tags: [install, config]
|
||
|
||
- name: Smoke-Test
|
||
ansible.builtin.import_tasks: verify.yml
|
||
when: example_smoke_test | bool
|
||
tags: [verify]
|