diff options
author | Abhijit Menon-Sen <abhijit@menon-sen.com> | 2016-03-18 20:38:33 +0530 |
---|---|---|
committer | Abhijit Menon-Sen <abhijit@menon-sen.com> | 2016-03-18 20:38:33 +0530 |
commit | efdac490ffed69356fd19013ca2ae4c8390cb1eb (patch) | |
tree | a44e01feaff0a14d4566efe457fa46cd2e91e1be | |
parent | 06e65132761e3d20b5d5196589a3337e6e60eabc (diff) | |
parent | e613737b80affa87e468c1f68c465651a4369b1a (diff) | |
download | ansible-efdac490ffed69356fd19013ca2ae4c8390cb1eb.tar.gz |
Merge pull request #14924 from mvgrimes/patch-1
Dynamically add ssl key to the mysql config hash iff needed
-rw-r--r-- | lib/ansible/module_utils/mysql.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/ansible/module_utils/mysql.py b/lib/ansible/module_utils/mysql.py index 74ae3d8c78..693650dac6 100644 --- a/lib/ansible/module_utils/mysql.py +++ b/lib/ansible/module_utils/mysql.py @@ -31,11 +31,12 @@ def mysql_connect(module, login_user=None, login_password=None, config_file='', ssl_cert=None, ssl_key=None, ssl_ca=None, db=None, cursor_class=None, connect_timeout=30): config = { - 'host': module.params['login_host'], - 'ssl': { - } + 'host': module.params['login_host'] } + if ssl_ca is not None or ssl_key is not None or ssl_cert is not None: + config['ssl'] = {} + if module.params['login_unix_socket']: config['unix_socket'] = module.params['login_unix_socket'] else: |