Files
michaelschiemer/deployment/ansible/roles/traefik/defaults/main.yml
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

37 lines
1.2 KiB
YAML

---
# Traefik Stack Configuration
traefik_stack_path: "{{ stacks_base_path }}/traefik"
traefik_container_name: "traefik"
traefik_url: "https://traefik.michaelschiemer.de"
# Local config path (for config deployment)
traefik_local_config_path: "{{ playbook_dir | default('') }}/../../stacks/traefik"
# Wait Configuration
traefik_wait_timeout: "{{ wait_timeout | default(60) }}"
traefik_wait_interval: 5
traefik_restart_wait_timeout: 30
# Restart Configuration
traefik_restart_action: "restart" # Options: restart, recreate
traefik_check_health: true
traefik_show_status: true
# Config Deployment
traefik_auto_restart: true # Automatically restart after config deployment
# Logs Configuration
traefik_logs_tail: 100
traefik_logs_error_tail: 20
traefik_logs_recent_tail: 50
traefik_logs_since_minutes: 10 # Optional: Show logs from last N minutes
traefik_show_all_logs: false
# SSL Certificate Configuration
traefik_ssl_domains: [] # List of domains for SSL certificate setup
traefik_acme_email: "{{ acme_email | default('kontakt@michaelschiemer.de') }}"
traefik_ssl_restart: false # Restart Traefik after SSL setup (default: false to avoid restart loops)
traefik_ssl_wait_timeout: 10
traefik_ssl_trigger_timeout: 5
traefik_ssl_cert_wait_timeout: 30