A complete Ansible role for MongoDB


I’m not sure whether this is allowed, but I’d like to promote an Ansible role I developed for MongoDB, all versions. I hope this will ease the installation, configuration and management process of this application a lot for system engineers.

It’s fair to say that I’m an experienced Ansible & system user. The main functionalities of the role are.

  • Applies recommended production notes, e.g. numa and disables transparent hugepages
  • Bootstrapping a cluster in a PSA architecture (primary, secondary, arbiter)
    • includes cluster verification
  • Secures connection by encrypting traffic via a keyfile, auto generated
  • Install either Community or the Enterprise edition
  • Supports all versions, e.g. 3.6, 4.4.
  • Easily to configure, with a future proof configuration method
  • Update playbook, supports patch releases
  • Add user defined users
  • Add user defined databases
  • Backup with mongodump
  • Logrotation, set from within mongo
  • Idempotent and desired state

The role can be found on my GitHub .


Welcome to the MongoDB Community Forums @Kevin_Csuka!

I moved this topic from “Ops and Admin” to “Open Source Projects”, but sharing and discussing projects using or related to MongoDB is definitely encouraged.