forked from bashbomb/VWS_vagrant_script
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVagrantfile
90 lines (82 loc) · 2.91 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
Vagrant.configure("2") do |config|
# All server set
config.vm.box = "rockylinux/8"
config.vm.box_check_update = true
# Create cent1
config.vm.define "cent1" do |cent1|
cent1.vm.hostname = "cent1"
cent1.vm.network "private_network", ip: "172.18.1.91"
cent1.vm.network "private_network", ip: "10.18.1.91"
cent1.vm.provider "virtualbox" do |v|
v.name = "cent1"
v.memory = 1024
v.cpus = 2
v.linked_clone = true
v.gui = false
end
cent1.vm.provision "file", source: ".", destination: "/tmp/vagrant"
cent1.vm.provision "shell", inline: <<-SHELL
sudo mv /tmp/vagrant /vagrant
sudo dnf -y install dnf-utils
sudo dnf -y install nano vim git net-tools tar binutils psmisc wget sysstat dialog epel-release
sudo dnf -y install stress
sudo dnf -y install nginx
SHELL
cent1.vm.provision "shell", path: "SHELL/init.sh"
end
# Create cent2
config.vm.define "cent2" do |cent2|
cent2.vm.hostname = "cent2"
cent2.vm.network "private_network", ip: "172.18.1.92"
cent2.vm.network "private_network", ip: "10.18.1.92"
cent2.vm.provider "virtualbox" do |v|
v.name = "cent2"
v.memory = 1024
v.cpus = 2
v.linked_clone = true
v.gui = false
end
cent2.vm.provision "file", source: ".", destination: "/tmp/vagrant"
cent2.vm.provision "shell", inline: <<-SHELL
mv /tmp/vagrant /vagrant
cat << EOF >| /etc/yum.repos.d/MariaDB.repo
#MariaDB 10.4 CentOS repository list
#http://downloads.mariadb.org/mariadb/repositories/
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.4/centos8-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
EOF
sudo dnf -y install dnf-utils
sudo dnf -y install nano vim git net-tools tar binutils psmisc wget sysstat dialog epel-release
sudo dnf -y install boost-program-options stress
sudo dnf -y install mariadb-server --disablerepo=AppStream
sudo dnf -y install mariadb-client --disablerepo=AppStream
sudo dnf -y install mariadb-backup --disablerepo=AppStream
SHELL
cent2.vm.provision "shell", path: "SHELL/init.sh"
end
# Create cent3
config.vm.define "cent3" do |cent3|
cent3.vm.hostname = "cent3"
cent3.vm.network "private_network", ip: "172.18.1.93"
cent3.vm.network "private_network", ip: "10.18.1.93"
cent3.vm.provider "virtualbox" do |v|
v.name = "cent3"
v.memory = 1024
v.cpus = 2
v.linked_clone = true
v.gui = false
end
cent3.vm.provision "file", source: ".", destination: "/tmp/vagrant"
cent3.vm.provision "shell", inline: <<-SHELL
mv /tmp/vagrant /vagrant
sudo mkdir /nfs
sudo dnf -y install dnf-utils
sudo dnf -y install nano vim git net-tools tar binutils psmisc wget sysstat dialog epel-release
sudo dnf -y install stress
SHELL
cent3.vm.provision "shell", path: "SHELL/init.sh"
end
end