summaryrefslogtreecommitdiffstats
path: root/vagrant/basebuild/Vagrantfile
blob: 3cbf092b32e1d078c9bd2dfc7e812bee20a82743 (plain)
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# -*- mode: ruby -*-
# vi: set ts=2 sw=2 sts=2 et ft=ruby :

Vagrant.configure(2) do |config|
   config.vm.box = "ubuntu/trusty64"

#  config.vm.network "private_network", type: "dhcp"

  config.vm.provider "virtualbox" do |vb|
    vb.memory = "4096"
  end
  config.vm.provider "vmware_fusion" do |fusion,override|
    override.vm.box = "puppetlabs/ubuntu-14.04-64-nocm"
    fusion.vmx["memsize"] = "4096"
  end
  config.vm.provider "vmware_workstation" do |vws,override|
    override.vm.box = "puppetlabs/ubuntu-14.04-64-nocm"
    vws.vmx["memsize"] = "8192"
    vws.vmx["numvcpus"] = "4"
#   To enable workstation GUI
#   vws.gui = "true"
  end

  config.vm.provider :openstack do |os, override|
    override.vm.box = 'dummy'
    os.image = 'Ubuntu 14.04 LTS (2015-11-19) - Agentless'
    config.ssh.username = 'ubuntu'
  end

  config.vm.provision "shell", inline: <<-SHELL

    # Standard update + upgrade dance
    apt-get update
    apt-get upgrade -y

    # Fix the silly notion that /bin/sh should point to dash by pointing it to bash

    sudo update-alternatives --install /bin/sh sh /bin/bash 100

    # Install build tools
    apt-get install -y build-essential autoconf automake bison libssl-dev ccache libtool git dkms debhelper libganglia1-dev libapr1-dev libconfuse-dev

    # Install other stuff
    apt-get install -y --force-yes bridge-utils vim gdb iproute2

    # Install debian packaging tools
    apt-get install -y debhelper dkms

    # Install uio
    apt-get install -y linux-image-extra-`uname -r`

    # Install jdk and maven
    apt-get install -y openjdk-7-jdk
    # $$$ comment out for the moment
    # apt-get install -y --force-yes maven3

    # Load the uio kernel module
    modprobe uio_pci_generic

    # Make sure uio loads at boot time
    echo uio_pci_generic >> /etc/modules

    # Setup for hugepages using upstart so it persists across reboots
    sysctl -w vm.nr_hugepages=1024
    mkdir -p /mnt/huge
    echo "hugetlbfs       /mnt/huge  hugetlbfs       defaults        0 0" >> /etc/fstab
    mount /mnt/huge

  SHELL

  #################
  # FINAL CLEANUP #
  #################

  # set RESEAL to... anything if you want to snap an image of this box
  # not setting the environment variable will cause the system to come
  # up fully and not be in a resealable state
  if ENV['RESEAL']
    config.vm.provision 'shell', path: '../lib/system_reseal.sh'
  end
end