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