-
Notifications
You must be signed in to change notification settings - Fork 1
/
Vagrantfile
67 lines (64 loc) · 2.28 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
$script = <<-SCRIPT
cat <<EOF | sudo tee /etc/sysctl.d/k8s.conf
net.bridge.bridge-nf-call-ip6tables = 1
net.bridge.bridge-nf-call-iptables = 1
EOF
mkdir /etc/docker/
echo '
{
"exec-opts": ["native.cgroupdriver=systemd"]
}
' > /etc/docker/daemon.json
sudo sysctl --system
sudo apt-get update
sudo apt-get install -yqq \
apt-transport-https \
ca-certificates \
curl \
gnupg \
lsb-release
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
echo \
"deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
sudo apt-get install -yqq docker-ce docker-ce-cli containerd.io
sudo apt-get update && sudo apt-get install -y apt-transport-https curl
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -
curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
echo '
/dev/mapper/vagrant--vg-root / ext4 errors=remount-ro 0 1
/vagrant /vagrant vboxsf uid=1000,gid=1000,nofail 0 0
' > /etc/fstab
swapoff -a
wget https://github.com/cloudflare/cfssl/releases/download/v1.6.1/cfssljson_1.6.1_linux_amd64
mv cfssljson_1.6.1_linux_amd64 /bin/cfssljson
chmod +x /bin/cfssljson
wget https://github.com/cloudflare/cfssl/releases/download/v1.6.1/cfssl_1.6.1_linux_amd64
mv cfssl_1.6.1_linux_amd64 /bin/cfssl
chmod +x /bin/cfssl
echo '
127.0.0.1 localhost
127.0.1.1 vagrant.vm vagrant
# The following lines are desirable for IPv6 capable hosts
::1 localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
10.20.30.10 devops
' > /etc/hosts
SCRIPT
Vagrant.configure("2") do |config|
config.vm.provision "shell", inline: $script
config.vm.box = "bento/ubuntu-22.04"
config.vm.define "devops" do |devops|
devops.vm.hostname = "devops"
devops.vm.network "private_network", ip: "10.20.30.10"
devops.vm.provider "virtualbox" do |v|
v.memory = 12000
v.cpus = 2
v.name = "devops"
end
end
end