From a08541db6d38cd626b47e36a7b41dd7106f63f5f Mon Sep 17 00:00:00 2001 From: hw Date: Sun, 7 Feb 2016 17:12:26 +0530 Subject: [PATCH 1/2] Add support for MongoDB 3.2 --- Vagrantfile | 2 +- scripts/mongodb.sh | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Vagrantfile b/Vagrantfile index 492e3c1e..e107bdf3 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -38,7 +38,7 @@ mysql_root_password = "root" # We'll assume user "root" mysql_version = "5.5" # Options: 5.5 | 5.6 mysql_enable_remote = "false" # remote access enabled when true pgsql_root_password = "root" # We'll assume user "root" -mongo_version = "2.6" # Options: 2.6 | 3.0 +mongo_version = "2.6" # Options: 2.6 | 3.0 | 3.2 mongo_enable_remote = "false" # remote access enabled when true # Languages and Packages diff --git a/scripts/mongodb.sh b/scripts/mongodb.sh index d245ab7f..55aefdb5 100644 --- a/scripts/mongodb.sh +++ b/scripts/mongodb.sh @@ -3,11 +3,15 @@ echo ">>> Installing MongoDB" # Get key and add to sources -sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10 +if [ $2 == "3.2" ]; then + sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv EA312927 +else + sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10 +fi # Make MongoDB connectable from outside world without SSH tunnel -if [ $2 == "3.0" ]; then - echo "deb http://repo.mongodb.org/apt/ubuntu "$(lsb_release -sc)"/mongodb-org/3.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.0.list +if [[ $2 == "3."* ]]; then + echo "deb http://repo.mongodb.org/apt/ubuntu "$(lsb_release -sc)"/mongodb-org/$2 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-$2.list else echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' | sudo tee /etc/apt/sources.list.d/mongodb.list fi From 7a3a4d453e1ed7363eca81fb331132b7ab22156b Mon Sep 17 00:00:00 2001 From: hw Date: Sun, 7 Feb 2016 19:53:44 +0530 Subject: [PATCH 2/2] Add regex replace pattern for mongodb 3.0+ to allow remote connections --- scripts/mongodb.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/mongodb.sh b/scripts/mongodb.sh index 55aefdb5..bfc71cc3 100644 --- a/scripts/mongodb.sh +++ b/scripts/mongodb.sh @@ -29,6 +29,7 @@ if [ $1 == "true" ]; then # enable remote access # setting the mongodb bind_ip to allow connections from everywhere sed -i "s/bind_ip = .*/bind_ip = 0.0.0.0/" /etc/mongod.conf + sed -i "s/bindIp: .*/bindIp: 0.0.0.0/" /etc/mongod.conf fi # Test if PHP is installed