Created
March 8, 2018 01:03
-
-
Save d4n13lbc/03ba91db7aa13dfcda5f35682dca501b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
VAGRANTFILE_API_VERSION = "2" | |
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | |
config.ssh.insert_key = false | |
config.vm.define :discoveryserver do |discovery_server| | |
discovery_server.vm.box = "rabbitmq_sensu_v3.0.0" | |
discovery_server.vm.network :private_network, ip: "192.168.33.10" | |
discovery_server.vm.provider :virtualbox do |vb| | |
vb.customize ["modifyvm", :id, "--memory", "512","--cpus", "1", "--name", "discovery_server" ] | |
end | |
discovery_server.vm.provision "shell", inline: <<-SHELL | |
yum install -y wget unzip | |
wget https://releases.hashicorp.com/consul/1.0.0/consul_1.0.0_linux_amd64.zip -P /tmp | |
unzip /tmp/consul_1.0.0_linux_amd64.zip -d /tmp | |
mv /tmp/consul /usr/bin | |
mkdir /etc/consul.d | |
mkdir -p /etc/consul/data | |
adduser consul | |
# passwd consul | |
chown -R consul:consul /etc/consul | |
chown -R consul:consul /etc/consul.d | |
wget https://bootstrap.pypa.io/get-pip.py -P /tmp | |
SHELL | |
end | |
config.vm.define :discoveryclient1 do |discovery_client_1| | |
discovery_client_1.vm.box = "rabbitmq_sensu_v3.0.0" | |
discovery_client_1.vm.network :private_network, ip: "192.168.33.11" | |
discovery_client_1.vm.provider :virtualbox do |vb| | |
vb.customize ["modifyvm", :id, "--memory", "512","--cpus", "1", "--name", "discovery_client-1" ] | |
end | |
discovery_client_1.vm.provision "shell", inline: <<-SHELL | |
yum install -y wget unzip | |
wget https://releases.hashicorp.com/consul/1.0.0/consul_1.0.0_linux_amd64.zip -P /tmp | |
unzip /tmp/consul_1.0.0_linux_amd64.zip -d /tmp | |
mv /tmp/consul /usr/bin | |
mkdir /etc/consul.d | |
mkdir -p /etc/consul/data | |
adduser consul | |
# passwd consul | |
chown -R consul:consul /etc/consul | |
chown -R consul:consul /etc/consul.d | |
# microservice a | |
python /tmp/get-pip.py | |
pip install flask | |
SHELL | |
end | |
config.vm.define :loadbalancer do |load_balancer| | |
load_balancer.vm.box = "rabbitmq_sensu_v3.0.0" | |
load_balancer.vm.network :private_network, ip: "192.168.33.12" | |
load_balancer.vm.provider :virtualbox do |vb| | |
vb.customize ["modifyvm", :id, "--memory", "512","--cpus", "1", "--name", "load_balancer" ] | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment