diff --git a/lib/ansible/modules/extras/database/misc/mongodb_user.py b/lib/ansible/modules/extras/database/misc/mongodb_user.py index 266b902fda7..e0d1342bc41 100644 --- a/lib/ansible/modules/extras/database/misc/mongodb_user.py +++ b/lib/ansible/modules/extras/database/misc/mongodb_user.py @@ -315,7 +315,7 @@ def main(): ssl_cert_reqs = None if ssl: ssl_cert_reqs = getattr(ssl_lib, module.params['ssl_cert_reqs']) - roles = module.params['roles'] + roles = module.params['roles'] or [] state = module.params['state'] update_password = module.params['update_password']