Skip to content

Instantly share code, notes, and snippets.

@cgillespie
Last active November 30, 2016 00:32
Show Gist options
  • Save cgillespie/332d39b492fd28fbd58bca9fa70704cd to your computer and use it in GitHub Desktop.
Save cgillespie/332d39b492fd28fbd58bca9fa70704cd to your computer and use it in GitHub Desktop.
apt-get install openjdk-8-jre-headless
wget http://dynamodb-local.s3-website-us-west-2.amazonaws.com/dynamodb_local_latest.tar.gz
mkdir /opt/dynamodb
tar -xf dynamodb_local_latest.tar.gz -C /opt/dynamodb
cat > /etc/systemd/system/dynamodb.service << EOL
[Unit]
Description=DynamoDB
[Service]
ExecStart=/bin/sh -ec "cd /opt/dynamodb; java -Djava.library.path=./DynamoDBLocal_lib -jar DynamoDBLocal.jar -sharedDb"
EOL
systemctl enable dynamodb
systemctl start dynamodb
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 0C49F3730359A14518585931BC711F9BA15703C6
echo "deb http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.4.list
apt-get update
apt-get install -y mongodb-org
cat > /etc/systemd/system/mongod.service << EOL
[Unit]
Description=High-performance, schema-free document-oriented database
After=network.target
Documentation=https://docs.mongodb.org/manual
[Service]
User=mongodb
Group=mongodb
ExecStart=/usr/bin/mongod --quiet --config /etc/mongod.conf
[Install]
WantedBy=multi-user.target
EOL
systemctl enable mongod
systemctl start mongod

Shell scripts for adding databases to an ubuntu/xenial64 box.

Add the following to the Vagrantfile to add a database.

config.vm.provision "shell", path: "./script-name.sh"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment