-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathVagrantfile
More file actions
37 lines (32 loc) · 1.14 KB
/
Copy pathVagrantfile
File metadata and controls
37 lines (32 loc) · 1.14 KB
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 :
$script = <<-SCRIPT
yum install -y curl policycoreutils-python openssh-server
systemctl enable sshd
systemctl start sshd
firewall-cmd --permanent --add-service=http
systemctl reload firewalld
yum install postfix
systemctl enable postfix
systemctl start postfix
curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ee/script.rpm.sh | bash
IP=`nmcli d show eth1 | grep -i ip4.address | awk '{ print $2 }' | awk 'BEGIN { FS = "/" } ; { print $1 }'`
echo $IP
GITLAB_DOMAIN=$IP.nip.io
echo $GITLAB_DOMAIN
EXTERNAL_URL="http://$GITLAB_DOMAIN" yum install -y gitlab-ee
SCRIPT
Vagrant.configure("2") do |config|
config.vm.define "centos-gitlab" do |centos|
centos.vm.box = "centos/7"
centos.vm.hostname = "centos-gitlab.localdomain"
centos.vm.network "private_network", type: "dhcp"
centos.vm.provision "shell", inline: $script
centos.vm.provider "virtualbox" do |v|
v.memory = 2048
v.cpus = 2
end
centos.vm.network "forwarded_port", guest: 80, host: 80, host_ip: "127.0.0.1"
centos.vm.network "forwarded_port", guest: 443, host: 443, host_ip: "127.0.0.1"
end
end