-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Vagrantfile
57 lines (48 loc) · 1.98 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
################################################################################
# -*- mode: ruby -*-
# vi: set ft=ruby :
################################################################################
require './operations/config/vagrant.rb'
################################################################################
vconfig = load_config([
'./operations/config/project.yml',
'./operations/config/server.yml'
])
################################################################################
Vagrant.configure('2') do |config|
# Box Image
config.vm.box = vconfig['vagrant_box']
# Define VM
config.vm.define vconfig['vagrant_project']
# Set IP and Hostname
config.vm.network :private_network, ip: vconfig['vagrant_ip']
config.vm.hostname = vconfig['vagrant_host']
# SSH Configuartion
config.ssh.insert_key = false
# Sync Folder
config.vm.synced_folder '.', '/nfs', type: 'nfs', mount_options: ['rw', 'vers=3', 'tcp', 'fsc' ,'actimeo=2']
# Sync Bindings
config.bindfs.bind_folder '/nfs', '/site'
config.bindfs.bind_folder '/nfs/operations', '/ops'
# Virtualbox Configuartion
config.vm.provider :virtualbox do |vb|
vb.name = vconfig['vagrant_project']
vb.memory = vconfig['vagrant_mem']
vb.cpus = vconfig['vagrant_cpu']
vb.customize ['modifyvm', :id, '--natdnshostresolver1', 'on']
vb.customize ['modifyvm', :id, '--nictype1', 'virtio' ]
vb.customize ['modifyvm', :id, '--nictype2', 'virtio' ]
vb.customize ['modifyvm', :id, '--ioapic', 'on']
vb.customize ['storagectl', :id, '--name', 'SATA Controller', '--hostiocache', 'on']
end
# Provison the VM with Ansible
config.vm.provision 'ansible_local' do |ansible|
ansible.provisioning_path = '/ops'
ansible.playbook = '/ops/playbooks/provision.yml'
ansible.inventory_path = '/ops/hosts'
ansible.limit = 'local'
ansible.version = 'latest'
ansible.verbose = false
end
end
################################################################################