This module requires PyMongo to be installed.
absent(name, user=None, password=None, host=None, port=None, database='admin', authdb=None)¶
Ensure that the named user is absent
present(name, passwd, database='admin', user=None, password=None, host='localhost', port=27017, authdb=None)¶
Ensure that the user is present with the specified properties
The database in which to create the user
If the database doesn't exist, it will be created.
mongouser-myapp: mongodb_user.present: - name: myapp - passwd: password-of-myapp # Connect as admin:sekrit - user: admin - password: sekrit