Setup gvamysql using new mechanisms

This commit is contained in:
Jan Dittberner 2020-03-04 19:32:22 +01:00
parent 3b48b4a455
commit bcb92e483d
7 changed files with 75 additions and 38 deletions

View file

@ -0,0 +1,13 @@
diff --git a/salt/modules/mysql.py b/salt/modules/mysql.py
index 87e2361e28..37436206d4 100644
--- a/salt/modules/mysql.py
+++ b/salt/modules/mysql.py
@@ -355,7 +355,7 @@ def _connect(**kwargs):
except IndexError:
return
val = __salt__['config.option']('mysql.{0}'.format(name), None)
- if val is not None:
+ if val != '':
connargs[key] = val
# If a default file is explicitly passed to kwargs, don't grab the

19
states/patches/mysql.sls Normal file
View file

@ -0,0 +1,19 @@
{% if grains.saltversion == "3000" %}
patch:
pkg.installed
mysql_module_patch:
file.patch:
- name: '{{ grains.saltpath }}'
- source: salt://patches/files/3000-mysql.diff
- strip: 2
- require:
- pkg: patch
restart_salt_minion:
cmd.run:
- name: 'salt-call service.restart salt-minion'
- bg: true
- onchanges:
- file: mysql_module_patch
{%- endif %}