Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. MongoDB
  3. ansible-role-mongodb

ansible-role-mongodb

GPL-2.0Pythonv2.7.0

An Ansible role for installing, configuring, and managing MongoDB across multiple Linux distributions.

GitHubGitHub
348 stars294 forks0 contributors

What is ansible-role-mongodb?

ansible-role-mongodb is an Ansible role that automates the installation, configuration, and management of MongoDB databases. It solves the problem of manual, error-prone MongoDB setup by providing a declarative way to deploy consistent MongoDB instances across various Linux environments. The role handles everything from basic installation to advanced features like replication, security, and monitoring integration.

Target Audience

DevOps engineers, system administrators, and infrastructure teams who manage MongoDB deployments using Ansible for configuration automation. It's particularly useful for teams maintaining multiple MongoDB instances across development, staging, and production environments.

Value Proposition

Developers choose this role because it's battle-tested across multiple distributions, supports a wide range of MongoDB versions, and provides production-ready configurations out of the box. Its extensive variable system allows deep customization while maintaining simplicity for common use cases.

Overview

Ansible role to configure MongoDB

Use Cases

Best For

  • Automating MongoDB installation across Ubuntu, Debian, RHEL, and Amazon Linux servers
  • Setting up MongoDB replica sets with Ansible for high availability
  • Configuring MongoDB authentication and user management programmatically
  • Deploying MongoDB with specific storage engine configurations (WiredTiger/mmapv1)
  • Integrating MongoDB monitoring with MMS automation agents
  • Managing MongoDB log rotation and systemd service configurations

Not Ideal For

  • Projects needing MongoDB 5.0 or newer features
  • Teams deploying MongoDB exclusively on Windows or macOS
  • Environments using Kubernetes or Docker Compose as primary orchestration tools
  • Small-scale applications with single-instance MongoDB that don't require automation overhead

Pros & Cons

Pros

Broad OS Compatibility

Tested on Ubuntu, Debian, RHEL, and Amazon Linux 2 with a detailed support matrix in the README, ensuring reliable cross-distribution deployment.

Production Security Features

Enables authentication, configures keyfiles for replication, and manages administrative users out of the box, as shown in the security and user variable sections.

Replication Automation

Automates replica set setup with support for arbiters and oplog users, including inventory examples for high availability configurations.

Deep Configuration Control

Exposes extensive variables for storage engines (WiredTiger/mmapv1), logging, networking, and more, allowing fine-tuned MongoDB instances.

Cons

Outdated Version Support

Only supports MongoDB up to 4.4, missing newer versions (e.g., 5.0+, 6.x, 7.x), which limits access to modern features and security patches.

Configuration Complexity

With over 50 configuration variables, setup can be overwhelming and error-prone, especially for users not deeply familiar with Ansible or MongoDB internals.

Limited Cloud Integration

Focused on on-premise deployments with no built-in support for cloud-native services like MongoDB Atlas, making it less suitable for hybrid or fully cloud-based setups.

Frequently Asked Questions

Quick Stats

Stars348
Forks294
Contributors0
Open Issues25
Last commit2 years ago
CreatedSince 2015

Tags

#devops#replication#self-hosted-database#infrastructure-as-code#database-automation#mongodb#ansible-role#linux#configuration-management

Built With

a
ansible

Included in

MongoDB2.6k
Auto-fetched 1 day ago

Related Projects

Helm ChartHelm Chart

⚠️(OBSOLETE) Curated applications for Kubernetes

Stars15,420
Forks16,351
Last commit4 years ago
chef-mongodbchef-mongodb

MongoDB Chef cookbook

Stars363
Forks3
Last commit9 years ago
puppet-mongodbpuppet-mongodb

mongodb installation

Stars90
Forks437
Last commit2 months ago
DockerHub Official Docker ImageDockerHub Official Docker Image

Stars0
Forks0
Last commit
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub