- The database user roles valid values are one or more of the following: "read", "readWrite", "dbAdmin", "userAdmin", "clusterAdmin", "readAnyDatabase", "readWriteAnyDatabase", "userAdminAnyDatabase", "dbAdminAnyDatabase"
- This param requires mongodb 2.4+
- This param requires mongodb 2.4+ and pymongo 2.5+
module.fail_json(msg='password parameter required when adding a user')
if user_add(client, db_name, user, password, roles) is not True:
if user_add(module, client, db_name, user, password, roles) is not True:
module.fail_json(msg='Unable to add or update user, check login_user and login_password are correct and that this user has access to the admin collection')
elif state == 'absent':
if user_remove(client, db_name, user) is not True: