Forge Home

mongodb

Installs MongoDB on RHEL/Ubuntu/Debian.

385,009 downloads

4,844 latest version

4.7 quality score

We run a couple of automated
scans to help you access a
module's quality. Each module is
given a score based on how well
the author has formatted their
code and documentation and
modules are also checked for
malware using VirusTotal.

Please note, the information below
is for guidance only and neither of
these methods should be considered
an endorsement by Puppet.

Version information

  • 6.0.1 (latest)
  • 6.0.0
  • 5.0.0
  • 4.2.0
  • 4.1.1
  • 4.1.0
  • 4.0.0
  • 3.1.0
  • 3.0.0
  • 2.4.1
  • 2.4.0
  • 2.3.0
  • 2.2.2
  • 2.2.1
  • 2.2.0
  • 2.1.2
  • 2.1.1
  • 2.1.0
  • 2.0.0
  • 1.1.0
released May 7th 2024
This version is compatible with:
  • Puppet Enterprise 2023.8.x, 2023.7.x, 2023.6.x, 2023.5.x, 2023.4.x, 2023.3.x, 2023.2.x, 2023.1.x, 2023.0.x, 2021.7.x, 2021.6.x, 2021.5.x, 2021.4.x, 2021.3.x, 2021.2.x, 2021.1.x, 2021.0.x
  • Puppet >= 7.0.0 < 9.0.0
  • , , , , , , ,

Start using this module

  • r10k or Code Manager
  • Bolt
  • Manual installation
  • Direct download

Add this module to your Puppetfile:

mod 'puppet-mongodb', '6.0.1'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add puppet-mongodb
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install puppet-mongodb --version 6.0.1

Direct download is not typically how you would use a Puppet module to manage your infrastructure, but you may want to download the module in order to inspect the code.

Download

Documentation

puppet/mongodb — version 6.0.1 May 7th 2024

mongodb puppet module

Build Status Release Puppet Forge Puppet Forge - downloads Puppet Forge - endorsement Puppet Forge - scores License

Table of Contents

  1. Overview
  2. Module Description - What does the module do?
  3. Setup - The basics of getting started with mongodb
  4. Usage - Configuration options and additional functionality
  5. Limitations - OS compatibility, etc.
  6. Development - Guide for contributing to the module

Overview

Installs MongoDB on RHEL/Ubuntu/Debian/SLES from community/enterprise repositories or alternatively from custom repositories.

Module Description

The MongoDB module manages mongod server installation and configuration of the mongod daemon.

The MongoDB module also manages mongos, Ops Manager and the mongdb-mms setup.

Setup

What MongoDB affects

  • MongoDB packages.
  • MongoDB configuration files.
  • MongoDB services.
  • MongoDB apt/yum/zypper repository.

Beginning with MongoDB

If you want a server installation with the default options you can run include mongodb::server. If you need to customize configuration options you need to do the following:

class {'mongodb::server':
  port    => 27018,
  verbose => true,
}

To install client with default options run include mongodb::client

To override the default mongodb repo version you need the following:

class {'mongodb::globals':
  repo_version => '4.4',
}
-> class {'mongodb::server': }
-> class {'mongodb::client': }

If you have a custom Mongodb repository you can opt out of repo management:

class {'mongodb::globals':
  manage_package_repo => false,
}
-> class {'mongodb::server': }
-> class {'mongodb::client': }

Usage

Most of the interaction for the server is done via mongodb::server. For more options please have a look at mongodb::server. There is also mongodb::globals to set some global settings, on its own this class does nothing.

Create MongoDB database

To install MongoDB server, create database "testdb" and user "user1" with password "pass1".

class {'mongodb::server':
  auth => true,
}

mongodb::db { 'testdb':
  user          => 'user1',
  password_hash => 'a15fbfca5e3a758be80ceaf42458bcd8',
}

Parameter 'password_hash' is hex encoded md5 hash of "user1:mongo:pass1". Unsafe plain text password could be used with 'password' parameter instead of 'password_hash'.

Sharding

If one plans to configure sharding for a Mongo deployment, the module offer the mongos installation. mongos can be installed the following way :

class {'mongodb::mongos' :
  configdb => ['configsvr1.example.com:27018'],
}

Ops Manager

To install Ops Manager and have it run with a local MongoDB application server do the following:

class {'mongodb::opsmanager':
  opsmanager_url        => 'http://opsmanager.yourdomain.com'
  mongo_uri             => 'mongodb://yourmongocluster:27017,
  from_email_addr       => 'opsmanager@yourdomain.com',
  reply_to_email_addr   => 'replyto@yourdomain.com',
  admin_email_addr      => 'admin@yourdomain.com',
  $smtp_server_hostname => 'email-relay.yourdomain.com'
}

The default settings will not set useful email addresses. You can also just run include mongodb::opsmanager and then set the emails later.

Ops Manager Usage

Most of the interaction for the server is done via mongodb::opsmanager. For more options please have a look at mongodb::opsmanager.

Limitations

Look at metadata.json for tested OSes.

Development

This module is maintained by Vox Pupuli. Voxpupuli welcomes new contributions to this module, especially those that include documentation and rspec tests. We are happy to provide guidance if necessary.

Please see CONTRIBUTING for more details.

Authors

  • Puppetlabs Module Team
  • Voxpupuli Team

We would like to thank everyone who has contributed issues and pull requests to this module. A complete list of contributors can be found on the GitHub Contributor Graph for the puppet-mongodb module.