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

28 lines
671 B
Ruby
Raw Normal View History

2023-04-18 22:56:27 +00:00
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|
2023-04-19 14:13:33 +00:00
vb.cpus = 2
2023-04-18 22:56:27 +00:00
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