#!/bin/bash
set -e
cat <<END > mongodb-org-3.0.repo
[mongodb-org-3.0]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/amazon/2013.03/mongodb-org/3.0/x86_64/
gpgcheck=0
enabled=1
END
sudo mv -v mongodb-org-3.0.repo /etc/yum.repos.d/mongodb-org-3.0.repo
sudo yum install -y mongodb-org
sudo service mongod start
sudo chkconfig mongod on

#!/bin/bash
cat <<END | sudo tee /etc/yum.repos.d/mongodb-org-3.2.repo
[mongodb-org-3.2]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/amazon/2013.03/mongodb-org/3.2/x86_64/
gpgcheck=1
enabled=1
gpgkey=https://www.mongodb.org/static/pgp/server-3.2.asc
END
sudo yum update -y
set -e
sudo yum install -y mongodb-org
if [[ ! -e /var/run/mongodb/mongod.pid ]] ; then
    sudo service mongod start
    sudo chkconfig mongod on
fi

Improve mongo installer for aws linux
Improve mongo installer for aws linux
