Files
michaelschiemer/.deployment-backup/x_ansible/playbooks/deploy/includes/env_setup.yml
Michael Schiemer 9b74ade5b0 feat: Fix discovery system critical issues
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>
2025-08-13 12:04:17 +02:00

45 lines
1.4 KiB
YAML

---
# Datei: ansible/playbooks/deploy/includes/env_setup.yml
# Verwaltet die Erstellung und Konfiguration von Umgebungsvariablen
- name: Stelle sicher dass das Template-Verzeichnis existiert
file:
path: "{{ playbook_dir }}/../roles/deploy/templates"
state: directory
mode: '0755'
delegate_to: localhost
become: false
run_once: true
- name: Erstelle .env-Template falls es nicht existiert
copy:
dest: "{{ playbook_dir }}/../roles/deploy/templates/.env.j2"
content: |
# Automatisch generierte .env-Datei
# Generiert durch Ansible am {{ ansible_date_time.date }}
COMPOSE_PROJECT_NAME={{ compose_project_name | default('michaelschiemer') }}
# Allgemeine Einstellungen
APP_NAME={{ app_name | default('michaelschiemer') }}
APP_ENV={{ env_vars.APP_ENV | default('production') }}
APP_DEBUG={{ env_vars.APP_DEBUG | default('false') }}
APP_PORT={{ env_vars.APP_PORT | default(80) }}
APP_SSL_PORT={{ env_vars.APP_SSL_PORT | default(443) }}
# Server-Konfiguration
APP_URL={{ 'https' if ssl_enabled | default(false) else 'http' }}://{{ app_domain }}
mode: '0644'
delegate_to: localhost
become: false
run_once: true
- name: .env-Datei erstellen oder aktualisieren
template:
src: ../roles/deploy/templates/.env.j2
dest: "{{ deploy_root }}/.env"
owner: "{{ deploy_user }}"
group: "{{ deploy_user }}"
mode: '0644'
when: lookup('vars', 'env_vars', default=false)