Resolved multiple critical discovery system issues: ## Discovery System Fixes - Fixed console commands not being discovered on first run - Implemented fallback discovery for empty caches - Added context-aware caching with separate cache keys - Fixed object serialization preventing __PHP_Incomplete_Class ## Cache System Improvements - Smart caching that only caches meaningful results - Separate caches for different execution contexts (console, web, test) - Proper array serialization/deserialization for cache compatibility - Cache hit logging for debugging and monitoring ## Object Serialization Fixes - Fixed DiscoveredAttribute serialization with proper string conversion - Sanitized additional data to prevent object reference issues - Added fallback for corrupted cache entries ## Performance & Reliability - All 69 console commands properly discovered and cached - 534 total discovery items successfully cached and restored - No more __PHP_Incomplete_Class cache corruption - Improved error handling and graceful fallbacks ## Testing & Quality - Fixed code style issues across discovery components - Enhanced logging for better debugging capabilities - Improved cache validation and error recovery Ready for production deployment with stable discovery system. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
104 lines
3.1 KiB
YAML
104 lines
3.1 KiB
YAML
---
|
|
# Gemeinsame Tasks für alle Deployment-Szenarien
|
|
|
|
- name: Stelle sicher, dass Zielverzeichnisse existieren
|
|
file:
|
|
path: "{{ item }}"
|
|
state: directory
|
|
owner: "{{ deploy_user }}"
|
|
group: "{{ deploy_user }}"
|
|
mode: '0755'
|
|
loop:
|
|
- "{{ deploy_root }}"
|
|
- "{{ deploy_root }}/public"
|
|
- "{{ deploy_root }}/ssl"
|
|
- "{{ deploy_root }}/src"
|
|
- "{{ deploy_root }}/docker"
|
|
- "{{ deploy_root }}/docker/nginx"
|
|
- "{{ deploy_root }}/docker/php"
|
|
|
|
- name: SSL-Zertifikate prüfen
|
|
stat:
|
|
path: "/etc/letsencrypt/live/{{ app_domain }}/fullchain.pem"
|
|
register: ssl_certs
|
|
|
|
- name: SSL-Zertifikate kopieren (falls vorhanden)
|
|
copy:
|
|
src: "{{ item.src }}"
|
|
dest: "{{ item.dest }}"
|
|
remote_src: yes
|
|
owner: "{{ deploy_user }}"
|
|
group: "{{ deploy_user }}"
|
|
mode: '0644'
|
|
loop:
|
|
- { src: "/etc/letsencrypt/live/{{ app_domain }}/fullchain.pem", dest: "{{ deploy_root }}/ssl/fullchain.pem" }
|
|
- { src: "/etc/letsencrypt/live/{{ app_domain }}/privkey.pem", dest: "{{ deploy_root }}/ssl/privkey.pem" }
|
|
when: ssl_certs.stat.exists
|
|
|
|
- name: Kopiere Docker-Konfigurationen
|
|
copy:
|
|
src: "{{ playbook_dir }}/../docker/"
|
|
dest: "{{ deploy_root }}/docker/"
|
|
mode: '0644'
|
|
|
|
- name: Kopiere docker-compose.yml
|
|
copy:
|
|
src: "{{ playbook_dir }}/../docker-compose.yml"
|
|
dest: "{{ deploy_root }}/docker-compose.yml"
|
|
mode: '0644'
|
|
|
|
- name: Erstelle .env-Datei
|
|
copy:
|
|
dest: "{{ deploy_root }}/.env"
|
|
content: |
|
|
COMPOSE_PROJECT_NAME=michaelschiemer
|
|
APP_ENV={{ environment | default('production') }}
|
|
APP_DOMAIN={{ app_domain }}
|
|
DEPLOY_ROOT={{ deploy_root }}
|
|
owner: "{{ deploy_user }}"
|
|
group: "{{ deploy_user }}"
|
|
mode: '0644'
|
|
|
|
- name: Starte Docker-Container
|
|
shell: |
|
|
cd {{ deploy_root }} && \
|
|
docker-compose up -d --build
|
|
args:
|
|
chdir: "{{ deploy_root }}"
|
|
environment:
|
|
COMPOSE_IGNORE_ORPHANS: "True"
|
|
PATH: "/usr/local/bin:/usr/bin:/bin"
|
|
|
|
- name: Warte kurz bis Docker-Container gestartet sind
|
|
pause:
|
|
seconds: 5
|
|
|
|
- name: Erstelle Test-HTML-Datei
|
|
copy:
|
|
dest: "{{ deploy_root }}/public/index.html"
|
|
content: |
|
|
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<title>Server aktiv</title>
|
|
<style>
|
|
body { font-family: Arial, sans-serif; margin: 40px; }
|
|
h1 { color: #3273dc; }
|
|
.container { max-width: 800px; margin: 0 auto; padding: 20px; border: 1px solid #eee; border-radius: 5px; }
|
|
.info { margin-top: 20px; background: #f8f8f8; padding: 10px; border-radius: 5px; }
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div class="container">
|
|
<h1>Server ist aktiv!</h1>
|
|
<p>Diese Seite bestätigt, dass der Webserver korrekt läuft.</p>
|
|
<div class="info">
|
|
<p>Server: {{ inventory_hostname }}</p>
|
|
<p>Umgebung: {{ environment | default('unbekannt') }}</p>
|
|
<p>Deployment-Zeit: {{ ansible_date_time.iso8601 | default('unbekannt') }}</p>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html>
|
|
mode: '0644'
|