forked from yorkulibraries/yudl-playbook
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Vagrantfile
74 lines (60 loc) · 2.68 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# -*- 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.require_version ">= 2.0.1"
$cpus = ENV.fetch("ISLANDORA_VAGRANT_CPUS", "4")
$memory = ENV.fetch("ISLANDORA_VAGRANT_MEMORY", "6156")
$hostname = ENV.fetch("ISLANDORA_VAGRANT_HOSTNAME", "yudl-dev")
$virtualBoxDescription = ENV.fetch("ISLANDORA_VAGRANT_VIRTUALBOXDESCRIPTION", "YUDL DEV")
# Available boxes are 'islandora/8', ubuntu/bionic64' and 'centos/7'
# Use 'ubuntu/bionic64' or 'centos/7' to build a dev environment from scratch.
# Use 'islandora/8' if you just want to download a ready to run VM.
$vagrantBox = ENV.fetch("ISLANDORA_DISTRO", "ubuntu/focal64")
# vagrant is the main user
$vagrantUser = "vagrant"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.provider "virtualbox" do |v|
v.name = "YUDL Ansible"
end
config.vm.hostname = $hostname
# Every Vagrant virtual environment requires a box to build off of.
config.vm.box = $vagrantBox
# Configure home directory
home_dir = "/home/" + $vagrantUser
# Configure sync directory
config.vm.synced_folder ".", home_dir + "/islandora"
config.vm.network :forwarded_port, guest: 8000, host: 8000 # Apache
config.vm.network :forwarded_port, guest: 8080, host: 8080 # Tomcat
config.vm.network :forwarded_port, guest: 3306, host: 3306 # MySQL
config.vm.network :forwarded_port, guest: 5432, host: 5432 # PostgreSQL
config.vm.network :forwarded_port, guest: 8983, host: 8983 # Solr
config.vm.network :forwarded_port, guest: 8161, host: 8161 # Activemq
config.vm.network :forwarded_port, guest: 8081, host: 8081 # API-X
config.vm.provider "virtualbox" do |vb|
vb.customize ["modifyvm", :id, "--memory", $memory]
vb.customize ["modifyvm", :id, "--cpus", $cpus]
vb.customize ["modifyvm", :id, "--description", $virtualBoxDescription]
vb.customize ["modifyvm", :id, "--audio", "none"]
vb.customize ["modifyvm", :id, "--uart1", "0x3F8", "4"]
vb.customize ["modifyvm", :id, "--uartmode1", "disconnected" ]
end
if $vagrantBox != "islandora/8" then
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"
ansible.host_vars = {
"all" => { "ansible_ssh_user" => $vagrantUser }
}
ansible.extra_vars = {
"islandora_distro" => $vagrantBox,
"env" => "dev"
}
end
end
end