rename dmc12 inventory to cloudlorean and vault admin_password
- replace inventory/dmc12.yml with cloudlorean.yml (+ group_vars) and update all README/AGENTS call examples and the inventory table - move admin_password hash into encrypted vault.yml; remove plaintext copies from roles/bootstrap/defaults and group_vars/external.yml - bootstrap.yml loads vault.yml via vars_files (same pattern as monitoring) - monitoring: PSK config/registration updates, docker role defaults, os-updates logging/reboot refinements, ansible.cfg/execute.sh tweaks - add .project-wiki knowledge base and .github agent instructions
This commit is contained in:
+23
-14
@@ -27,7 +27,7 @@ einschließlich Template-Verlinkung.
|
||||
```
|
||||
|
||||
```bash
|
||||
ansible-playbook -i inventory/dmc12.yml --vault-password-file .vault_password \
|
||||
ansible-playbook -i inventory/cloudlorean.yml --vault-password-file .vault_password \
|
||||
playbooks/monitoring.yml
|
||||
```
|
||||
|
||||
@@ -50,14 +50,16 @@ Tag `monitoring`):
|
||||
anlegen, `docker.conf` aus Template ausliefern. Falls nein: Plugin-Config
|
||||
entfernen.
|
||||
5. **`configure-psk.yml`** – stellt PSK-Store auf dem Controller sicher
|
||||
(`<playbook_dir>/../.zabbix-psk`), generiert pro Host eine PSK mit
|
||||
(im Repository unter `.zabbix-psk`), generiert pro Host eine PSK mit
|
||||
`openssl rand -hex`, persistiert sie im Store und verteilt sie auf den
|
||||
Zielhost (`/etc/zabbix/zabbix_agent2.psk`, Mode `0600`).
|
||||
6. **`configure-agent.yml`** – schreibt `zabbix_agent2.conf` aus Template.
|
||||
7. **`register-host.yml`** – registriert bzw. aktualisiert den Host über die
|
||||
Zabbix-API (`community.zabbix.zabbix_host`). Verknüpft Standard-Templates
|
||||
und ggf. Docker-Templates. Unterscheidet zwischen Proxy- und
|
||||
Server-Modus (zwei Tasks, gegeneinander exklusiv). Delegiert an localhost.
|
||||
Zabbix-API (`community.zabbix.zabbix_host` via `httpapi`-Connection).
|
||||
Verknüpft Standard-Templates und ggf. Docker-Templates. Wählt
|
||||
`monitored_by: proxy` bzw. `zabbix_server` anhand von
|
||||
`monitoring_zabbix_proxy`.
|
||||
Delegiert an localhost.
|
||||
|
||||
## Variablen
|
||||
|
||||
@@ -92,10 +94,10 @@ Tag `monitoring`):
|
||||
|-----------------------------------------|--------|--------------------------------------|---------------------------------------------------------|
|
||||
| `monitoring_zabbix_tls_connect` | string | `psk` | TLS-Modus für ausgehende Verbindungen |
|
||||
| `monitoring_zabbix_tls_accept` | string | `psk` | TLS-Modus für eingehende Verbindungen |
|
||||
| `monitoring_zabbix_psk_identity` | string | `{{ inventory_hostname }}` | PSK-Identity (hostname) |
|
||||
| `monitoring_zabbix_psk_identity` | string | `{{ monitoring_zabbix_host_name }}` | PSK-Identity; muss mit der in Zabbix registrierten Identity übereinstimmen |
|
||||
| `monitoring_zabbix_psk_file` | string | `/etc/zabbix/zabbix_agent2.psk` | Pfad zur PSK-Datei auf dem Zielhost |
|
||||
| `monitoring_zabbix_psk_bits` | int | `256` | PSK-Länge in Bits (32 Byte → 64 Hex-Chars) |
|
||||
| `monitoring_zabbix_psk_store` | string | `{{ playbook_dir }}/../.zabbix-psk` | PSK-Store-Verzeichnis auf dem Controller |
|
||||
| `monitoring_zabbix_psk_store` | string | `{{ role_path }}/../../.zabbix-psk` | PSK-Store-Verzeichnis auf dem Controller |
|
||||
| `monitoring_zabbix_psk_store_mode` | string | `0700` | Berechtigung des PSK-Stores |
|
||||
|
||||
### Zabbix Proxy (optional)
|
||||
@@ -109,7 +111,7 @@ Tag `monitoring`):
|
||||
|
||||
| Variable | Typ | Default | Beschreibung |
|
||||
|---------------------------------------------|--------|--------------------------------------|---------------------------------------------------------|
|
||||
| `monitoring_zabbix_api_url` | string | `https://zabbix/api_jsonrpc.php` | API-URL |
|
||||
| `monitoring_zabbix_api_url` | string | `https://zabbix/api_jsonrpc.php` | API-URL (wird via `urlsplit` in Host, Port, Pfad zerlegt) |
|
||||
| `monitoring_zabbix_api_user` | string | `Admin` | API-Benutzer |
|
||||
| `monitoring_zabbix_api_password` | string | (Vault) | API-Passwort – MUSS in `vault.yml` gesetzt werden |
|
||||
| `monitoring_zabbix_api_validate_certs` | bool | `true` | TLS-Zertifikate prüfen |
|
||||
@@ -151,7 +153,7 @@ Passive-Servers mit Proxy-Adresse, setzt `ServerActive` auf Proxy).
|
||||
`monitoring` – alle Subtasks sind mit diesem Tag versehen:
|
||||
|
||||
```bash
|
||||
ansible-playbook -i inventory/dmc12.yml playbooks/monitoring.yml -t monitoring
|
||||
ansible-playbook -i inventory/cloudlorean.yml playbooks/monitoring.yml -t monitoring
|
||||
```
|
||||
|
||||
## Abhängigkeiten
|
||||
@@ -163,14 +165,21 @@ ansible-playbook -i inventory/dmc12.yml playbooks/monitoring.yml -t monitoring
|
||||
## Hinweise
|
||||
|
||||
- **PSK-Store**: Pro Host wird eine PSK unter
|
||||
`<playbook_dir>/../.zabbix-psk/<hostname>.psk` (git-ignored) gespeichert.
|
||||
`<Repository-Root>/.zabbix-psk/<hostname>.psk` (git-ignored) gespeichert.
|
||||
Bei Host-Umbenennung PSK migrieren oder neu generieren – sonst stimmt die
|
||||
Zabbix-Registrierung nicht.
|
||||
- **PSK-Identity**: Die Agent-Konfiguration und die Zabbix-Hostkonfiguration
|
||||
verwenden dieselbe Identity. Wenn `monitoring_zabbix_host_name` überschrieben
|
||||
wird, wird die Identity standardmäßig automatisch daran angepasst.
|
||||
- **API-Passwort** MUSS in `vault.yml` als `monitoring_zabbix_api_password`
|
||||
gesetzt sein; die Validate-Tasks brechen sonst ab.
|
||||
- **Docker-Plugin** wird nur konfiguriert, wenn der Socket existiert – sonst
|
||||
wird eine eventuell vorhandene Plugin-Config entfernt (Idempotenz).
|
||||
- Die Registrierung wird **delegiert an localhost** ausgeführt, da der
|
||||
Controller den API-Zugang besitzt.
|
||||
- Proxy- und Server-Modus schließen sich gegenseitig aus (zwei Tasks mit
|
||||
entgegengesetzten `when`-Bedingungen).
|
||||
- Die Registrierung nutzt die `httpapi`-Connection
|
||||
(`ansible_network_os: community.zabbix.zabbix`, `ansible_connection: httpapi`)
|
||||
und läuft direkt vom Controller aus – kein `delegate_to` nötig.
|
||||
Die API-URL wird per `urlsplit` in Host, Port, SSL und Pfad zerlegt;
|
||||
User/Passwort kommen als `ansible_user`/`ansible_password` in die
|
||||
Task-Vars.
|
||||
- Proxy- und Server-Modus werden über `monitored_by` gesteuert
|
||||
(`proxy` bei gesetztem `monitoring_zabbix_proxy`, sonst `zabbix_server`).
|
||||
|
||||
Reference in New Issue
Block a user