1
0
Fork 0
mirror of https://github.com/samsapti/bachelor-project.git synced 2024-12-27 21:07:53 +00:00
bachelor-project/ansible/Vagrantfile

28 lines
671 B
Ruby

Vagrant.require_version ">= 2.0.0"
N = 2
Vagrant.configure("2") do |config|
(0..N).each do |player_id|
vm_name = "mpc-player-#{player_id}"
config.vm.define vm_name do |player|
player.vm.box = "ubuntu/jammy64"
player.vm.hostname = vm_name
player.vm.network :private_network, ip: "192.168.56.#{20 + player_id}"
player.vm.provider :virtualbox do |vb|
vb.cpus = 2
vb.memory = 8192
end
if player_id == N
player.vm.provision :ansible do |ansible|
ansible.limit = "all"
ansible.playbook = "playbook.yml"
ansible.ask_vault_pass = true
end
end
end
end
end