community.mongodb.mongodb_balancer – Manages the MongoDB Sharded Cluster Balancer.¶
Note
This plugin is part of the community.mongodb collection (version 1.2.1).
To install it use: ansible-galaxy collection install community.mongodb
.
To use it in a playbook, specify: community.mongodb.mongodb_balancer
.
New in version 1.0.0: of community.mongodb
Synopsis¶
Manages the MongoDB Sharded Cluster Balancer.
Start or stop the balancer.
Adjust the cluster chunksize.
Enable or disable autosplit.
Adds or remove a balancer window.
Parameters¶
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¶
- name: Start the balancer
community.mongodb.mongodb_balancer:
state: started
- name: Stop the balancer and disable autosplit
community.mongodb.mongodb_balancer:
state: stopped
autosplit: false
- name: Enable autosplit
community.mongodb.mongodb_balancer:
autosplit: true
- name: Change the default chunksize to 128MB
community.mongodb.mongodb_balancer:
chunksize: 128
- name: Add or update a balancing window
community.mongodb.mongodb_balancer:
window:
start: "23:00"
stop: "06:00"
state: "present"
- name: Remove a balancing window
community.mongodb.mongodb_balancer:
window:
state: "absent"
Return Values¶
Common return values are documented here, the following are the fields unique to this module:
Authors¶
Rhys Campbell (@rhysmeister)