ansible/ansible — pull request #5615 by laggyluke (2014-01-14 13:20:30+00:00)
Title: Add mongodb_replica_set module for managing MongoDB replica sets

Usage:

```yaml
# initiate a replica set
- mongodb_replica_set: state=initiated

# add a replica set member
- mongodb_replica_set: member=secondary.example.com state=present

# add an arbiter on custom port
- mongodb_replica_set: member=arbiter.example.com:30000 arbiter_only=yes state=present

# remove a replica set member
- mongodb_replica_set: member=secondary.example.com state=absent

# use all possible parameters when adding a member (please don't do that in production):
- mongodb_replica_set: >
member=secondary.example.com
state=present
arbiter_only=yes
build_indexes=no
hidden=yes
priority=0
slave_delay=3600
votes=42
```

Unfortunately, automated tests would be really hard to set up, so instead I've prepared a usage example in a separate repository:
https://github.com/laggyluke/ansible-mongodb-playground