chore: update staging branch with current changes

This commit is contained in:
2025-11-02 00:05:26 +01:00
parent 1f2ab358f9
commit 2defdf2baf
25 changed files with 1205 additions and 88 deletions

View File

@@ -0,0 +1,57 @@
---
- name: Fix sites-available/default upstream configuration
hosts: production
gather_facts: yes
become: no
tasks:
- name: Check php-upstream definition in sites-available/default
shell: |
cd ~/deployment/stacks/staging
echo "=== Check upstream definition ==="
docker compose exec -T staging-nginx grep -A 3 "upstream php-upstream" /etc/nginx/sites-available/default 2>&1 || echo "No upstream found"
echo ""
echo "=== Full sites-available/default file ==="
docker compose exec -T staging-nginx cat /etc/nginx/sites-available/default 2>&1
args:
executable: /bin/bash
register: upstream_check
ignore_errors: yes
failed_when: false
- name: Display upstream check
debug:
msg: "{{ upstream_check.stdout_lines }}"
- name: Fix php-upstream in sites-available/default
shell: |
cd ~/deployment/stacks/staging
echo "=== Fix php-upstream definition ==="
docker compose exec -T staging-nginx sed -i 's|server 127.0.0.1:9000;|server staging-app:9000;|g' /etc/nginx/sites-available/default || echo "Fix 127.0.0.1 failed"
docker compose exec -T staging-nginx sed -i 's|server localhost:9000;|server staging-app:9000;|g' /etc/nginx/sites-available/default || echo "Fix localhost failed"
echo ""
echo "=== Verify fix ==="
docker compose exec -T staging-nginx grep -A 3 "upstream php-upstream" /etc/nginx/sites-available/default 2>&1 || echo "No upstream found"
args:
executable: /bin/bash
register: fix_upstream
ignore_errors: yes
failed_when: false
- name: Display fix result
debug:
msg: "{{ fix_upstream.stdout_lines }}"
- name: Reload nginx
shell: |
cd ~/deployment/stacks/staging
docker compose exec -T staging-nginx nginx -t && docker compose restart staging-nginx || echo "Reload failed"
args:
executable: /bin/bash
register: reload_nginx
ignore_errors: yes
failed_when: false
- name: Display reload result
debug:
msg: "{{ reload_nginx.stdout_lines }}"