Skip to content

Instantly share code, notes, and snippets.

@ndlrx
Created October 29, 2018 13:31
Show Gist options
  • Save ndlrx/cee6fdb658c232d7db96725ec4b886dd to your computer and use it in GitHub Desktop.
Save ndlrx/cee6fdb658c232d7db96725ec4b886dd to your computer and use it in GitHub Desktop.
Vagrantfile Multiple vms
# Defines our Vagrant environment
#
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
# create ceph-deploy node
config.vm.define :ceph do |ceph_config|
ceph_config.vm.box = "hakase"
ceph_config.vm.hostname = "mongos"
ceph_config.vm.network :private_network, ip: "10.0.15.10"
ceph_config.vm.provider "virtualbox" do |vb|
vb.memory = "1024"
end
#ceph-deploy_config.vm.provision :shell, path: "bootstrap-ceph-deploy.sh"
end
# create load balancer
config.vm.define :mon do |mon_config|
mon_config.vm.box = "hakase"
mon_config.vm.hostname = "config-server"
mon_config.vm.network :private_network, ip: "10.0.15.11"
mon_config.vm.network "forwarded_port", guest: 80, host: 8080
mon_config.vm.provider "virtualbox" do |vb|
vb.memory = "1024"
end
end
# create some web servers
# https://docs.vagrantup.com/v2/vagrantfile/tips.html
(1..3).each do |i|
config.vm.define "osd#{i}" do |node|
node.vm.box = "hakase"
node.vm.hostname = "mongo#{i}"
node.vm.network :private_network, ip: "10.0.15.2#{i}"
node.vm.network "forwarded_port", guest: 80, host: "808#{i}"
node.vm.provider "virtualbox" do |vb|
vb.memory = "1024"
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment