This repository has been archived by the owner on Mar 18, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathVagrantfile
58 lines (45 loc) · 1.88 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
# -*- mode: ruby -*-
# vi: set ft=ruby :
VAGRANTFILE_API_VERSION = "2"
Vagrant.require_version ">= 1.8.1" # Need a recent Vagrant to work well with Windows 10
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# Virtual hosts used for Devoxx presentation
hosts = [
{ :name => "app1", :address => "10.10.3.20" }, # application server #1
{ :name => "app2", :address => "10.10.3.21", :os=>"windows" }, # application server #2
]
# Host setup template
hosts.each do |params|
config.vm.define "#{ params[:name] }" do |host|
# host.vm.hostname = "#{ params[:name] }-ansible-hawtapp"
memory = 512
if params[:os]=="windows"
host.vm.box = "modernIE/w10-edge"
host.vm.guest = :windows
host.vm.boot_timeout = 500000
host.ssh.username = "IEUser"
host.ssh.password = "Passw0rd!"
host.vm.communicator = "winrm"
# Diable firewall so we can access the box on the assigned private network.
host.vm.provision "shell", inline: 'netsh "advfirewall" "set" "allprofiles" "state" "off"'
memory = 768 # Windows needs a little more memory than linux.
else
host.vm.box = "jimmidyson/centos-7.1"
host.vm.box_version = "= 1.2.6"
host.vm.boot_timeout = 500000
#host.vm.box = "Centos-6.5-minimal-x86_64-20140116"
#host.vm.box_url = "https://github.com/2creatives/vagrant-centos/releases/download/v6.5.3/centos65-x86_64-20140116.box"
#host.vm.provision "shell", inline: "sudo yum -y install python-httplib2" # Required to use 'uri' Ansible module
end
host.vm.network :private_network, ip: "#{ params[:address] }"
host.vm.provider "virtualbox" do |vb|
vb.customize [
"modifyvm", :id,
"--name", "#{ params[:name] }-ansible-hawtapp",
"--memory", memory,
"--cpus", 1,
]
end
end
end
end