-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathVagrantfile
60 lines (48 loc) · 1.94 KB
/
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
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
# -*- mode: ruby -*-
# vi: set ft=ruby :
def on_a_fort
fort_response = Net::HTTP.get_response(URI('http://files.fort/'))
fort_response.is_a?(Net::HTTPSuccess)
rescue
false
end
Vagrant.configure(2) do |config|
config.vm.box = "chef/ubuntu-14.04"
if on_a_fort
config.vm.box_url = "http://files.fort/boxes/chef-ubuntu-14.04.box"
config.vm.box_check_update = false
config.vm.provision "shell", inline: <<-SHELL
sudo sed -ibackup s,us.archive.ubuntu.com/ubuntu,apt.fort,g \
/etc/apt/sources.list
SHELL
end
config.ssh.forward_agent = true
config.vm.provision "shell", inline: <<-SHELL
sudo apt-get update
# required for development on the VM
sudo apt-get install -y git
sudo apt-get install -y vim
sudo apt-get install -y virtualbox-guest-additions-iso
# packages required for the application
sudo apt-get install -y libmagickwand-dev libcaca-dev
sudo apt-get install -y libncurses5-dev libncursesw5-dev
sudo apt-get install -y postgresql libpq-dev
sudo apt-get install -y liblua5.2-dev
sudo apt-get install -y libcurl4-openssl-dev
# packages required for dev & testing
sudo apt-get install -y check
sudo apt-get install -y python-virtualenv python-dev tmux
sudo apt-get install -y clang-format-3.6
# To rename clang-format to what the Makefile expects
sudo update-alternatives --install /usr/bin/clang-format clang-format /usr/bin/clang-format-3.6 10
# We need our config file which allows passwordless
# connections from bugle and vagrant users
echo "Copying our pg_hba.conf..."
sudo cp /etc/postgresql/9.3/main/pg_hba.conf /etc/postgresql/9.3/main/pg_hba.conf.backup
sudo cp /vagrant/vagrant_files/pg_hba.conf /etc/postgresql/9.3/main/pg_hba.conf
echo "Restarting postgres to take advantage of new config..."
sudo service postgresql restart
echo "Adding a vagrant superuser..."
createuser -U postgres -s vagrant
SHELL
end