forked from bottlelee/ansible-elk-deploy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Vagrantfile.bak
60 lines (52 loc) · 1.68 KB
/
Vagrantfile.bak
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
# -*- mode: ruby -*-
# vi: set ft=ruby :
ENV["LC_ALL"] = "en_US.UTF-8"
Vagrant.require_version ">= 2.0.0"
$instances = 11
$bond_interface = "enp0s8"
Vagrant.configure("2") do |config|
# always use Vagrants insecure key
config.ssh.insert_key = false
config.vm.box = "ubuntu/xenial64"
config.vm.box_check_update = false
# plugin conflict
if Vagrant.has_plugin?("vagrant-vbguest") then
config.vbguest.auto_update = false
end
(1..$instances).each do |instance_id|
if instance_id <=3
put vm_name = "es-master-#{instance_id}"
else
put vm_name = "elk-#{instance_id}"
end
config.vm.define vm_name do |config|
config.vm.hostname = vm_name
config.vm.network "private_network", type: "dhcp"
config.vm.provider "virtualbox" do |vb|
vb.memory = "2048"
vb.cpus = "2"
vb.name = vm_name
end
if instance_id == $instances
config.vm.provision "ansible" do |ansible|
ansible.extra_vars = {
ansible_python_interpreter: "/usr/bin/python3",
bond_interface: $bond_interface
}
ansible.groups = {
"elasticMasterNode" => ["elk-[1:3]"],
"elasticHotNode" => ["elk-[4:6]"],
"elasticWarmNode" => ["elk-[7:8]"],
"elasticIngestNode" => ["elk-9"],
"kibana" => ["elk-10"],
"logstash" => ["elk-11"],
"elasticsearch:children" => ["elasticMasterNode","elasticHotNode","elasticWarmNode"],
"elasticDataNode:children" => ["elasticHotNode","elasticWarmNode"]
}
ansible.limit = "all"
ansible.playbook = "vagrant_playbook.yml"
end
end
end
end
end