Move Gitea to Postgres

Migration is nontrivial and SUCKS DICK but whatever
This commit is contained in:
Salt 2020-08-15 16:01:56 -05:00
parent 7c506157f7
commit 2a1299e9e0
4 changed files with 28 additions and 26 deletions

View File

@ -53,14 +53,16 @@ psql:
## WEBAPPS
# Gitea
gitea:
mysql_password: !vault |
$ANSIBLE_VAULT;1.1;AES256
62353264353465316661353738666161313036373761666163663733656461316536636334386335
6161386630663739363439383237343065333239613134610a383036373735326536386464343164
31346337636665356630336234306534646362386663633734353166373761316139313734306630
3364306566323666310a323034303434613237643665643637633430353437316339356463646331
33353062343164396465326365653561626363343961326363633231303736316436643935646161
3933353234613430373930663832643934613233383635613433
db:
hostname: 172.31.47.215
pass: !vault |
$ANSIBLE_VAULT;1.1;AES256
62353264353465316661353738666161313036373761666163663733656461316536636334386335
6161386630663739363439383237343065333239613134610a383036373735326536386464343164
31346337636665356630336234306534646362386663633734353166373761316139313734306630
3364306566323666310a323034303434613237643665643637633430353437316339356463646331
33353062343164396465326365653561626363343961326363633231303736316436643935646161
3933353234613430373930663832643934613233383635613433
app_name: "9iron Gitea"
disable_registration: "false"
url: "git.9iron.club"

View File

@ -3,23 +3,24 @@
---
- name: Set up Gitea
block:
- name: Set up MySQL
- name: Set up PostgreSQL
block:
- name: Create DB user
postgresql_user:
name: gitea
password: "{{ gitea.db.pass }}"
login_host: "{{ gitea.db.hostname }}"
login_user: "{{ psql.ansible.user }}"
login_password: "{{ psql.ansible.pass }}"
- name: Create DB
mysql_db:
postgresql_db:
name: gitea
login_user: root
login_password: "{{ mysql.root_password }}"
state: present
notify: gitea add default user
- name: Create user
mysql_user:
name: gitea
host: localhost
password: "{{ gitea.mysql_password }}"
priv: "gitea.*:ALL,GRANT"
login_user: root
login_password: "{{ mysql.root_password }}"
owner: gitea
encoding: UNICODE
login_host: "{{ gitea.db.hostname }}"
login_user: "{{ psql.ansible.user }}"
login_password: "{{ psql.ansible.pass }}"
tags: [ postgresql ]
- name: Set up Apache
block:
- name: Enable modules

View File

@ -3,11 +3,11 @@ RUN_USER = git
RUN_MODE = prod
[database]
DB_TYPE = mysql
HOST = 127.0.0.1:3306
DB_TYPE = postgres
HOST = {{ gitea.db.hostname }}:5432
NAME = gitea
USER = gitea
PASSWD = {{ gitea.mysql_password }}
PASSWD = {{ gitea.db.pass }}
SSL_MODE = disable
CHARSET = utf8
PATH = /var/lib/gitea/data/gitea.db

View File

@ -27,7 +27,6 @@
login_host: "{{ nextcloud.db.hostname }}"
login_user: "{{ psql.ansible.user }}"
login_password: "{{ psql.ansible.pass }}"
when: nextcloud.db.hostname is defined
tags: [ postgresql ]
- name: Set up Apache
block: