-
Notifications
You must be signed in to change notification settings - Fork 26
/
Copy pathVagrantfile
63 lines (53 loc) · 3.02 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
#####################################################################################
# Vagrant Development Environment for Employee Scheduling application. #
# #
# Author: Martin Micunda #
#-----------------------------------------------------------------------------------#
# Prerequisites: Virtualbox, Vagrant, Ansible #
# Usage: command 'vagrant up' in the folder of the Vagrantfile #
#####################################################################################
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
# This Vagrant environment requires Vagrant 1.7.0 or higher.
Vagrant.require_version ">= 1.7.0"
unless Vagrant.has_plugin?("vagrant-hostmanager")
raise 'Vagrant-hostmanager is not installed! Please run `vagrant plugin install vagrant-hostmanager` before continuing`.'
end
#####################################################################################
# VAGRANT MAGIC BEGINS HERE #
#-----------------------------------------------------------------------------------#
# For full documentation on vagrant please visit www.vagrantup.com! #
#####################################################################################
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# Configure hostmanager
config.hostmanager.enabled = true
config.hostmanager.manage_host = true
config.hostmanager.ignore_private_ip = false
config.hostmanager.include_offline = true
config.hostmanager.aliases = ["www.employee-scheduling.local", "employee-scheduling.local"]
# Set up SSH agent forwarding
config.ssh.forward_agent = true
# Specify the base box
config.vm.box = "ubuntu/trusty64"
config.vm.hostname = "employee-scheduling"
config.vm.network "private_network", ip: "192.168.33.10"
config.vm.synced_folder "./env", "/home/vagrant/env"
config.vm.synced_folder "./api", "/home/vagrant/api"
config.vm.synced_folder "./ui", "/home/vagrant/ui"
config.vm.synced_folder "./db", "/home/vagrant/db"
# Provision the VirtualBoxes with Ansible
config.vm.provision "ansible" do |ansible|
# ansible-playbook -i .vagrant/provisioners/ansible/inventory/vagrant_ansible_inventory --private-key=.vagrant/machines/default/virtualbox/private_key -u vagrant ansible/development.yml
ansible.playbook = "ansible/development.yml"
ansible.raw_arguments = ['-v']
end
# Configure VM settings for servers running in VirtualBox
config.vm.provider "virtualbox" do |vb|
# this is the name in the VirtualBox Manager UI
vb.name = "employee-scheduling-dev"
# set the system memory for the virtual machine
vb.memory = 2048
# number of Physical CPUs to allocate
vb.cpus = 2
end
end