-
Notifications
You must be signed in to change notification settings - Fork 5
/
Vagrantfile
32 lines (27 loc) · 898 Bytes
/
Vagrantfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# -*- mode: ruby -*-
# vi: set ft=ruby :
$ansible = <<EOF
PRE=$(date +%s)
export DEBIAN_FRONTEND=noninteractive
#Use DK archives
sudo perl -pi -e 's/us.archive/dk.archive/g' /etc/apt/sources.list
#Install packages
cd /vagrant
sudo -E apt -y update
sudo -E apt -y install python-pip
sudo -E pip install ansible
ansible-galaxy install RobertLarsen.workshop
ansible-playbook -i /home/vagrant/.ansible/roles/RobertLarsen.workshop/tests/inventory /home/vagrant/.ansible/roles/RobertLarsen.workshop/tests/test.yml
POST=$(date +%s)
echo "Installation took "$((POST-PRE))" seconds"
EOF
Vagrant.configure(2) do |config|
config.vm.box = "bento/ubuntu-16.04"
config.vm.provider "virtualbox" do |v|
v.memory = 2048
end
config.vm.provider "vmware_workstation" do |v|
v.vmx['memsize'] = '2048'
end
config.vm.provision "shell", inline: $ansible, privileged: false
end