--- - name: Check Entrypoint Script Execution hosts: production gather_facts: yes become: no tasks: - name: Check when nginx container started shell: | cd ~/deployment/stacks/staging docker compose ps staging-nginx --format "{{.Status}}" || echo "Container not running" args: executable: /bin/bash register: container_status ignore_errors: yes failed_when: false - name: Display container status debug: msg: "{{ container_status.stdout }}" - name: Check entrypoint logs shell: | cd ~/deployment/stacks/staging echo "=== Entrypoint logs (startup) ===" docker compose logs staging-nginx 2>&1 | grep -E "(??|Fixing|PHP-FPM|upstream)" | head -20 args: executable: /bin/bash register: entrypoint_logs ignore_errors: yes failed_when: false - name: Display entrypoint logs debug: msg: "{{ entrypoint_logs.stdout_lines }}" - name: Check if sites-available/default is a volume mount shell: | cd ~/deployment/stacks/staging docker inspect staging-nginx 2>&1 | grep -A 20 "Mounts" | grep "sites-available\|sites-enabled" || echo "No volume mounts for sites-available" args: executable: /bin/bash register: volume_check ignore_errors: yes failed_when: false - name: Display volume check debug: msg: "{{ volume_check.stdout_lines }}" - name: Check when sites-available/default was last modified shell: | cd ~/deployment/stacks/staging docker compose exec -T staging-nginx stat -c "%y" /etc/nginx/sites-available/default 2>&1 || echo "Could not get file stat" args: executable: /bin/bash register: file_stat ignore_errors: yes failed_when: false - name: Display file modification time debug: msg: "{{ file_stat.stdout_lines }}"