Skip to content

Instantly share code, notes, and snippets.

@ipepe
Created February 10, 2017 07:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ipepe/530e9f2cd8665c9a6062f23064135582 to your computer and use it in GitHub Desktop.
Save ipepe/530e9f2cd8665c9a6062f23064135582 to your computer and use it in GitHub Desktop.
Test out installation script
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure(2) do |config|
config.vm.box = "ubuntu/xenial64"
# config.vm.network "forwarded_port", guest: 80, host: 8282 # WebDAV
config.vm.provider "virtualbox" do |vb|
vb.memory = "1024"
end
config.ssh.forward_agent = true
config.vm.provision "shell", inline: <<-SHELL
sudo su
apt-get update
apt-get upgrade -y
useradd webapp
usermod -a -G admin webapp
echo deb http://apt.postgresql.org/pub/repos/apt/ xenial-pgdg main > /etc/apt/sources.list.d/pgdg.list
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
apt-get update
apt-get install -y postgresql-client-9.6 postgresql-9.6 postgresql-contrib-9.6 libpq-dev postgresql-server-dev-9.6
sudo -u postgres createuser -s webapp
SHELL
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment