-
Notifications
You must be signed in to change notification settings - Fork 0
/
Vagrantfile
128 lines (111 loc) · 4.55 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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
require 'yaml'
cnf = YAML::load_file(File.join(__dir__, 'config.yaml'))
git = YAML::load_file(File.join(__dir__, '.git-branch.yaml'))
Vagrant.configure('2') do |config|
config.vm.define "centos42f" do |centos42f|
centos42f.vm.provider :digital_ocean do |provider, override|
override.ssh.private_key_path = 'vagrant.key'
override.vm.box = 'digital_ocean'
override.vm.box_url = "https://github.com/smdahlen/vagrant-digitalocean/raw/master/box/digital_ocean.box"
provider.token = cnf['digital_ocean_token']
provider.image = "centos-7-0-x64"
provider.region = cnf['digital_ocean_region']
provider.size = cnf['digital_ocean_size']
end
centos42f.vm.provision :shell do |shell|
shell.inline = "OS=`cat /etc/issue | head -n1 | cut -f1 -d' '`; \
if [ \"$OS\" == \"Debian\" -o \"$OS\" == \"Ubuntu\" ]; \
then apt-get update; \
else \
yum -y update; \
fi; \
/vagrant/bootstrap.sh; \
/vagrant/start.sh centos42f " + git['branch']
end
end
config.vm.define "centos50x" do |centos50x|
centos50x.vm.provider :digital_ocean do |provider, override|
override.ssh.private_key_path = 'vagrant.key'
override.vm.box = 'digital_ocean'
override.vm.box_url = "https://github.com/smdahlen/vagrant-digitalocean/raw/master/box/digital_ocean.box"
provider.token = cnf['digital_ocean_token']
provider.image = "centos-7-0-x64"
provider.region = cnf['digital_ocean_region']
provider.size = cnf['digital_ocean_size']
end
centos50x.vm.provision :shell do |shell|
shell.inline = "OS=`cat /etc/issue | head -n1 | cut -f1 -d' '`; \
if [ \"$OS\" == \"Debian\" -o \"$OS\" == \"Ubuntu\" ]; \
then apt-get update; \
else \
yum -y update; \
fi; \
/vagrant/bootstrap.sh; \
/vagrant/start.sh centos50x " + git['branch']
end
end
config.vm.define "ubuntu42f" do |ubuntu42f|
ubuntu42f.vm.provider :digital_ocean do |provider, override|
override.ssh.private_key_path = 'vagrant.key'
override.vm.box = 'digital_ocean'
override.vm.box_url = "https://github.com/smdahlen/vagrant-digitalocean/raw/master/box/digital_ocean.box"
provider.token = cnf['digital_ocean_token']
provider.image = 'ubuntu-14-04-x64'
provider.region = cnf['digital_ocean_region']
provider.size = cnf['digital_ocean_size']
end
ubuntu42f.vm.provision :shell do |shell|
shell.inline = "OS=`cat /etc/issue | head -n1 | cut -f1 -d' '`; \
if [ \"$OS\" == \"Debian\" -o \"$OS\" == \"Ubuntu\" ]; \
then apt-get update; \
else \
yum -y update; \
fi; \
/vagrant/bootstrap.sh; \
/vagrant/start.sh ubuntu42f " + git['branch']
end
end
config.vm.define "ubuntu50x" do |ubuntu50x|
ubuntu50x.vm.provider :digital_ocean do |provider, override|
override.ssh.private_key_path = 'vagrant.key'
override.vm.box = 'digital_ocean'
override.vm.box_url = "https://github.com/smdahlen/vagrant-digitalocean/raw/master/box/digital_ocean.box"
provider.token = cnf['digital_ocean_token']
provider.image = 'ubuntu-14-04-x64'
provider.region = cnf['digital_ocean_region']
provider.size = cnf['digital_ocean_size']
end
ubuntu50x.vm.provision :shell do |shell|
shell.inline = "OS=`cat /etc/issue | head -n1 | cut -f1 -d' '`; \
if [ \"$OS\" == \"Debian\" -o \"$OS\" == \"Ubuntu\" ]; \
then apt-get update; \
else \
yum -y update; \
fi; \
/vagrant/bootstrap.sh; \
/vagrant/start.sh ubuntu50x " + git['branch']
end
end
config.vm.define "testrig" do |testrig|
testrig.vm.provider :digital_ocean do |provider, override|
override.ssh.private_key_path = 'vagrant.key'
override.vm.box = 'digital_ocean'
override.vm.box_url = "https://github.com/smdahlen/vagrant-digitalocean/raw/master/box/digital_ocean.box"
provider.token = cnf['digital_ocean_token']
provider.image = 'ubuntu-14-04-x64'
provider.region = cnf['digital_ocean_region']
provider.size = cnf['digital_ocean_size_testvm']
end
testrig.vm.provision :shell do |shell|
shell.inline = "apt-get update; /vagrant/bootstrap.sh; \
puppet module install puppetlabs-vcsrepo"
end
testrig.vm.provision :puppet do |puppet|
puppet.manifests_path = "puppet/testrig/manifests"
puppet.manifest_file = "init.pp"
end
testrig.vm.provision :shell do |shell|
shell.path = "testrig-setup.sh"
end
end
end