Ansible role to install mongod.
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
defaults set default mongo install dir Oct 27, 2015
handlers init Jul 10, 2015
meta init Sep 21, 2015
tasks Merge pull request #6 from tima/patch-1 Mar 17, 2016
templates add travis tests Oct 27, 2015
test company param removed Mar 21, 2016
vars init Jul 10, 2015
.gitignore add travis tests Oct 27, 2015
.travis.yml travis update Mar 17, 2016 Merge branch 'phips-updates_for_ha_support_provision_docker' Oct 27, 2015
requirements.yml init Sep 21, 2015

Build Status


Ansible role to install mongod


Installed MongoDB, in either standalone or resilient configurations.


To configure Mongo with a replication set you should have groups in your inventory called primary and secondary. Primary should contain just one host, secondary can contain as many hosts as you like, but at least two (as MongoDB replica sets are a minimum of three hosts). Then you need to set install_mongod_replset to a name for the replica set.

Role Variables

install_mongod_admin_username: ''
install_mongod_admin_password: ''
install_mongod_user_username: ''
install_mongod_user_password: ''
install_mongod_user_database: ''
install_mongod_bind_ip: ""
install_mongod_replset: ''
install_mongod_keyfile: ''          # for secure replication
install_mongod_dbpath: ''



Example Playbook

- hosts: servers
     - { role: install_mongod
        , install_mongod_admin_username: admin
        , install_mongod_admin_password: Chang3Me!
        , install_mongod_user_username: awx
        , install_mongod_user_password: Chang3Me2!
        , install_mongod_user_database: awx
        , install_mongod_bind_ip: ''
        , install_mongod_replset: tower
        , install_mongod_keyfile: '/etc/pki/mongo/keyfile'
        , tags: mongo }



Author Information

Chris Meyers - original Mark Phillips - HA