Skip to content

Instantly share code, notes, and snippets.

@cenrak
Created May 3, 2018 17:41
Show Gist options
  • Save cenrak/34c83bd0ce79cca788fb99ea02f4a386 to your computer and use it in GitHub Desktop.
Save cenrak/34c83bd0ce79cca788fb99ea02f4a386 to your computer and use it in GitHub Desktop.
Vagrantfile to prepare a quick katello infrastructure.
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
config.vm.define "foreman" do |foreman|
foreman.vm.box = 'centos/7'
foreman.vm.network "public_network", bridge: "wlp3s0"
foreman.vm.network "private_network", ip: "10.0.0.2"
foreman.vm.hostname = "foreman.example.com"
# foreman.vm.synced_folder "./", "/vagrant"
#config.vm.provision "ansible" do |ansible|
# ansible.playbook = "ansible-playbook.yml"
#end
foreman.vm.provider "virtualbox" do |vb|
vb.memory = "4096"
vb.linked_clone = true
vb.customize ["storageattach", :id, "--storagectl", "IDE", "--port", "1", "--device", "0", "--type", "dvddrive", "--medium", "/usr/share/virtualbox/VBoxGuestAdditions.iso"]
end
end
config.vm.define "capsule" do |capsule|
capsule.vm.box = "centos/7"
capsule.vm.network "private_network", ip: "10.0.0.3"
capsule.vm.hostname = "capsule.example.com"
capsule.vm.provider "virtualbox" do |vb|
vb.memory = "2048"
vb.linked_clone = true
end
end
(1..3).each do |i|
config.vm.define "server#{i}" do |server|
server.vm.box = "centos/7"
server.vm.box_version = "1710.01"
server.vm.network "private_network", ip: "10.0.0.#{i+3}"
server.vm.hostname = "server#{i}.example.com"
server.vm.provider "virtualbox" do |vb|
vb.linked_clone = true
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment