-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathVagrantfile
81 lines (68 loc) · 3.09 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
75
76
77
78
79
80
81
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Setting Vagrant minimum require_version
Vagrant.require_version ">= 2.0.0"
# Setting default location to store .vagrant folder. Matches $JENKINS_HOME
ENV['VAGRANT_DOTFILE_PATH'] = '/var/lib/jenkins'
Vagrant.configure("2") do |config|
config.vm.provider "virtualbox"
config.vm.boot_timeout = 600
config.vm.box_check_update = "true"
# You can find out your network interface name with 'lshw -class network'
config.vm.network "public_network", type: "dhcp", bridge: [
"enp3s0",
"wlan0",
"eth0",
"eth1",
"82579LM Gigabit Network Connection",
"82567LM-3 Gigabit Network Connection",
"Centrino Advanced-N 6205 [Taylor Peak]"]
config.vm.network "private_network", type: "dhcp"
config.vm.network "private_network", type: "dhcp"
# Vagrant-dependency-manager to install required Vagrant plugins
if File.exists?(File.dirname(__FILE__)+ "/dependency_manager.rb")
require File.dirname(__FILE__)+ "/dependency_manager"
check_plugins ["vagrant-vbguest", "vagrant-cachier"]
end
# vagrant-vbguest check if the VirtualBox Guest Additions version number are in sync
if Vagrant.has_plugin?("vagrant-vbguest")
config.vbguest.auto_update = true
end
# Enable vagrant-cachier plugin enabled for multi-vm envirnoment
if Vagrant.has_plugin?("vagrant-cachier")
config.cache.scope = :machine
config.cache.synced_folder_opts = {
owner: "root",
group: "root",
mount_options:['dmode=777', 'fmode=755']
}
end
config.vm.provider :virtualbox do |vb|
vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
#config.vm.customize ["modifyvm", :id, "--memory", 2048]
#config.vm.customize ["modifyvm", :id, "--cpus", 2]
end
config.vm.define "debian", primary: true, autostart: true do |debian|
debian.vm.box = "debian/stretch64"
debian.vm.provision "shell", :run => 'always', path: "curl-me"
end
config.vm.define "ubuntu", autostart: false do |ubuntu|
ubuntu.vm.box = "ubuntu/xenial64"
ubuntu.vm.provision "shell", :run => 'always', inline: "apt-add-repository -y ppa:ansible/ansible"
# Fixes Apt hash sum mismatch error https://blog.packagecloud.io/eng/2016/03/21/apt-hash-sum-mismatch/
ubuntu.vm.provision "shell", :run => 'always', inline: "echo 'Acquire::CompressionTypes::Order:: \"gz\";' > /etc/apt/apt.conf.d/99compression-workaround"
ubuntu.vm.provision "shell", :run => 'always', path: "curl-me"
end
config.vm.define "fedora", autostart: false do |fedora|
fedora.vm.box = "fedora/26-cloud-base"
# BUG curl-me script requires 'lsb_release' which is not part of Fedora core
fedora.vm.provision "shell", :run => 'always', inline: "dnf -y update && dnf -y install redhat-lsb-core"
fedora.vm.provision "shell", :run => 'always', path: "curl-me"
end
config.vm.define "centos", autostart: false do |centos|
centos.vm.box = "centos/7"
# BUG curl-me script requires 'lsb_release' program
centos.vm.provision "shell", :run => 'always', inline: "yum -y install redhat-lsb-core"
centos.vm.provision "shell", :run => 'always', path: "curl-me"
end
end