forked from notch8/ansible-hydra
-
Notifications
You must be signed in to change notification settings - Fork 0
/
sample_Vagrantfile
66 lines (54 loc) · 2.78 KB
/
sample_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
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure(2) do |config|
# Vagrant configuration options are fully documented at
# https://docs.vagrantup.com.
config.vm.box = "debian/jessie64"
# Forwarded port mappings allow access to a specific port on the guest vm
# from a port on the host machine - to see your vm's port 80, use localhost:8484
config.vm.network "forwarded_port", guest: 80, host: 8484 # apache web server in production mode
config.vm.network "forwarded_port", guest: 8080, host: 2424 # tomcat (fedora & solr) in production mode
# config.vm.network "forwarded_port", guest: 3000, host: 3000 # webrick web server in development mode
# config.vm.network "forwarded_port", guest: 8983, host: 8983 # jetty (fedora & solr) in development mode
# By default, the directory from which you launch vagrant will be shared inside your VM as /vagrant
# To share an additional folder to the guest VM, state the path on the host
# to the actual folder, then the path on the guest to mount the folder.
# config.vm.synced_folder "../data", "/vagrant_data"
# Provider-specific configuration for VirtualBox:
config.vm.provider "virtualbox" do |vb|
# Display the VirtualBox GUI when booting the machine
# vb.gui = true
# Customize the amount of memory on the VM:
vb.memory = 2048 # if your system can afford it, definitely increase the memory allocation here
vb.cpus = 2
# Name your VM (if you don't like the autogenerated name)
# vb.name = "my_hydra"
end
# Install the Ansible Galaxy roles as a prerequisite
config.vm.provision "ansible" do |ansible|
ansible.playbook = "install_external_roles.yml"
end
# Enable provisioning with sufia-ansible project
config.vm.provision "ansible" do |ansible|
# ansible.verbose = 'vvv'
ansible.groups = {
"vagrant" => ["default"]
}
ansible.extra_vars = {
server_name: "localhost",
rails_env: "production"
}
ansible.playbook = "vagrant_staging.yml"
# update start_at_task and re-run `vagrant provison` if your configuration scripts fail on a particular task
# and you want to restart the provisioning at the step where the failure occurred
# ansible.start_at_task = "packages | update apt cache"
# for further details on using ansible with vagrant, see
# Ansible documentation: http://docs.ansible.com/ansible/guide_vagrant.html
# Vagrant documentation: https://docs.vagrantup.com/v2/provisioning/ansible.html
# - note the provisioning directory in the examples will be replced by ansible-hydra when using this repo
end
end