forked from errordeveloper/kubernetes-ansible-vagrant
-
Notifications
You must be signed in to change notification settings - Fork 11
/
Vagrantfile
32 lines (28 loc) · 950 Bytes
/
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
# -*- mode: ruby -*-
# # vi: set ft=ruby :
Vagrant.configure(2) do |config|
(1..2).each do |i|
config.vm.define "k8s#{i}" do |s|
s.ssh.forward_agent = true
s.vm.box = "ubuntu/xenial64"
s.vm.hostname = "k8s#{i}"
s.vm.provision :shell, path: "scripts/bootstrap_ansible.sh"
if i == 1
s.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /vagrant/ansible/k8s-master.yml -c local"
else
s.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /vagrant/ansible/k8s-worker.yml -c local"
end
s.vm.network "private_network", ip: "172.42.42.#{i}", netmask: "255.255.255.0",
auto_config: true,
virtualbox__intnet: "k8s-net"
s.vm.provider "virtualbox" do |v|
v.name = "k8s#{i}"
v.memory = 2048
v.gui = false
end
end
end
if Vagrant.has_plugin?("vagrant-cachier")
config.cache.scope = :box
end
end