Files
michaelschiemer/deployment/ansible/playbooks
Michael Schiemer bb7cf35e54
Some checks failed
Security Vulnerability Scan / Check for Dependency Changes (push) Successful in 29s
Security Vulnerability Scan / Composer Security Audit (push) Has been skipped
🚀 Build & Deploy Image / Determine Build Necessity (push) Failing after 11m3s
🚀 Build & Deploy Image / Build Runtime Base Image (push) Has been cancelled
🚀 Build & Deploy Image / Run Tests & Quality Checks (push) Has been cancelled
🚀 Build & Deploy Image / Build Docker Image (push) Has been cancelled
🚀 Build & Deploy Image / Auto-deploy to Staging (push) Has been cancelled
🚀 Build & Deploy Image / Auto-deploy to Production (push) Has been cancelled
fix(ansible): Prevent Traefik and Gitea restart loops
- Set traefik_auto_restart: false in group_vars to prevent automatic restarts after config deployment
- Set traefik_ssl_restart: false to prevent automatic restarts during SSL certificate setup
- Set gitea_auto_restart: false to prevent automatic restarts when healthcheck fails
- Modify traefik/tasks/ssl.yml to only restart if explicitly requested or acme.json was created
- Modify traefik/tasks/config.yml to respect traefik_auto_restart flag
- Modify gitea/tasks/restart.yml to respect gitea_auto_restart flag
- Add verify-traefik-fix.yml playbook to monitor Traefik stability

This fixes the issue where Traefik was restarting every minute due to
automatic restart mechanisms triggered by config deployments and health checks.
The restart loops caused 504 Gateway Timeouts for Gitea and other services.

Fixes: Traefik restart loop causing service unavailability
2025-11-08 23:25:38 +01:00
..

Ansible Playbooks - Übersicht

Verfügbare Playbooks

Infrastructure Setup

  • setup-infrastructure.yml - Deployed alle Stacks (Traefik, PostgreSQL, Redis, Registry, Gitea, Monitoring, Production)
  • setup-production-secrets.yml - Deployed Secrets zu Production
  • setup-ssl-certificates.yml - SSL Certificate Setup
  • setup-wireguard-host.yml - WireGuard VPN Setup
  • sync-stacks.yml - Synchronisiert Stack-Konfigurationen zum Server

Deployment & Updates

  • rollback.yml - Rollback zu vorheriger Version
  • backup.yml - Erstellt Backups von PostgreSQL, Application Data, Gitea, Registry
  • deploy-image.yml - Docker Image Deployment (wird von CI/CD Workflows verwendet)

Maintenance

  • system-maintenance.yml - System-Updates, Unattended-Upgrades, Docker-Pruning
  • troubleshoot.yml - Unified Troubleshooting mit Tags
  • update-gitea-config.yml - Aktualisiert Gitea-Konfiguration und startet neu

WireGuard

  • generate-wireguard-client.yml - Generiert WireGuard Client-Config
  • wireguard-routing.yml - Konfiguriert WireGuard Routing

Initial Deployment

  • sync-application-code.yml - Rsync-basiertes Code-Sync für Initial Deployment (synchronisiert Code vom lokalen Repository zum Server)
  • deploy-application-code.yml - Git-basiertes Code-Deployment (für CI/CD und zukünftige Deployments)
  • install-composer-dependencies.yml - Installiert Composer Dependencies im PHP Container
  • build-initial-image.yml - Build und Push des initialen Docker Images (für erstes Deployment)

Code Deployment

  • sync-application-code.yml - Rsync-basiertes Code-Sync (Initial Deployment)
  • deploy-application-code.yml - Git-basiertes Code-Deployment (CI/CD)
  • deploy-image.yml - Docker Image Deployment zu Application Stack

Troubleshooting & Diagnostics

  • check-container-logs.yml - Container Logs prüfen (queue-worker, web, scheduler)
  • check-container-status.yml - Container Status prüfen
  • check-final-status.yml - Finale Status-Prüfung aller Container
  • fix-container-issues.yml - Container-Probleme beheben (Composer Dependencies, Permissions)
  • fix-web-container.yml - Web Container Permissions beheben
  • recreate-containers-with-env.yml - Container mit env_file neu erstellen
  • sync-and-recreate-containers.yml - Docker Compose sync und Container recreate

CI/CD & Development

  • setup-gitea-runner-ci.yml - Gitea Runner CI Setup
  • setup-gitea-initial-config.yml - Gitea Initial Setup (automatisiert via app.ini + CLI)
  • setup-gitea-repository.yml - Erstellt Repository in Gitea und konfiguriert Git-Remote (automatisiert via API)
  • update-gitea-config.yml - Aktualisiert Gitea-Konfiguration (Cache, Connection Pooling) zur Behebung von Performance-Problemen
  • install-docker.yml - Docker Installation auf Server

Entfernte/Legacy Playbooks

Die folgenden Playbooks wurden entfernt, da sie nicht mehr benötigt werden:

  • build-and-push.yml - Wird durch CI/CD Pipeline ersetzt
  • remove-framework-production-stack.yml - Temporäres Playbook
  • remove-temporary-grafana-ip.yml - Temporäres Playbook

Verwendung

cd deployment/ansible
ansible-playbook -i inventory/production.yml playbooks/<playbook>.yml