mongodb_parameter - Change an administrative parameter on a MongoDB server.
New in version 2.1.
Synopsis
- Change an administrative parameter on a MongoDB server.
Requirements
The below requirements are needed on the host that executes this module.
- pymongo
Parameters
| Parameter | Choices/Defaults | Comments |
|---|---|---|
| database required | The name of the database to add/remove the user from | |
| login_database | Default: None | The database where login credentials are stored |
| login_host | Default: localhost | The host running the database |
| login_password | Default: None | The password used to authenticate with |
| login_port | Default: 27017 | The port to connect to |
| login_user | Default: None | The username used to authenticate with |
| param required | MongoDB administrative parameter to modify | |
| param_type | Default: str | Define the parameter value (str, int) |
| replica_set | Default: None | Replica set to connect to (automatically connects to primary for writes) |
| ssl | Default: no | Whether to use an SSL connection when connecting to the database |
| value required | MongoDB administrative parameter value to set |
Notes
Note
- Requires the pymongo Python package on the remote host, version 2.4.2+. This can be installed using pip or the OS package manager. @see http://api.mongodb.org/python/current/installation.html
Examples
# Set MongoDB syncdelay to 60 (this is an int)
- mongodb_parameter:
param: syncdelay
value: 60
param_type: int
Return Values
Common return values are documented here, the following are the fields unique to this module:
| Key | Returned | Description |
|---|---|---|
| after string | success | value after modification |
| before string | success | value before modification |
Status
This module is flagged as preview which means that it is not guaranteed to have a backwards compatible interface.
Author
- Loic Blot (@nerzhul)
Hint
If you notice any issues in this documentation you can edit this document to improve it.
© 2012–2018 Michael DeHaan
© 2018–2019 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/2.5/modules/mongodb_parameter_module.html