mirror of
https://github.com/saltstack-formulas/mysql-formula.git
synced 2025-04-16 01:30:25 +00:00
Fixed state names without proper namespacing that could lead to potential conflicts.
This commit is contained in:
parent
608e090370
commit
adacdb49e4
2 changed files with 6 additions and 3 deletions
|
@ -4,7 +4,7 @@ include:
|
|||
- mysql.python
|
||||
|
||||
{% for database in salt['pillar.get']('mysql:database', []) %}
|
||||
{{ database }}:
|
||||
mysql_db_{{ database }}:
|
||||
mysql_database.present:
|
||||
- host: localhost
|
||||
- connection_user: root
|
||||
|
|
|
@ -4,8 +4,9 @@ include:
|
|||
- mysql.python
|
||||
|
||||
{% for user in salt['pillar.get']('mysql:user', []) %}
|
||||
{{ user['name'] }}:
|
||||
mysql_user_{{ user['name'] }}:
|
||||
mysql_user.present:
|
||||
- name: {{ user['name'] }}
|
||||
- host: {{ user['host'] }}
|
||||
{%- if user['password_hash'] is defined %}
|
||||
- password_hash: '{{ user['password_hash'] }}'
|
||||
|
@ -18,8 +19,10 @@ include:
|
|||
- connection_charset: utf8
|
||||
|
||||
{% for db in user['databases'] %}
|
||||
{{ user['name'] }}_{{ db['database'] }}:
|
||||
{% set name = user['name'] ~ '_' ~ db['database'] %}
|
||||
mysql_user_{{ name }}:
|
||||
mysql_grants.present:
|
||||
- name: {{ name }}
|
||||
- grant: {{db['grants']|join(",")}}
|
||||
- database: {{ db['database'] }}.*
|
||||
- user: {{ user['name'] }}
|
||||
|
|
Loading…
Add table
Reference in a new issue