Skip to content

Instantly share code, notes, and snippets.

@nicopaez
Created May 3, 2018 13:33
Show Gist options
  • Save nicopaez/526b9a4393c156356b12b81c4847cfc7 to your computer and use it in GitHub Desktop.
Save nicopaez/526b9a4393c156356b12b81c4847cfc7 to your computer and use it in GitHub Desktop.
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure(2) do |config|
config.vm.box = "ubuntu/xenial64"
config.vm.network "forwarded_port", guest: 80, host: 8080
config.vm.network "forwarded_port", guest: 8080, host: 8090
config.vm.network "forwarded_port", guest: 4567, host: 4567
config.vm.network "forwarded_port", guest: 9000, host: 9000
config.vm.provider "virtualbox" do |vb|
vb.memory = "2048"
end
config.vm.provision "shell", inline: <<-SHELL
echo "I am provisioning..."
# this is for enabling password login with credentials vagrant/vagrant
echo "vagrant:vagrant" | sudo chpasswd
sed -i -e 's/PasswordAuthentication no/PasswordAuthentication yes/' /etc/ssh/sshd_config
# install ansible and nginx
sudo apt-get update
sudo apt-get install -y software-properties-common
sudo apt-add-repository ppa:ansible/ansible
sudo apt-get update
sudo apt-get install -y ansible
sudo apt-get install -y nginx
# install docker
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo apt-get update
apt-cache policy docker-ce
sudo apt-get install -y docker-ce
sudo usermod -aG docker vagrant
docker pull jenkins
docker pull ruby:2.2.0
# install oc tools
wget https://github.com/openshift/origin/releases/download/v1.5.1/openshift-origin-client-tools-v1.5.1-7b451fc-linux-64bit.tar.gz
tar -xvf openshift-origin-client-tools-v1.5.1-7b451fc-linux-64bit.tar.gz
mv openshift-origin-client-tools-v1.5.1-7b451fc-linux-64bit oc-tool
echo "export PATH=/home/vagrant/oc-tool:$PATH" >> .bashrc
# write metadata
echo "v4.0.0" > /etc/box_version.txt
date > /etc/vagrant_provisioned_at.txt
SHELL
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment