Files
michaelschiemer/deployment/ansible/roles/postgresql/tasks/main.yml
Michael Schiemer 36ef2a1e2c
Some checks failed
🚀 Build & Deploy Image / Determine Build Necessity (push) Failing after 10m14s
🚀 Build & Deploy Image / Build Runtime Base Image (push) Has been skipped
🚀 Build & Deploy Image / Build Docker Image (push) Has been skipped
🚀 Build & Deploy Image / Run Tests & Quality Checks (push) Has been skipped
🚀 Build & Deploy Image / Auto-deploy to Staging (push) Has been skipped
🚀 Build & Deploy Image / Auto-deploy to Production (push) Has been skipped
Security Vulnerability Scan / Check for Dependency Changes (push) Failing after 11m25s
Security Vulnerability Scan / Composer Security Audit (push) Has been cancelled
fix: Gitea Traefik routing and connection pool optimization
- Remove middleware reference from Gitea Traefik labels (caused routing issues)
- Optimize Gitea connection pool settings (MAX_IDLE_CONNS=30, authentication_timeout=180s)
- Add explicit service reference in Traefik labels
- Fix intermittent 504 timeouts by improving PostgreSQL connection handling

Fixes Gitea unreachability via git.michaelschiemer.de
2025-11-09 14:46:15 +01:00

30 lines
1.0 KiB
YAML

---
- name: Create PostgreSQL .env file from vault secrets
ansible.builtin.template:
src: postgresql.env.j2
dest: "{{ postgresql_stack_path }}/.env"
mode: '0600'
- name: Deploy PostgreSQL stack
community.docker.docker_compose_v2:
project_src: "{{ postgresql_stack_path }}"
state: present
pull: always
register: postgresql_compose_result
- name: Check PostgreSQL container status
shell: |
docker compose -f {{ postgresql_stack_path }}/docker-compose.yml ps postgres | grep -Eiq "Up|running"
register: postgresql_state
changed_when: false
until: postgresql_state.rc == 0
retries: "{{ ((postgresql_wait_timeout | int) + (postgresql_wait_interval | int) - 1) // (postgresql_wait_interval | int) }}"
delay: "{{ postgresql_wait_interval | int }}"
failed_when: postgresql_state.rc != 0
when: not ansible_check_mode
- name: Record PostgreSQL deployment facts
set_fact:
postgresql_stack_changed: "{{ postgresql_compose_result.changed | default(false) }}"
postgresql_log_hint: ""