forked from Nickmob/vagrant_selinux
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Vagrantfile
36 lines (35 loc) · 1.24 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
MACHINES = {
:"selinux" => {
:box_name => "almalinux/9",
:box_version => "9.4.20240805",
:cpus => 2,
:memory => 2048
}
}
Vagrant.configure("2") do |config|
MACHINES.each do |boxname, boxconfig|
config.vm.synced_folder ".", "/vagrant", disabled: true
config.vbguest.auto_update = false
config.vm.define boxname do |box|
box.vm.box = boxconfig[:box_name]
box.vm.box_version = boxconfig[:box_version]
box.vm.host_name = boxname.to_s
box.vbguest.installer_options = { allow_kernel_upgrade: true }
box.vm.network "forwarded_port", guest: 4881, host: 4881
box.vm.provider "virtualbox" do |v|
v.memory = boxconfig[:memory]
v.cpus = boxconfig[:cpus]
end
box.vm.provision "shell", inline: <<-SHELL
yum install -y epel-release
yum install -y nginx
yum install -y setroubleshoot-server selinux-policy-mls setools-console policycoreutils-python-utils policycoreutils-newrole
sed -ie 's/:80/:4881/g' /etc/nginx/nginx.conf
sed -i 's/listen 80;/listen 4881;/' /etc/nginx/nginx.conf
systemctl start nginx
systemctl status nginx
ss -tlpn | grep 4881
SHELL
end
end
end