Skip to content

Instantly share code, notes, and snippets.

@ssmythe
Created February 23, 2016 18:25
Show Gist options
  • Save ssmythe/e55c2ea0f60de5123a2b to your computer and use it in GitHub Desktop.
Save ssmythe/e55c2ea0f60de5123a2b to your computer and use it in GitHub Desktop.
Vagrantfile to create Nexus on CentOS6
VAGRANTFILE_API_VERSION = "2"
BRIDGE = 'en3: Thunderbolt Ethernet'
CENTOS67_BOX_URL = 'http://boxes.local.tld/virtualbox/updated_centos_6.7_20160215.box'
CENTOS67_BOX_NAME = 'updated/centos-6.7'
INSTALL_BASE_CENTOS6 = 'https://gist.githubusercontent.com/ssmythe/f88142c80076df5fac9b/raw/0574b105d06728dd1383460441375cbaa536684b/install-base-centos6.sh'
INSTALL_NEXUS_OSS_CENTOS6 = 'https://gist.githubusercontent.com/ssmythe/d4377ccb4ac0ff6fc874/raw/172f205d88e1325145035f1175a56561f76fb36b/install-nexus-oss-centos6.sh'
servers = {
:nexus => {
:box_url => CENTOS67_BOX_URL,
:box => CENTOS67_BOX_NAME,
:cpu => '1',
:ram => '2048',
:provision_shells => [
INSTALL_BASE_CENTOS6,
INSTALL_NEXUS_OSS_CENTOS6
]
}
}
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
servers.each_pair do |name, spec|
box_url, box, cpu, ram, provision_shells = spec[:box_url], spec[:box], spec[:cpu], spec[:ram], spec[:provision_shells]
config.vm.define name do |node|
node.vm.box_url = box_url
node.vm.box = box
node.vm.hostname = name
# node.vm.network "public_network", :bridge => BRIDGE
node.vm.network "public_network"
node.vm.provider "virtualbox" do |v|
v.cpus = cpu
v.memory = ram
end
provision_shells.each do |provision_shell|
node.vm.provision "shell", path: "#{provision_shell}"
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment