-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathVagrantfile
32 lines (27 loc) · 1.19 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
# # Host-based apt cache -> requires ~/.vagrant.d/cache/apt/geerlingguy/ubuntu1804/partial to exist on host
# # Makes testing easier
# def local_cache(basebox_name)
# cache_dir = Vagrant::Environment.new.home_path.join('cache', 'apt', basebox_name)
# partial_dir = cache_dir.join('partial')
# partial_dir.mkdir unless partial_dir.exist?
# cache_dir
# end
Vagrant.configure("2") do |config|
config.vm.box = "geerlingguy/ubuntu1804"
config.vm.hostname = "xubuntu"
config.vm.network "private_network", type: "dhcp"
config.vm.network "forwarded_port", guest: 3389, host:3389
config.vm.provider :virtualbox do |v|
v.memory = 4096
v.cpus = 2
end
# # Host-based apt cache
# cache_dir = local_cache(config.vm.box)
# config.vm.synced_folder cache_dir,
# "/var/cache/apt/archives/"
# Thanks Rob Allen -> https://dzone.com/articles/provisioning-ansible-within
config.ssh.shell = "bash -c 'BASH_ENV=/etc/profile exec bash'"
config.vm.provision :shell,
:keep_color => true,
:inline => "export PYTHONUNBUFFERED=1 && export ANSIBLE_FORCE_COLOR=1 && cd /vagrant/provisioning && bash init.sh"
end