community.mongodb.mongodb_maintenance – Enables or disables maintenance mode for a secondary member.
This plugin is part of the community.mongodb collection (version 1.3.2).
You might already have this collection installed if you are using the
It is not included in
To check whether it is installed, run
ansible-galaxy collection list.
To install it, use:
ansible-galaxy collection install community.mongodb.
To use it in a playbook, specify:
New in version 1.0.0: of community.mongodb
Enables or disables maintenance mode for a secondary member.
Wrapper around the replSetMaintenance command.
Performs no actions against a PRIMARY member.
When enabled SECONDARY members will not service reads.
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
- name: Enable maintenance mode community.mongodb.mongodb_maintenance: maintenance: true - name: Disable maintenance mode community.mongodb.mongodb_maintenance: maintenance: false
Common return values are documented here, the following are the fields unique to this module:
Whether the member was placed into maintenance mode or not.
If something went wrong
A short description of what happened.