Pārlūkot izejas kodu

switch to postresql as the database backend

master
vecāks
revīzija
fe04c43bb6
5 mainītis faili ar 40 papildinājumiem un 5 dzēšanām
  1. +3
    -1
      defaults/main.yml
  2. +16
    -0
      tasks/database.yaml
  3. +1
    -0
      tasks/main.yml
  4. +3
    -0
      tasks/setup.yaml
  5. +17
    -4
      vars/main.yml

+ 3
- 1
defaults/main.yml Parādīt failu

@@ -14,4 +14,6 @@ gitea_admin_username: testadmin
gitea_admin_password: testadmin
gitea_admin_email: admin@example.com

gitea_database_password: "{{ ansible_local.gitea.database_password }}"
gitea_db_name: gitea
gitea_db_user: gitea
gitea_db_pass: "{{ ansible_local.gitea.database_password }}"

+ 16
- 0
tasks/database.yaml Parādīt failu

@@ -0,0 +1,16 @@
---

- block:

- name: postgresql user
postgresql_user:
name: "{{gitea_db_user}}"
password: "{{gitea_db_pass}}"

- name: postgresql database
postgresql_db:
name: "{{gitea_db_name}}"
owner: "{{gitea_db_user}}"

become: true
become_user: postgres

+ 1
- 0
tasks/main.yml Parādīt failu

@@ -4,6 +4,7 @@
- import_tasks: setup.yaml
- import_tasks: download.yaml

- import_tasks: database.yaml
- import_tasks: deploy.yml

- name: flush handlers


+ 3
- 0
tasks/setup.yaml Parādīt failu

@@ -7,3 +7,6 @@
- git
- golang
- gnupg
- postgresql
- python-psycopg2
- autopostgresqlbackup

+ 17
- 4
vars/main.yml Parādīt failu

@@ -1,5 +1,5 @@
_gitea_local_facts:
database_password: "{% if not ansible_local.gitea.database_password is defined %}{{ lookup('password', '/dev/null length=15 chars=ascii_letters') }}{% else %}{{ ansible_local.gitea.database_password }}{% endif %}"
database_password: "{% if not ansible_local.gitea.database_password is defined %}{{ lookup('password', '/dev/null length=16 chars=ascii_letters') }}{% else %}{{ ansible_local.gitea.database_password }}{% endif %}"

_gitea_nginx_vhosts:
- name: gitea
@@ -45,11 +45,24 @@ _gitea_config:

- section: database
option: DB_TYPE
value: sqlite3
value: postgres

- section: database
option: PATH
value: "/var/lib/gitea/data/gitea.db"
option: HOST
value: localhost
#value: "/run/postgresql/"

- section: database
option: NAME
value: "{{gitea_db_name}}"

- section: database
option: USER
value: "{{gitea_db_user}}"

- section: database
option: PASSWD
value: "{{gitea_db_pass}}"

- section: log
option: ROOT_PATH


Notiek ielāde…
Atcelt
Saglabāt