mirror of
https://github.com/saltstack-formulas/mysql-formula.git
synced 2025-04-16 09:40:26 +00:00
Merge pull request #168 from nesteves/master
Allow the use of wildcards on a user's database/table names when defining grants.
This commit is contained in:
commit
8f2e6ad770
2 changed files with 8 additions and 1 deletions
|
@ -112,6 +112,7 @@ include:
|
||||||
{% endif %}
|
{% endif %}
|
||||||
- user: {{ name }}
|
- user: {{ name }}
|
||||||
- host: '{{ host }}'
|
- host: '{{ host }}'
|
||||||
|
- escape: {{ db['escape'] | default(True) }}
|
||||||
- connection_host: '{{ mysql_host }}'
|
- connection_host: '{{ mysql_host }}'
|
||||||
- connection_user: '{{ mysql_salt_user }}'
|
- connection_user: '{{ mysql_salt_user }}'
|
||||||
{% if mysql_salt_pass -%}
|
{% if mysql_salt_pass -%}
|
||||||
|
|
|
@ -106,6 +106,7 @@ mysql:
|
||||||
databases:
|
databases:
|
||||||
- database: foo
|
- database: foo
|
||||||
grants: ['select', 'insert', 'update']
|
grants: ['select', 'insert', 'update']
|
||||||
|
escape: True
|
||||||
- database: bar
|
- database: bar
|
||||||
grants: ['all privileges']
|
grants: ['all privileges']
|
||||||
bob:
|
bob:
|
||||||
|
@ -117,9 +118,14 @@ mysql:
|
||||||
ssl-ISSUER: Name
|
ssl-ISSUER: Name
|
||||||
ssl-CIPHER: Cipher
|
ssl-CIPHER: Cipher
|
||||||
databases:
|
databases:
|
||||||
- database: foo
|
# https://github.com/saltstack/salt/issues/41178
|
||||||
|
# If you want to refer to databases using wildcards, turn off escape so
|
||||||
|
# the renderer does not escape them, enclose the string in '`' and
|
||||||
|
# use two '%'
|
||||||
|
- database: '`foo\_%%`'
|
||||||
grants: ['all privileges']
|
grants: ['all privileges']
|
||||||
grant_option: True
|
grant_option: True
|
||||||
|
escape: False
|
||||||
- database: bar
|
- database: bar
|
||||||
table: foobar
|
table: foobar
|
||||||
grants: ['select', 'insert', 'update', 'delete']
|
grants: ['select', 'insert', 'update', 'delete']
|
||||||
|
|
Loading…
Add table
Reference in a new issue