-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathVagrantfile
43 lines (38 loc) · 1.3 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
vm_host = "192.168.98.115"
$set_environment_variables = <<SCRIPT
tee "/etc/profile.d/myvars.sh" > "/dev/null" <<EOF
export ANSIBLE_COLLECTIONS_PATH=/vagrant/collections
EOF
SCRIPT
Vagrant.configure("2") do |config|
config.vm.define "oerindex-vm" do |srv|
srv.vm.box = "debian/bookworm64"
srv.ssh.insert_key = false
srv.vm.hostname = "oerindex.box"
srv.vm.network :private_network, ip: vm_host
srv.vm.provider :virtualbox do |vb|
vb.name = "oerindex"
vb.memory = 6072
vb.cpus = 2
end
end
config.vm.provision "shell", inline: $set_environment_variables
config.vm.provision "ansible_local" do |ansible|
ansible.install = true
ansible.compatibility_mode = "2.0"
ansible.install_mode = "pip"
ansible.pip_install_cmd = "sudo apt update && sudo apt install python3-pip -y"
ansible.pip_args = "ansible-core==2.16.10 --break-system-packages"
ansible.playbook = "playbook.yml"
ansible.galaxy_command = "ansible-galaxy collection install -r %{role_file} -p ./collections --force"
ansible.galaxy_role_file = "requirements.yml"
ansible.extra_vars = "default-config.yml"
ansible.verbose = "true"
ansible.host_vars = {
"oerindex-vm" => {
"search_index_host" => vm_host,
"timezone" => "Europe/Berlin"
}
}
end
end