-
Notifications
You must be signed in to change notification settings - Fork 0
/
Vagrantfile
66 lines (61 loc) · 2.07 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
59
60
61
62
63
64
65
66
Vagrant.configure("2") do |config|
config.vm.provision "file", source: "vagrant", destination: "/home/vagrant/.ssh/id_rsa"
config.vm.provision "file", source: "fdisk.sh", destination: "/home/vagrant/fdisk.sh"
public_key = File.read("vagrant.pub")
config.vm.provision :shell, :inline =>"
echo 'Copying ansible-vm public SSH Keys to the VM'
mkdir -p /home/vagrant/.ssh
chmod 700 /home/vagrant/.ssh
echo '#{public_key}' >> /home/vagrant/.ssh/authorized_keys
chmod -R 600 /home/vagrant/.ssh/authorized_keys
echo 'Host 192.168.*.*' >> /home/vagrant/.ssh/config
echo 'StrictHostKeyChecking no' >> /home/vagrant/.ssh/config
echo 'UserKnownHostsFile /dev/null' >> /home/vagrant/.ssh/config
chmod -R 600 /home/vagrant/.ssh/config
chmod +x /home/vagrant/fdisk.sh
mkdir -p /home/public
/home/vagrant/fdisk.sh
", privileged: true
config.vm.define "master" do |master|
master.vm.box = "centos/8"
master.vm.box_version = "1905.1"
master.vm.hostname = "master"
master.vm.network "public_network",
bridge: "en0: Wi-Fi (Wireless)",
ip: "192.168.0.107"
master.disksize.size = '20GB'
master.vm.provider "virtualbox"
master.vm.provider :virtualbox do |v|
v.memory = 3096
v.cpus = 2
end
end
config.vm.define "slave1" do |slave1|
slave1.vm.box = "centos/8"
slave1.vm.box_version = "1905.1"
slave1.vm.hostname = "slave1"
slave1.vm.network "public_network",
bridge: "en0: Wi-Fi (Wireless)",
ip: "192.168.0.108"
slave1.disksize.size = '20GB'
slave1.vm.provider "virtualbox"
slave1.vm.provider :virtualbox do |v|
v.memory = 8192
v.cpus = 3
end
end
config.vm.define "slave2" do |slave2|
slave2.vm.box = "centos/8"
slave2.vm.box_version = "1905.1"
slave2.vm.hostname = "slave2"
slave2.vm.network "public_network",
bridge: "en0: Wi-Fi (Wireless)",
ip: "192.168.0.109"
slave2.disksize.size = '50GB'
slave2.vm.provider "virtualbox"
slave2.vm.provider :virtualbox do |v|
v.memory = 8192
v.cpus = 3
end
end
end