Fix mongodb_user ssl_cert_reqs param (#2963) (#2965)

reviewable/pr18780/r1
Lujeni 8 years ago committed by René Moser
parent 7aab9cd93b
commit c1adb215f0

@ -320,20 +320,24 @@ def main():
password = module.params['password']
ssl = module.params['ssl']
ssl_cert_reqs = None
if ssl:
ssl_cert_reqs = getattr(ssl_lib, module.params['ssl_cert_reqs'])
roles = module.params['roles'] or []
state = module.params['state']
update_password = module.params['update_password']
try:
connection_params = {
"host": login_host,
"port": int(login_port),
}
if replica_set:
client = MongoClient(login_host, int(login_port),
replicaset=replica_set, ssl=ssl,
ssl_cert_reqs=ssl_cert_reqs)
else:
client = MongoClient(login_host, int(login_port), ssl=ssl,
ssl_cert_reqs=ssl_cert_reqs)
connection_params["replicaset"] = replica_set
if ssl:
connection_params["ssl"] = ssl
connection_params["ssl_cert_reqs"] = getattr(ssl_lib, module.params['ssl_cert_reqs'])
client = MongoClient(**connection_params)
if login_user is None and login_password is None:
mongocnf_creds = load_mongocnf()

Loading…
Cancel
Save