Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- domain = 'example.com'
- nodes = [
- { hostname: 'lb01', ip: '192.168.250.10', box: 'ubuntu/bionic64', cpus: '1', ram: '256' },
- { hostname: 'node01', ip: '192.168.250.21', box: 'ubuntu/bionic64', cpus: '1', ram: '256' },
- { hostname: 'node02', ip: '192.168.250.22', box: 'ubuntu/bionic64', cpus: '1', ram: '256' },
- { hostname: 'node03', ip: '192.168.250.23', box: 'ubuntu/bionic64', cpus: '1', ram: '256' },
- ]
- Vagrant.configure('2') do |config|
- nodes.each do |node|
- config.vm.define node[:hostname] do |nodeconfig|
- nodeconfig.vm.box = node[:box] ? node[:box] : 'ubuntu/trusty64'
- nodeconfig.ssh.insert_key = false
- nodeconfig.vm.hostname = node[:hostname] + '.' + domain
- nodeconfig.vm.network :private_network, ip: node[:ip]
- cpus = node[:cpus] ? node[:cpus] : 1
- memory = node[:ram] ? node[:ram] : 256
- nodeconfig.vm.provider :virtualbox do |vb|
- vb.customize [
- 'modifyvm', :id,
- '--cpuexecutioncap', '100',
- '--cpus', cpus.to_s,
- '--memory', memory.to_s
- ]
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement