Skip to content

Instantly share code, notes, and snippets.

@TheNotary
Created April 28, 2018 21:29
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 TheNotary/df4fb4dc012640ee47700ae904697e29 to your computer and use it in GitHub Desktop.
Save TheNotary/df4fb4dc012640ee47700ae904697e29 to your computer and use it in GitHub Desktop.
config_data = JSON.parse( File.read("variables.json") )
debian_vms = [
{ name: "it-workhorse-vm", ip: "48" },
{ name: "storage-host-vm", ip: "139" },
{ name: "rock", ip: "54" },
{ name: "backups-dark-vm", ip: "128" },
{ name: "ubuntu-vm", ip: "127" },
{ name: "jenkins-vm", ip: "126" } ]
case config_data['build_platform']
when "vmware-iso"
vm_name_prefix = "vmware"
Vagrant.configure('2') do |config|
config.ssh.insert_key = false
config.ssh.private_key_path = "~/.ssh/id_rsa"
# vm = { name: "rock", ip: "54" }
debian_vms.each do |vm|
config.vm.define "#{vm[:name]}" do |node_config|
node_config.vm.hostname = vm[:name]
node_config.vm.box = "#{vm_name_prefix}_#{vm[:name]}"
node_config.vm.box_url = "builds/#{vm_name_prefix}_#{vm[:name]}.box"
node_config.vm.network :private_network, ip: "192.168.1.#{vm[:ip]}"
node_config.vm.synced_folder('.', '/vagrant', type: 'rsync', disabled: true)
end
end
config.vm.provider :vmware_esxi do |esxi|
esxi.esxi_hostname = '192.168.1.43'
esxi.esxi_username = 'root'
esxi.esxi_password = ''
esxi.esxi_virtual_network = ['VM Network', 'VM Network']
esxi.guest_guestos = 'debian9-64'
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment