-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVagrantfile
43 lines (34 loc) · 1.26 KB
/
Vagrantfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = ENV.fetch("VAGRANT_BOX", "ubuntu/jammy64")
{
"am-local" => {
"memory" => "4096",
"cpus" => "8",
},
}.each do |short_name, properties|
# Define guest
config.vm.define short_name do |host|
host.vm.hostname = "#{short_name}.myapp.dev"
end
# Set the amount of RAM and virtual CPUs for the virtual machine
config.vm.provider :virtualbox do |vb|
vb.customize ["modifyvm", :id, "--memory", properties.fetch("memory")]
vb.customize ["modifyvm", :id, "--cpus", properties.fetch("cpus")]
end
end
config.vm.network :forwarded_port, guest: 8000, host: 8000
config.vm.network :forwarded_port, guest: 80, host: 8001
config.vm.provision :ansible do |ansible|
ansible.compatibility_mode = "auto"
ansible.playbook = "playbook.yml"
ansible.galaxy_role_file = "requirements.yml"
ansible.galaxy_command = "ansible-galaxy install --role-file=%{role_file}"
ansible.limit = "all"
ansible.raw_arguments = "--ask-vault-pass"
ansible.inventory_path = "inventory/dev"
end
end