--- - name: Application Troubleshooting hosts: production gather_facts: yes become: no # All variables are now defined in group_vars/production.yml tasks: - name: Check container health include_tasks: tasks/check-health.yml tags: ['health', 'check', 'all'] - name: Diagnose 404 errors include_tasks: tasks/diagnose-404.yml tags: ['404', 'diagnose', 'all'] - name: Fix container health checks include_tasks: tasks/fix-health-checks.yml tags: ['health', 'fix', 'all'] - name: Fix nginx 404 include_tasks: tasks/fix-nginx-404.yml tags: ['nginx', '404', 'fix', 'all'] - name: Display usage information debug: msg: - "=== Troubleshooting Playbook ===" - "" - "Usage examples:" - " # Check health only:" - " ansible-playbook troubleshoot.yml --tags health,check" - "" - " # Diagnose 404 only:" - " ansible-playbook troubleshoot.yml --tags 404,diagnose" - "" - " # Fix health checks:" - " ansible-playbook troubleshoot.yml --tags health,fix" - "" - " # Fix nginx 404:" - " ansible-playbook troubleshoot.yml --tags nginx,404,fix" - "" - " # Run all checks:" - " ansible-playbook troubleshoot.yml --tags all" when: true tags: ['never']