Rancher-Swarm/Vagrantfile

45 lines
1.4 KiB
Ruby
Raw Normal View History

2015-02-22 03:49:04 +00:00
# -*- mode: ruby -*-
# vi: set ft=ruby :
require_relative 'vagrant_rancheros_guest_plugin.rb'
# To enable rsync folder share change to false
$rsync_folder_disabled = true
2015-08-21 19:49:26 +00:00
$number_of_nodes = 4
$vm_mem = "1024"
$vb_gui = false
2015-02-22 03:49:04 +00:00
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure(2) do |config|
config.vm.box = "rancherio/rancheros"
2015-07-03 08:28:48 +00:00
config.vm.box_version = ">=0.3.3"
(1..$number_of_nodes).each do |i|
2015-08-21 19:49:26 +00:00
hostname = "runner-%02d" % i
hostname = "manager" if i == 4
2015-02-22 03:49:04 +00:00
config.vm.define hostname do |node|
node.vm.provider "virtualbox" do |vb|
vb.memory = $vm_mem
2015-08-21 19:49:26 +00:00
vb.memory = "512" if i == 4
vb.gui = $vb_gui
end
ip = "172.19.8.#{i+100}"
node.vm.network "private_network", ip: ip
2015-07-28 19:35:05 +00:00
node.vm.hostname = hostname
# Disabling compression because OS X has an ancient version of rsync installed.
# Add -z or remove rsync__args below if you have a newer version of rsync on your machine.
node.vm.synced_folder ".", "/opt/rancher", type: "rsync",
rsync__exclude: ".git/", rsync__args: ["--verbose", "--archive", "--delete", "--copy-links"],
disabled: $rsync_folder_disabled
end
end
2015-02-22 03:49:04 +00:00
end