pymongo Python module
Ensure that the named user is absent
The name of the user to remove
MongoDB user with sufficient privilege to create the user
Password for the admin user specified by the user
parameter
The hostname/IP address of the MongoDB server
The port on which MongoDB is listening
The database from which to remove the user specified by the name
parameter
The database in which to authenticate
Ensure that the user is present with the specified properties
The name of the user to manage
The password of the user to manage
MongoDB user with sufficient privilege to create the user
Password for the admin user specified with the user
parameter
The hostname/IP address of the MongoDB server
The port on which MongoDB is listening
The database in which to create the user
Note
If the database doesn't exist, it will be created.
The database in which to authenticate
The roles assigned to user specified with the name
parameter
Example:
mongouser-myapp:
mongodb_user.present:
- name: myapp
- passwd: password-of-myapp
- database: admin
# Connect as admin:sekrit
- user: admin
- password: sekrit
- roles:
- readWrite
- userAdmin
- dbOwner