2020-03-04 19:32:22 +01:00
|
|
|
{% 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 %}
|
2020-03-04 20:54:45 +01:00
|
|
|
# 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
|
2016-09-25 17:29:52 +02:00
|
|
|
include:
|
2023-05-07 13:15:45 +02:00
|
|
|
- python.poetry
|
2020-03-04 19:32:22 +01:00
|
|
|
- mariadb-server
|
2016-09-25 17:29:52 +02:00
|
|
|
|
2020-03-04 19:32:22 +01:00
|
|
|
{{ create_celery_worker(gvaappname, purpose) }}
|
|
|
|
|
|
|
|
{{ gvaappname }}-dependencies:
|
|
|
|
pkg.installed:
|
|
|
|
- pkgs:
|
2023-05-07 13:15:45 +02:00
|
|
|
- python3-dev
|
2020-03-04 19:32:22 +01:00
|
|
|
- libmariadb-dev-compat
|
|
|
|
- require_in:
|
|
|
|
- cmd: {{ gvaappname }}-requirements
|
|
|
|
|
|
|
|
python3-mysqldb:
|
2023-05-07 13:15:45 +02:00
|
|
|
pip.installed:
|
|
|
|
- name: mysqlclient
|
2020-03-04 19:32:22 +01:00
|
|
|
|
2016-09-25 17:29:52 +02:00
|
|
|
gvamysql-mysql-user:
|
|
|
|
mysql_user.present:
|
2020-03-04 19:32:22 +01:00
|
|
|
- name: {{ mysql_admin_user }}
|
2016-09-25 17:29:52 +02:00
|
|
|
- host: '%'
|
2020-03-04 19:32:22 +01:00
|
|
|
- password: {{ mysql_admin_password }}
|
|
|
|
- require:
|
2023-05-07 13:15:45 +02:00
|
|
|
- pip: python3-mysqldb
|
2016-09-25 17:29:52 +02:00
|
|
|
|
|
|
|
gvamysql-grants-all-dbs:
|
|
|
|
mysql_grants.present:
|
|
|
|
- grant: ALL PRIVILEGES
|
|
|
|
- database: '*.*'
|
|
|
|
- grant_option: True
|
2020-03-04 19:32:22 +01:00
|
|
|
- user: {{ mysql_admin_user }}
|
|
|
|
- password: {{ mysql_admin_password }}
|
2016-09-25 17:29:52 +02:00
|
|
|
- host: '%'
|
|
|
|
- require:
|
2023-05-07 13:15:45 +02:00
|
|
|
- pip: python3-mysqldb
|
2016-09-25 17:29:52 +02:00
|
|
|
- mysql_user: gvamysql-mysql-user
|