diff --git a/Vagrantfile b/Vagrantfile index c7322cf2..eee50e64 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -37,6 +37,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_enable_remote = "false" # remote access enabled when true # Languages and Packages @@ -228,7 +229,7 @@ Vagrant.configure("2") do |config| # config.vm.provision "shell", path: "#{github_url}/scripts/couchdb.sh" # Provision MongoDB - # config.vm.provision "shell", path: "#{github_url}/scripts/mongodb.sh", args: mongo_enable_remote + # config.vm.provision "shell", path: "#{github_url}/scripts/mongodb.sh", args: [mongo_enable_remote, mongo_version] # Provision MariaDB # config.vm.provision "shell", path: "#{github_url}/scripts/mariadb.sh", args: [mysql_root_password, mysql_enable_remote] diff --git a/scripts/mongodb.sh b/scripts/mongodb.sh index f7d24674..9ec1d1d0 100644 --- a/scripts/mongodb.sh +++ b/scripts/mongodb.sh @@ -4,7 +4,14 @@ echo ">>> Installing MongoDB" # Get key and add to sources sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10 -echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' | sudo tee /etc/apt/sources.list.d/mongodb.list + +# 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 +else + echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' | sudo tee /etc/apt/sources.list.d/mongodb.list +fi + # Update sudo apt-get update