Implemented gitea database patch

This commit is contained in:
2025-07-20 18:14:20 +02:00
parent 2699edd197
commit dcb57af6f7
10 changed files with 58 additions and 33 deletions

View File

@@ -0,0 +1,30 @@
---
- name: Flush handlers to ensure Gitea is up before DB patch
meta: flush_handlers
- name: Patch Gitea DB host in app.ini
command: >
docker exec -i --user {{ gitea_user }} {{ gitea_container }}
sed -ri "s|^(HOST\s*=\s*).*$|\1{{ database_host }}:{{ database_port }}|" {{ gitea_config }}
notify: docker compose up
- name: Patch Gitea DB name in app.ini
command: >
docker exec -i --user {{ gitea_user }} {{ gitea_container }}
sed -ri "s|^(NAME\s*=\s*).*$|\1{{ database_name }}|" {{ gitea_config }}
notify: docker compose up
- name: Patch Gitea DB user in app.ini
command: >
docker exec -i --user {{ gitea_user }} {{ gitea_container }}
sed -ri "s|^(USER\s*=\s*).*$|\1{{ database_username }}|" {{ gitea_config }}
notify: docker compose up
- name: Patch Gitea DB password in app.ini
command: >
docker exec -i --user {{ gitea_user }} {{ gitea_container }}
sed -ri "s|^(PASSWD\s*=\s*).*$|\1{{ database_password }}|" {{ gitea_config }}
notify: docker compose up
- name: "Flush database patches"
meta: flush_handlers