forked from HCL-TECH-SOFTWARE/connections-automation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Vagrantfile.componentpack
49 lines (39 loc) · 1.41 KB
/
Vagrantfile.componentpack
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
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
$script = <<-SCRIPT
/usr/bin/cp /etc/hosts /root && \
/usr/bin/sed -ie '/componentpack.internal/d' /etc/hosts && \
/usr/bin/echo '10.172.13.5 componentpack.internal componentpack' >> /etc/hosts
SCRIPT
Vagrant.configure("2") do |config|
config.vm.box = "generic/centos7"
config.vm.provision "shell", inline: $script
config.vm.provider :virtualbox do |v|
v.memory = 10240
v.cpus = 4
end
boxes = [
{ :name => "componentpack.internal", :ip => "10.172.13.5" },
]
# Provision each of the VMs.
boxes.each do |opts|
config.vm.define opts[:name] do |config|
config.vm.hostname = opts[:name]
config.vm.network :private_network, ip: opts[:ip]
# Provision all the VMs in parallel using Ansible after last VM is up.
if opts[:name] == "componentpack.internal"
config.vm.provision "ansible" do |ansible|
ansible.compatibility_mode = "2.0"
ansible.playbook = "playbooks/vagrant/vagrant-all-in-one-componentpack.yml"
ansible.limit = "all"
ansible.become = true
ansible.inventory_path = "environments/examples/vagrant/inventory.ini"
end
end
end
end
end