MythicSalt/states/mariadb/init.sls

42 lines
942 B
Plaintext

debconf-utils:
pkg.installed
mariadb_setup:
debconf.set:
- name: mysql-server
- data:
'mysql-server/root_password': {'type': 'password', 'value': '{{ salt['pillar.get']('mariadb:root_pw', '') }}' }
'mysql-server/root_password_again': {'type': 'password', 'value': '{{ salt['pillar.get']('mariadb:root_pw', '') }}' }
- require:
- pkg: debconf-utils
python3-mysqldb:
pkg.installed
mariadb-server:
pkg.installed:
- require:
- debconf: mysql-server
- pkg: python3-mysqldb
mariadb:
service.running:
- watch:
- pkg: mariadb-server
/etc/salt/minion.d/mariadb.conf:
file.managed:
- source: salt://mariadb/minion_mariadb.conf
- template: jinja
- user: root
- group: root
- mode: 600
- require:
- service: mariadb
restart_minion_for_mariadb:
service.running:
- name: salt-minion
- watch:
- file: /etc/salt/minion.d/mariadb.conf