Skip to content

Instantly share code, notes, and snippets.

@ivanilves
Created July 13, 2015 14:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ivanilves/2b073a4057c7a4bd4f02 to your computer and use it in GitHub Desktop.
Save ivanilves/2b073a4057c7a4bd4f02 to your computer and use it in GitHub Desktop.
Castrated OnPremise Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
DEFAULTS = {
:ram => 5120,
:box => 'teambox-enterprise-test-box',
:box_url => "https://s3.amazonaws.com/teambox-enterprise/downloads/teambox-enterprise-test-box.box",
:cpus => 2,
:hostbox_fqdn => 'cortes.ivan'
}
SERVERS = {
:stable => {
:ip => '192.168.124.10',
:provision => { 'shell' => { privileged: false, :inline => "wget -qO- https://f90a622761393c7a6d88aeafd2fc41c783be193d-www.googledrive.com/host/0B3jwiAWnBj90Smd3TExIakVabzQ | BUILD=stable /bin/bash" }
},
:options => {},
},
:wip => {
:ip => '192.168.124.20',
:provision => { 'shell' => { privileged: false, :inline => "wget -qO- https://2c9f28c9bb68fbc12928374111e7e08773bfda03.googledrive.com/host/0B3jwiAWnBj90QlpLb1BFZHBkc2M | /bin/bash" }
},
:options => {},
},
:ivan => {
:ip => '192.168.124.30',
:provision => { 'shell' => { privileged: false, :inline => "wget -qO- https://f90a622761393c7a6d88aeafd2fc41c783be193d-www.googledrive.com/host/0B3jwiAWnBj90Smd3TExIakVabzQ | BUILD=ivan /bin/bash" }
},
:options => {},
},
}
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.ssh.forward_agent = true
config.ssh.username = "vagrant"
config.vm.box = DEFAULTS[:box]
SERVERS.each do |server_name, params|
config.vm.define server_name do |_config|
options = DEFAULTS.merge(params[:options])
config.vm.box_url = options[:box_url]
name = server_name.to_s.gsub('_','-')
_config.vm.host_name = "#{name}.#{DEFAULTS[:hostbox_fqdn]}"
_config.vm.network "private_network",:ip => params[:ip]
# Set some default memory and the name of the server
_config.vm.provider "virtualbox" do |vb|
vb.customize ['modifyvm', :id, '--memory', options[:ram], '--cpus', options[:cpus], '--name', "onprem-#{name}"]
end
params[:provision].each do |type, options|
_config.vm.provision type.to_s, options
end if params[:provision]
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment