44 lines
1.4 KiB
Text
44 lines
1.4 KiB
Text
{% set gvaappname = salt['pillar.get']('gnuviechadmin:appname') %}
|
|
{% set purpose = "for MySQL/MariaDB configuration management" %}
|
|
{% set mysql_admin_user = salt['pillar.get']('gnuviechadmin:{}:mysql_admin_user'.format(gvaappname), 'gvamysql') %}
|
|
{% set mysql_admin_password = salt['pillar.get']('gnuviechadmin:{}:mysql_admin_password'.format(gvaappname)) %}
|
|
{% from 'gnuviechadmin/gvaapp_macros.sls' import create_celery_worker with context %}
|
|
# FIXME: this is broken due to https://github.com/saltstack/salt/issues/56124
|
|
# patches.mysql is needed to be run on the minion before usage with Salt 3000
|
|
include:
|
|
- python.pipenv
|
|
- python.virtualenv
|
|
- patches.mysql
|
|
- mariadb-server
|
|
|
|
{{ create_celery_worker(gvaappname, purpose) }}
|
|
|
|
{{ gvaappname }}-dependencies:
|
|
pkg.installed:
|
|
- pkgs:
|
|
- libmariadb-dev-compat
|
|
- require_in:
|
|
- cmd: {{ gvaappname }}-requirements
|
|
|
|
python3-mysqldb:
|
|
pkg.installed
|
|
|
|
gvamysql-mysql-user:
|
|
mysql_user.present:
|
|
- name: {{ mysql_admin_user }}
|
|
- host: '%'
|
|
- password: {{ mysql_admin_password }}
|
|
- unix_socket: true
|
|
- require:
|
|
- pkg: python3-mysqldb
|
|
|
|
gvamysql-grants-all-dbs:
|
|
mysql_grants.present:
|
|
- grant: ALL PRIVILEGES
|
|
- database: '*.*'
|
|
- grant_option: True
|
|
- user: {{ mysql_admin_user }}
|
|
- password: {{ mysql_admin_password }}
|
|
- host: '%'
|
|
- require:
|
|
- mysql_user: gvamysql-mysql-user
|