-
Notifications
You must be signed in to change notification settings - Fork 0
/
Vagrantfile
40 lines (36 loc) · 1.28 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 :
# Every Vagrant development environment requires a box. You can search for
# boxes at https://atlas.hashicorp.com/search.
BOX_IMAGE = "geerlingguy/centos7"
NODE_COUNT = 2
Vagrant.configure("2") do |config|
config.vm.define "master" do |subconfig|
subconfig.vm.box = BOX_IMAGE
subconfig.vm.hostname = "master"
subconfig.vm.network :private_network, ip: "192.168.33.5"
subconfig.vm.provider "virtualbox" do |v|
v.memory = 3076
v.cpus = 2
end
end
(1..NODE_COUNT).each do |i|
config.vm.define "node#{i}" do |subconfig|
subconfig.vm.box = BOX_IMAGE
subconfig.vm.hostname = "node#{i}"
subconfig.vm.network :private_network, ip: "192.168.33.#{i + 5}"
subconfig.vm.provider "virtualbox" do |v|
v.memory = 1024
v.cpus = 2
end
end
end
# Install avahi on all machines
config.vm.provision "file", source: "~/.ssh/id_rsa.pub", destination: "~/.ssh/authorized_keys" # 3
config.ssh.insert_key = false # 1
config.ssh.private_key_path = ['~/.vagrant.d/insecure_private_key', '~/.ssh/id_rsa'] # 2
config.vm.provision "shell", inline: <<-SHELL
yum install -y epel-release
yum install -y open-vm-tools git vim numactl unzip python3 python-pip sysfsutils
SHELL
end