forked from f500/elewant
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVagrantfile
68 lines (52 loc) · 2.45 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
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.define "elewant_develop", primary: true do |config_develop|
config_develop.vm.box = "f500/debian-stretch64"
config_develop.vm.hostname = "develop.elewant.loc"
config_develop.vm.network :private_network, ip: "192.168.77.77"
config_develop.vm.synced_folder ".", "/vagrant", nfs: true
config_develop.vm.provider :virtualbox do |vb|
vb.name = "elewant_develop"
vb.cpus = "1"
vb.memory = "1024"
vb.gui = false
vb.customize ["modifyvm", :id, "--natdnsproxy1", "on"]
vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
end
config_develop.vm.provision :ansible do |ansible|
ansible.compatibility_mode = "2.0"
ansible.inventory_path = "ansible/hosts-provision"
ansible.playbook = "ansible/provision/playbook.yml"
ansible.limit = "develop"
end
end
# This box is added to test provision and deploy scripts agains a simulated
# "production" environment. It is not needed for regular development on the
# elewant website.
config.vm.define "elewant_prodsim", autostart: false do |config_prodsim|
config_prodsim.vm.box = "f500/debian-stretch64"
config_prodsim.vm.hostname = "prodsim.elewant.loc"
config_prodsim.vm.network :private_network, ip: "192.168.77.78"
# No synched folder, this is a simlation of production after all!
config_prodsim.vm.synced_folder ".", "/vagrant", disabled: true
config_prodsim.vm.provider :virtualbox do |vb|
vb.name = "elewant_prodsim"
vb.cpus = "1"
vb.memory = "1024"
vb.gui = false
vb.customize ["modifyvm", :id, "--natdnsproxy1", "on"]
vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
end
# Ansible is only used to create a user, the rest is done on the
# commandline with ansible-playbook commands.
config_prodsim.vm.provision :ansible do |ansible|
ansible.compatibility_mode = "2.0"
ansible.inventory_path = "ansible/prodsim-hosts-provision"
ansible.playbook = "ansible/setup_local_production_server.yml"
ansible.limit = "production"
ansible.raw_arguments = "--user=vagrant"
ansible.host_key_checking = "False"
end
end
end