-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVagrantfile
57 lines (52 loc) · 2.01 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
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# General Vagrant VM configuration
config.vm.box = "geerlingguy/centos8"
# disable the automatic insertion of SSH keys into the virtual machine.
config.ssh.insert_key = false
config.vm.synced_folder ".", "/vagrant", disabled: true
config.vm.provider :virtualbox do |v|
v.memory = 512
# create a master VM before creating the linked clones
v.linked_clone = true
end
# Application Server 1
config.vm.define "app1" do |app|
app.vm.hostname = "orc-app1.test"
app.vm.synced_folder ".", "/vagrant", disabled: true
app.vm.network :private_network, ip: "192.168.56.4"
end
# Application Server 2
config.vm.define "app2" do |app|
app.vm.hostname = "orc-app2.test"
app.vm.synced_folder ".", "/vagrant", disabled: true
app.vm.network :private_network, ip: "192.168.56.5"
end
# Database server
config.vm.define "db" do |db|
db.vm.hostname = "orc-db.test"
db.vm.synced_folder ".", "/vagrant", disabled: true
db.vm.network :private_network, ip: "192.168.56.6"
end
# Controller Server 1, for windows w/o wls2 use
config.vm.define "main" do |app|
app.vm.box = "geerlingguy/ubuntu2004"
app.ssh.insert_key = true
app.vm.provider :virtualbox do |v|
v.memory = 512
# create a master VM before creating the linked clones
v.linked_clone = false
end
app.vm.hostname = "orc-main"
app.vm.synced_folder ".", "/vagrant", disabled: false
app.vm.network :private_network, ip: "192.168.56.3"
app.vm.provision "shell", inline: <<-SHELL
apt install ansible -y
cp /vagrant/* /home/vagrant/
# ls -lah /home/vagrant/.ssh/
ssh-keygen -t rsa -b 4096 -N '' -f '/home/vagrant/.ssh/id_rsa'
# to use the 'ssh' connection type with passwords
apt install sshpass -y
SHELL
end
end