Last Updated: February 25, 2016
·
1.853K
· lgavinho

Shell script to install MongoDB

To install mongodb in a puppet script you can use this Linux script below.

Copy and name it install_mongodb.sh

#!/bin/bash
sudo su
apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10
echo "deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen" | tee -a /etc/apt/sources.list.d/10gen.list
apt-get -y update
apt-get -y install mongodb-10gen
echo 'extension=mongo.so' > /etc/php5/conf.d/mongo.ini
service apache2 restart