-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathVagrantfile
More file actions
51 lines (35 loc) · 1.4 KB
/
Vagrantfile
File metadata and controls
51 lines (35 loc) · 1.4 KB
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
# -*- mode: ruby -*-
# vi: set ft=ruby :
require 'yaml'
VAGRANTFILE_API_VERSION = "2"
$setup = <<SCRIPT
sudo apt-add-repository ppa:ansible/ansible
sudo apt-get update
sudo apt-get install -y software-properties-common
sudo apt-get install -y ansible sshpass
echo 'export ANSIBLE_HOST_KEY_CHECKING=False' >> /home/vagrant/.bashrc
SCRIPT
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "ubuntu/trusty32"
config.vm.box_check_update = false
config.vbguest.auto_update = false
config.vbguest.no_remote = true
# config.vm.network "forwarded_port", guest: 18080, host: 18080
config.ssh.port = 2222
config.ssh.forward_agent = true
config.vm.synced_folder "src/vagrant/cache/apt-archives", "/var/cache/apt/archives"
config.vm.synced_folder "src/ansible", "/home/vagrant/provisioning", :mount_options => ["dmode=755", "fmode=644"]
settings = YAML.load_file 'src/vagrant/vagrant.yml'
config.vm.provider "virtualbox" do |vb|
vb.name = settings['vm']['name']
vb.gui = false
vb.memory = "512"
# vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
# vb.customize ["modifyvm", :id, "--natdnsproxy1", "on"]
end
config.vm.provision "file" do |f|
f.source = "src/vagrant/.ansible.cfg"
f.destination = ".ansible.cfg"
end
config.vm.provision "shell", inline: $setup
end