-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVagrantFile
37 lines (33 loc) · 1.17 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
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Configure Github Settings
github_username = "yiluohan1234"
github_repo = "vagrant_hdp_single_node"
github_branch = "main"
github_url = "https://raw.githubusercontent.com/#{github_username}/#{github_repo}/#{github_branch}"
# Configure vm settings
boxes = [
{
:name => "hadoop", :eth1 => "192.168.10.101", :mem => "4096", :cpu => "3"
}
]
Vagrant.configure(2) do |config|
config.vm.box = "centos/7"
config.vm.box_version = "1804.02"
boxes.each do |opts|
config.vm.define opts[:name] do |config|
config.vm.hostname = opts[:name]
config.ssh.insert_key = false
config.vm.provider "virtualbox" do |v|
v.customize ["modifyvm", :id, "--name", opts[:name]]
v.customize ["modifyvm", :id, "--memory", opts[:mem]]
v.customize ["modifyvm", :id, "--cpus", opts[:cpu]]
end
config.vm.network "private_network", ip: opts[:eth1]
end
end
# Software installation and configuration using shell scripts
# config.vm.provision "shell", inline: $init_script
# config.vm.provision "shell", path: "setup.sh"
config.vm.provision "shell", path: "#{github_url}/setup.sh"
end