-
Notifications
You must be signed in to change notification settings - Fork 4
/
Vagrantfile
40 lines (33 loc) · 1.21 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
# -*- mode: ruby -*-
# vi: set ft=ruby :
require_relative '.vagrant-file' if File.exists?('.vagrant-file.rb')
Vagrant.configure('2') do |config|
config.vm.box = "ubuntu/trusty64"
config.vm.network "private_network", type: "dhcp"
config.vm.synced_folder ".", "/vagrant", disabled: true # only ansible-vm mounts
config.ssh.insert_key = false
# use vagrant-hostmanager plugin
# vagrant plugin install vagrant-hostmanager
config.hostmanager.enabled = true
config.hostmanager.ip_resolver = proc do |vm, resolving_vm|
if vm.id
`VBoxManage guestproperty get #{vm.id} "/VirtualBox/GuestInfo/Net/1/V4/IP"`.split()[1]
end
end
config.vm.define "itedd-vm" do |itedd|
itedd.vm.hostname = "itedd-vm"
# forwarded ports
itedd.vm.network "forwarded_port", guest: 80, host: 8081 # http
# make machine faster
itedd.vm.provider "virtualbox" do |v|
v.memory = 1024
v.cpus = 2
end
end
config.vm.define "ansible-vm", primary: true do |ansible|
ansible.vm.hostname = "ansible-vm"
ansible.vm.synced_folder ".", "/vagrant", :mount_options => ["fmode=666"]
ansible.ssh.forward_agent = true
customize_ansible_vm(ansible) if defined? customize_ansible_vm
end
end