mirror of
https://github.com/saltstack-formulas/mysql-formula.git
synced 2025-04-16 01:30:25 +00:00
19 lines
810 B
Text
19 lines
810 B
Text
{%- set mysql_root_user = salt['pillar.get']('mysql:server:root_user', 'root') %}
|
|
{%- set mysql_root_pass = salt['pillar.get']('mysql:server:root_password', salt['grains.get']('server_id')) %}
|
|
{%- set mysql_host = salt['pillar.get']('mysql:server:host', 'localhost') %}
|
|
{%- set mysql_salt_user = salt['pillar.get']('mysql:salt_user:salt_user_name', mysql_root_user) %}
|
|
{%- set mysql_salt_pass = salt['pillar.get']('mysql:salt_user:salt_user_password', mysql_root_pass) %}
|
|
|
|
include:
|
|
- .python
|
|
|
|
mysql remove test database:
|
|
mysql_database.absent:
|
|
- name: test
|
|
- host: '{{ mysql_host }}'
|
|
- connection_user: '{{ mysql_salt_user }}'
|
|
- connection_host: '{{ mysql_host }}'
|
|
{%- if mysql_salt_pass %}
|
|
- connection_pass: '{{ mysql_salt_pass }}'
|
|
{%- endif %}
|
|
- connection_charset: utf8
|