Created
August 17, 2016 19:22
-
-
Save v1k0d3n/dfb36a1d44b9390dad199b71ae770402 to your computer and use it in GitHub Desktop.
This file contains hidden or 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/sytax version. Don’t touch unless you know what you’re doing! | |
VAGRANTFILE_API_VERSION = "2" | |
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | |
# Variable Definitions: | |
# ------------------------ | |
# | |
ETD_COUNT = 2 | |
WORKER_COUNT = 3 | |
MASTER_COUNT = 2 | |
# Guest Definitions: | |
# ------------------------ | |
# | |
# Etcd Definition(s): START | |
for e in 1..ETD_COUNT | |
config.vm.define vm_name = "etcd#{e}" do |etcd_config| | |
etcd_config.vm.box = "ubuntu/xenial64" | |
etcd_config.vm.hostname = "etcd#{e}" | |
# NETWORK-SETTINGS: eth1 configured in the 192.168.236.0/24 network | |
etcd_config.vm.network "private_network", ip: "192.168.236.1#{e}" | |
etcd_config.vm.provider "virtualbox" do |vb| | |
etcd_config.vm.provision :ansible do |ansible| | |
# ansible.limit = "all" | |
ansible.playbook = "provisioning/vagrant-build.yml" | |
end | |
vb.name = "roto_etcd#{e}" | |
vb.customize ["modifyvm", :id, "--memory", "512"] | |
vb.customize ["modifyvm", :id, "--cpus", "1"] | |
end | |
end | |
end | |
# Master Definition(s): START | |
for m in 1..MASTER_COUNT | |
config.vm.define vm_name = "master#{m}" do |master_config| | |
master_config.vm.box = "ubuntu/xenial64" | |
master_config.vm.hostname = "master#{m}" | |
# NETWORK-SETTINGS: eth1 configured in the 192.168.236.0/24 network | |
master_config.vm.network "private_network", ip: "192.168.236.2 {m}" | |
master_config.vm.provider "virtualbox" do |vb| | |
master_config.vm.provision :ansible do |ansible| | |
# ansible.limit = "all" | |
ansible.playbook = "provisioning/vagrant-build.yml" | |
end | |
vb.name = "roto_master#{m}" | |
vb.customize ["modifyvm", :id, "--memory", "512"] | |
vb.customize ["modifyvm", :id, "--cpus", "1"] | |
end | |
end | |
end | |
# Worker Definition(s): START | |
for w in 1..WORKER_COUNT | |
config.vm.define vm_name = "worker#{w}" do |worker_config| | |
worker_config.vm.box = "ubuntu/xenial64" | |
worker_config.vm.hostname = "worker#{w}" | |
# NETWORK-SETTINGS: eth1 configured in the 192.168.236.0/24 network | |
worker_config.vm.network "private_network", ip: "192.168.236.3#{w}" | |
worker_config.vm.provider "virtualbox" do |vb| | |
worker_config.vm.provision :ansible do |ansible| | |
# ansible.limit = "all" | |
ansible.playbook = "provisioning/vagrant-build.yml" | |
end | |
vb.name = "roto_worker#{w}" | |
vb.customize ["modifyvm", :id, "--memory", "512"] | |
vb.customize ["modifyvm", :id, "--cpus", "1"] | |
end | |
end | |
end | |
end |
INFO interface: error: A VirtualBox machine with the name 'ubuntu-xenial-16.04-cloudimg' already exists.
Please use another name or delete the machine with the existing
name, and try again.
A VirtualBox machine with the name 'ubuntu-xenial-16.04-cloudimg' already exists.
Please use another name or delete the machine with the existing
name, and try again.
INFO interface: Machine: error-exit ["Vagrant::Errors::VMNameExists", "A VirtualBox machine with the name 'ubuntu-xenial-16.04-cloudimg' already exists.\nPlease use another name or delete the machine with the existing\nname, and try again."]
bjozsa@megatron ~/p/g/v/astra-vagrant-demo ❯❯❯
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/sytax version. Don’t touch unless you know what you’re doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# Variable Definitions:
# ------------------------
#
ETD_COUNT = 2
WORKER_COUNT = 3
MASTER_COUNT = 2
# Guest Definitions:
# ------------------------
#
# Etcd Definition(s): START
ETD_COUNT.times do |e|
config.vm.define vm_name = "etcd#{e}" do |etcd_config|
etcd_config.vm.box = "ubuntu/xenial64"
etcd_config.vm.hostname = "etcd#{e}"
# NETWORK-SETTINGS: eth1 configured in the 192.168.236.0/24 network
etcd_config.vm.network "private_network", ip: "192.168.236.1#{e}"
etcd_config.vm.provider "virtualbox" do |vb|
vb.name = "roto_etcd#{e}"
vb.customize ["modifyvm", :id, "--memory", "512"]
vb.customize ["modifyvm", :id, "--cpus", "1"]
end
end
end
end
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
bjozsa@megatron ~/p/g/v/astra-vagrant-demo ❯❯❯ vagrant status
Current machine states:
etcd1 not created (virtualbox)
etcd2 not created (virtualbox)
master1 not created (virtualbox)
master2 not created (virtualbox)
worker1 not created (virtualbox)
worker2 not created (virtualbox)
worker3 not created (virtualbox)
This environment represents multiple VMs. The VMs are all listed
above with their current state. For more information about a specific
VM, run
vagrant status NAME
.bjozsa@megatron ~/p/g/v/astra-vagrant-demo ❯❯❯