mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 17:09:03 +00:00
Merge pull request #36357 from shorawitz/patch-1
Add options for SSL connection
This commit is contained in:
commit
b03b61acb1
@ -30,6 +30,10 @@ Complete example
|
||||
user: 'salt'
|
||||
pass: 'super_secret_password'
|
||||
db: 'salt_db'
|
||||
port: 3306
|
||||
ssl:
|
||||
cert: /etc/mysql/client-cert.pem
|
||||
key: /etc/mysql/client-key.pem
|
||||
|
||||
ext_pillar:
|
||||
- mysql:
|
||||
@ -83,7 +87,8 @@ class MySQLExtPillar(SqlBaseExtPillar):
|
||||
'user': 'salt',
|
||||
'pass': 'salt',
|
||||
'db': 'salt',
|
||||
'port': 3306}
|
||||
'port': 3306,
|
||||
'ssl': {}}
|
||||
_options = {}
|
||||
_opts = __opts__.get('mysql', {})
|
||||
for attr in defaults:
|
||||
@ -103,7 +108,8 @@ class MySQLExtPillar(SqlBaseExtPillar):
|
||||
conn = MySQLdb.connect(host=_options['host'],
|
||||
user=_options['user'],
|
||||
passwd=_options['pass'],
|
||||
db=_options['db'], port=_options['port'])
|
||||
db=_options['db'], port=_options['port'],
|
||||
ssl=_options['ssl'])
|
||||
cursor = conn.cursor()
|
||||
try:
|
||||
yield cursor
|
||||
|
Loading…
Reference in New Issue
Block a user