mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-08-30 15:28:12 +02:00
Implemented gitea database patch
This commit is contained in:
30
roles/web-app-gitea/tasks/01_database.yml
Normal file
30
roles/web-app-gitea/tasks/01_database.yml
Normal 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
|
Reference in New Issue
Block a user