|
|
|
@ -10,7 +10,6 @@ |
|
|
|
|
- openldap-devel |
|
|
|
|
- libjpeg-turbo-devel |
|
|
|
|
- libpng-devel |
|
|
|
|
- mysql-devel |
|
|
|
|
- libexif |
|
|
|
|
- ghostscript |
|
|
|
|
- gnupg1 |
|
|
|
@ -28,12 +27,31 @@ |
|
|
|
|
- python-setuptools |
|
|
|
|
tags: mayan |
|
|
|
|
|
|
|
|
|
- name: Install MySQL support |
|
|
|
|
yum: |
|
|
|
|
name: |
|
|
|
|
- mysql-devel |
|
|
|
|
- MySQL-python |
|
|
|
|
when: mayan_db_engine == 'mysql' |
|
|
|
|
tags: mayan |
|
|
|
|
|
|
|
|
|
# WHen using upstream MariaDB repo, we have to install MariaDB-shared |
|
|
|
|
- name: Install MariaDB shared libs |
|
|
|
|
yum: |
|
|
|
|
name: |
|
|
|
|
- MariaDB-shared |
|
|
|
|
when: mysql_mariadb_version is defined and mysql_mariadb_version != 'default' |
|
|
|
|
when: |
|
|
|
|
- mayan_db_engine == 'mysql' |
|
|
|
|
- mysql_mariadb_version is defined and mysql_mariadb_version != 'default' |
|
|
|
|
tags: mayan |
|
|
|
|
|
|
|
|
|
- name: Install PostgreSQL support |
|
|
|
|
yum: |
|
|
|
|
name: |
|
|
|
|
- postgresql-devel |
|
|
|
|
- postgresql13 |
|
|
|
|
- python-psocopg2 |
|
|
|
|
when: mayan_db_engine == 'postgresql' |
|
|
|
|
tags: mayan |
|
|
|
|
|
|
|
|
|
- name: Wipe the venv on upgrades |
|
|
|
@ -50,9 +68,9 @@ |
|
|
|
|
name: |
|
|
|
|
- pip |
|
|
|
|
- redis |
|
|
|
|
- mysql |
|
|
|
|
- python-ldap |
|
|
|
|
- django_auth_ldap |
|
|
|
|
- "{{ (mayan_db_engine == 'mysql') | ternary('mysql','psycopg2') }}" |
|
|
|
|
state: "{{ (mayan_install_mode == 'none') | ternary('present', 'latest') }}" |
|
|
|
|
virtualenv: "{{ mayan_root_dir }}/venv" |
|
|
|
|
virtualenv_command: /usr/bin/virtualenv-3 |
|
|
|
@ -68,7 +86,9 @@ |
|
|
|
|
virtualenv_python: /usr/bin/python3 |
|
|
|
|
tags: mayan |
|
|
|
|
|
|
|
|
|
- import_tasks: ../includes/webapps_create_mysql_db.yml |
|
|
|
|
- when: mayan_db_engine == 'mysql' |
|
|
|
|
block: |
|
|
|
|
- import_tasks: ../includes/webapps_create_mysql_db.yml |
|
|
|
|
vars: |
|
|
|
|
- db_name: "{{ mayan_db_name }}" |
|
|
|
|
- db_user: "{{ mayan_db_user }}" |
|
|
|
@ -76,6 +96,28 @@ |
|
|
|
|
- db_pass: "{{ mayan_db_pass }}" |
|
|
|
|
tags: mayan |
|
|
|
|
|
|
|
|
|
- when: mayan_db_engine == 'postgresql' |
|
|
|
|
block: |
|
|
|
|
- name: Create the PostgreSQL role |
|
|
|
|
postgresql_user: |
|
|
|
|
db: postgres |
|
|
|
|
name: "{{ mayan_db_user }}" |
|
|
|
|
password: "{{ mayan_db_pass }}" |
|
|
|
|
login_host: "{{ mayan_db_server }}" |
|
|
|
|
login_user: sqladmin |
|
|
|
|
login_password: "{{ pg_admin_pass }}" |
|
|
|
|
|
|
|
|
|
- name: Create the PostgreSQL database |
|
|
|
|
postgresql_db: |
|
|
|
|
name: "{{ mayan_db_name }}" |
|
|
|
|
encoding: UTF-8 |
|
|
|
|
template: template0 |
|
|
|
|
owner: "{{ mayan_db_user }}" |
|
|
|
|
login_host: "{{ mayan_db_server }}" |
|
|
|
|
login_user: sqladmin |
|
|
|
|
login_password: "{{ pg_admin_pass }}" |
|
|
|
|
tags: mayan |
|
|
|
|
|
|
|
|
|
- name: Initialize or upgrade database |
|
|
|
|
command: >- |
|
|
|
|
{{ mayan_root_dir }}/venv/bin/python |
|
|
|
@ -83,7 +125,7 @@ |
|
|
|
|
{{ (mayan_install_mode == 'install') | ternary('initialsetup','performupgrade') }} |
|
|
|
|
environment: |
|
|
|
|
- MAYAN_MEDIA_ROOT: "{{ mayan_root_dir }}/data" |
|
|
|
|
- MAYAN_DATABASE_ENGINE: django.db.backends.mysql |
|
|
|
|
- MAYAN_DATABASE_ENGINE: django.db.backends.{{ (mayan_db_engine == 'mysql') | ternary('mysql','postgresql') }} |
|
|
|
|
- MAYAN_DATABASE_NAME: "{{ mayan_db_name }}" |
|
|
|
|
- MAYAN_DATABASE_PASSWORD: "{{ mayan_db_pass }}" |
|
|
|
|
- MAYAN_DATABASE_USER: "{{ mayan_db_user }}" |
|
|
|
|