--- # Deploy Gitea Stack Configuration # Updates docker-compose.yml and restarts containers with new settings - name: Deploy Gitea Stack Configuration hosts: production gather_facts: yes become: no vars: gitea_stack_path: "{{ stacks_base_path }}/gitea" traefik_auto_restart: false gitea_auto_restart: false tasks: - name: Check if Gitea stack directory exists ansible.builtin.stat: path: "{{ gitea_stack_path }}" register: gitea_stack_dir failed_when: false - name: Fail if Gitea stack directory does not exist ansible.builtin.fail: msg: "Gitea stack directory does not exist: {{ gitea_stack_path }}" when: not gitea_stack_dir.stat.exists - name: Sync Gitea docker-compose.yml ansible.builtin.synchronize: src: "{{ playbook_dir }}/../../stacks/gitea/docker-compose.yml" dest: "{{ gitea_stack_path }}/docker-compose.yml" mode: push register: compose_synced - name: Restart Gitea and Postgres containers to apply new configuration ansible.builtin.shell: | cd {{ gitea_stack_path }} docker compose up -d --force-recreate gitea postgres register: gitea_restart changed_when: gitea_restart.rc == 0 when: compose_synced.changed | default(false) | bool - name: Wait for Gitea to be ready ansible.builtin.wait_for: timeout: 60 delay: 5 when: gitea_restart.changed | default(false) | bool - name: Display result ansible.builtin.debug: msg: | ================================================================================ GITEA STACK CONFIGURATION DEPLOYED ================================================================================ Changes applied: - Gitea Connection Pool: MAX_OPEN_CONNS=50, MAX_IDLE_CONNS=30, CONN_MAX_LIFETIME=600, CONN_MAX_IDLE_TIME=300 - Postgres Timeouts: authentication_timeout=180s, statement_timeout=30s, idle_in_transaction_timeout=30s Containers restarted: {{ 'YES' if (gitea_restart.changed | default(false) | bool) else 'NO (no changes)' }} ================================================================================