Fix several issues in Vagrant provisioning (#1046)

* Fixes to Vagrantfile
bulk-clear-sessions
Joshua Dugie 2019-09-08 17:04:48 +00:00 committed by Kevin Chung
parent 7a7595cf03
commit cee6fe3593
3 changed files with 18 additions and 9 deletions

15
Vagrantfile vendored
View File

@ -1,9 +1,18 @@
# -*- mode: ruby -*- # -*- mode: ruby -*-
# vi: set ft=ruby : # vi: set ft=ruby :
# Install tmux and virtualenv to support development # Install tmux, virtualenv, and mariadb-server to support development
$preProvision= <<SCRIPT $preProvision= <<SCRIPT
sudo apt-get install tmux virtualenvwrapper mariadb-server -y # Prevent attempt to access stdin, causing dpkg-reconfigure error output
export DEBIAN_FRONTEND=noninteractive
apt-get install -y tmux virtualenvwrapper
# As per instructions at https://downloads.mariadb.org/mariadb/repositories
apt-get install -y software-properties-common
apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xF1656F24C74CD1D8 2>&1
add-apt-repository -y 'deb [arch=amd64,arm64,i386,ppc64el] http://mirror.lstn.net/mariadb/repo/10.4/ubuntu xenial main'
apt-get update
apt-get install -y mariadb-server
SCRIPT SCRIPT
# Wrap provisioning script with a virutalenv for pip packages # Wrap provisioning script with a virutalenv for pip packages
@ -59,6 +68,6 @@ Vagrant.configure("2") do |config|
run: "always" run: "always"
# Install docker (convenience) # Install docker (convenience)
config.vm.provision "shell", path: "scripts/install_docker_ubuntu.sh" config.vm.provision "shell", path: "scripts/install_docker.sh", privileged: false
end end

View File

@ -1,4 +1,4 @@
#!/bin/sh #!/bin/sh
sudo apt-get update sudo apt-get update
sudo apt-get install build-essential python-dev python-pip libffi-dev -y sudo DEBIAN_FRONTEND=noninteractive apt-get install -y build-essential python-dev python-pip libffi-dev
pip install -r requirements.txt pip install -r requirements.txt

View File

@ -4,8 +4,8 @@
# per: https://docs.docker.com/engine/installation/linux/debian/#install-docker-ce # per: https://docs.docker.com/engine/installation/linux/debian/#install-docker-ce
# Install packages to allow apt to use a repository over HTTPS # Install packages to allow apt to use a repository over HTTPS
sudo apt-get install -y \ sudo DEBIAN_FRONTEND=noninteractive apt-get install -y \
python-pip python-pip \
apt-transport-https \ apt-transport-https \
ca-certificates \ ca-certificates \
curl \ curl \
@ -25,14 +25,14 @@ sudo add-apt-repository \
sudo apt-get update sudo apt-get update
# Install the latest version of Docker # Install the latest version of Docker
sudo apt-get install -y docker-ce sudo DEBIAN_FRONTEND=noninteractive apt-get install -y docker-ce
# Add user to the docker group # Add user to the docker group
# Warning: The docker group grants privileges equivalent to the root user. # Warning: The docker group grants privileges equivalent to the root user.
sudo usermod -aG docker ubuntu sudo usermod -aG docker ${USER}
# Configure Docker to start on boot # Configure Docker to start on boot
sudo systemctl enable docker sudo systemctl enable docker
# Install docker-compose # Install docker-compose
sudo pip install docker-compose pip install docker-compose