Skip to content

Instantly share code, notes, and snippets.

@muresan
Created November 23, 2016 16:37
Show Gist options
  • Save muresan/02e776326a182e5c7ea9fa34e6560809 to your computer and use it in GitHub Desktop.
Save muresan/02e776326a182e5c7ea9fa34e6560809 to your computer and use it in GitHub Desktop.
Simple "run a CentOS 7 box for Splunk" Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
#TODO
Vagrant.configure(2) do |config|
hosts = {
'splunk01' => { 'ip' => '192.168.124.201', 'cpus' => 1, 'memory' => 2048, 'autostart' => true },
# 'splunk02' => { 'ip' => '192.168.124.202', 'cpus' => 1, 'memory' => 2048, 'autostart' => true },
}
hosts.each do |host, params|
config.vm.define host, autostart: params['autostart'] do |host_config|
host_config.vm.box = "centos/7"
host_config.vm.hostname = "#{host}"
host_config.vm.network :private_network, ip: params['ip']
host_config.vm.synced_folder ".", "/home/vagrant/sync", disabled: true
host_config.vm.provider :libvirt do |libvirt|
libvirt.driver = 'kvm'
libvirt.memory = params['memory']
libvirt.cpus = params['cpus']
end
#host_config.vm.provision :file, source: "docker.repo", destination: "/tmp/docker.repo"
host_config.vm.provision :shell, inline: <<-SHELL
sudo yum -y install vim-enhanced traceroute telnet epel-release strace
sudo rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
SHELL
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment