- The database user roles valid values are one or more of the following: "read", "readWrite", "dbAdmin", "userAdmin", "clusterAdmin", "readAnyDatabase", "readWriteAnyDatabase", "userAdminAnyDatabase", "dbAdminAnyDatabase"
module.fail_json(msg='password parameter required when adding a user')
if user_add(client, db_name, user, password) is not True:
if user_add(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: