mirror of
https://github.com/saltstack-formulas/mysql-formula.git
synced 2025-04-15 17:20:25 +00:00
Fix broken GRANT when not ssl
if ssl_option is not False, mysql_grant.present adds "REQUIRE" to the grant command but since all the ssl sub options are false or missing, there is a null string appended to the requirements. This causes the grant command to fail. This tests to see if ssl or X509 are set. If they're not, it skips the entire ssl_option section leaving ssl_option==False to prevent that error.
This commit is contained in:
parent
c6674034ee
commit
703388ec05
1 changed files with 2 additions and 0 deletions
|
@ -79,6 +79,7 @@ include:
|
|||
- grant: {{db['grants']|join(",")}}
|
||||
- database: '{{ db['database'] }}.{{ db['table'] | default('*') }}'
|
||||
- grant_option: {{ db['grant_option'] | default(False) }}
|
||||
{% if 'ssl' in user or 'ssl-X509' in user %}
|
||||
- ssl_option:
|
||||
- SSL: {{ user['ssl'] | default(False) }}
|
||||
{% if user['ssl-X509'] is defined %}
|
||||
|
@ -93,6 +94,7 @@ include:
|
|||
{% if user['ssl-CIPHER'] is defined %}
|
||||
- CIPHER: {{ user['ssl-CIPHER'] }}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
- user: {{ name }}
|
||||
- host: '{{ host }}'
|
||||
- connection_host: '{{ mysql_host }}'
|
||||
|
|
Loading…
Add table
Reference in a new issue