mirror of
https://github.com/saltstack-formulas/mysql-formula.git
synced 2025-04-17 10:10:30 +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
|
- mysql.python
|
||||||
|
|
||||||
{% for database in salt['pillar.get']('mysql:database', []) %}
|
{% for database in salt['pillar.get']('mysql:database', []) %}
|
||||||
{{ database }}:
|
mysql_db_{{ database }}:
|
||||||
mysql_database.present:
|
mysql_database.present:
|
||||||
- host: localhost
|
- host: localhost
|
||||||
- connection_user: root
|
- connection_user: root
|
||||||
|
|
|
@ -4,8 +4,9 @@ include:
|
||||||
- mysql.python
|
- mysql.python
|
||||||
|
|
||||||
{% for user in salt['pillar.get']('mysql:user', []) %}
|
{% for user in salt['pillar.get']('mysql:user', []) %}
|
||||||
{{ user['name'] }}:
|
mysql_user_{{ user['name'] }}:
|
||||||
mysql_user.present:
|
mysql_user.present:
|
||||||
|
- name: {{ user['name'] }}
|
||||||
- host: {{ user['host'] }}
|
- host: {{ user['host'] }}
|
||||||
{%- if user['password_hash'] is defined %}
|
{%- if user['password_hash'] is defined %}
|
||||||
- password_hash: '{{ user['password_hash'] }}'
|
- password_hash: '{{ user['password_hash'] }}'
|
||||||
|
@ -18,8 +19,10 @@ include:
|
||||||
- connection_charset: utf8
|
- connection_charset: utf8
|
||||||
|
|
||||||
{% for db in user['databases'] %}
|
{% for db in user['databases'] %}
|
||||||
{{ user['name'] }}_{{ db['database'] }}:
|
{% set name = user['name'] ~ '_' ~ db['database'] %}
|
||||||
|
mysql_user_{{ name }}:
|
||||||
mysql_grants.present:
|
mysql_grants.present:
|
||||||
|
- name: {{ name }}
|
||||||
- grant: {{db['grants']|join(",")}}
|
- grant: {{db['grants']|join(",")}}
|
||||||
- database: {{ db['database'] }}.*
|
- database: {{ db['database'] }}.*
|
||||||
- user: {{ user['name'] }}
|
- user: {{ user['name'] }}
|
||||||
|
|
Loading…
Add table
Reference in a new issue