This repository has been archived by the owner on Oct 7, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 15
/
Vagrantfile
98 lines (87 loc) · 4.04 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
Vagrant.configure(2) do |config|
config.vm.box = 'ubuntu/trusty32'
config.vm.hostname = 'casebox.org'
config.vm.network 'private_network', ip: '192.168.33.3'
config.vm.synced_folder '.', '/vagrant', disabled: true
config.vm.synced_folder './provision', '/var/provision', :nfs => { :mount_options => ['fmode=666'] }
config.ssh.forward_agent = true
config.vm.provider 'virtualbox' do |vb|
vb.name = 'casebox'
vb.memory = '2048'
vb.customize ['modifyvm', :id, '--natdnshostresolver1', 'on']
vb.customize ['modifyvm', :id, '--natdnsproxy1', 'on']
end
if Vagrant.has_plugin?('vagrant-vbguest') then
config.vbguest.auto_update = false
end
config.vm.provision 'shell', inline: <<-SHELL, privileged: true
echo "================================================================================";
echo "Installing common software (ansible, git, nano, wget, curl etc.)...";
echo "================================================================================";
chmod +x /var/provision/bash/preinstall.sh
source /var/provision/bash/preinstall.sh
SHELL
config.vm.provision 'shell', inline: <<-SHELL, privileged: false
echo "================================================================================";
echo "Installing (core software) Nginx, PHP, MySQL, LibreOffice etc...";
echo "================================================================================";
ansible-playbook -i "localhost," -c local /var/provision/ansible/default.yml
SHELL
config.vm.provision 'shell', inline: <<-SHELL, privileged: false
echo "================================================================================";
echo "Installing Casebox Admin UI...";
echo "================================================================================";
ansible-playbook -i "localhost," -c local /var/provision/ansible/dashboard.yml
SHELL
config.vm.provision 'shell', run: 'always', inline: <<-SHELL, privileged: false
echo "================================================================================";
echo "Starting Casebox Admin UI services...";
echo "================================================================================";
ansible-playbook -i "localhost," -c local /var/provision/ansible/services.yml
SHELL
config.vm.provision 'shell', run: 'always', inline: <<-SHELL, privileged: false
if [ -f "/home/vagrant/.reload" ]; then
echo "================================================================================";
echo " ";
echo " ";
echo " ";
echo " ";
echo " ";
echo " ";
echo " ";
echo " ";
echo "In order to apply software and security configurations,";
echo "please run command: vagrant reload";
echo " ";
echo " ";
echo " ";
echo " ";
echo " ";
echo " ";
echo " ";
echo " ";
echo "================================================================================";
rm /home/vagrant/.reload
else
echo "================================================================================";
echo " ";
echo " ";
echo " ";
echo " ";
echo " ";
echo " ";
echo " ";
echo " ";
echo "Launch Casebox Admin UI: http://192.168.33.3:8000";
echo " ";
echo " ";
echo " ";
echo " ";
echo " ";
echo " ";
echo " ";
echo " ";
echo "================================================================================";
fi
SHELL
end