This repository has been archived by the owner on Feb 13, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Vagrantfile
300 lines (282 loc) · 12.7 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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vbguest.auto_update = false
config.vm.define "jenkins_master-centos-7.6-x86_64" do |jenkins_master|
jenkins_master.vm.box = "centos/7"
jenkins_master.vm.network :private_network, :ip => "#{ENV['JENKINS_MASTER_IP_ADDRESS']}"
jenkins_master.vm.provision "file", source: "~/.ansible/vault-pass", destination: "/home/vagrant/.ansible/vault-pass"
jenkins_master.vm.provision "shell", path: "scripts/sh/setup_ansible.sh"
jenkins_master.vm.provision "ansible_local" do |ansible|
ansible.playbook = "ansible/jenkins-master.yml"
ansible.inventory_path = "environments/vagrant/hosts"
ansible.raw_arguments = "--vault-pass /home/vagrant/.ansible/vault-pass"
ansible.extra_vars = {
cloud_environment: "none",
jenkins_master_url: "http://#{ENV['JENKINS_MASTER_IP_ADDRESS']}/"
}
end
jenkins_master.vm.provider "virtualbox" do |vb|
vb.memory = 2048
vb.customize ["modifyvm", :id, "--audio", "none"]
end
end
config.vm.define "rust_slave-centos-7.6-x86_64" do |rust_slave_centos|
rust_slave_centos.vm.box = "centos/7"
rust_slave_centos.vm.provision "file", source: "~/.ansible/vault-pass", destination: "/home/vagrant/.ansible/vault-pass"
rust_slave_centos.vm.provision "shell", path: "scripts/sh/setup_ansible.sh"
rust_slave_centos.vm.provision "shell", path: "scripts/sh/install_external_java_role.sh", privileged: false
rust_slave_centos.vm.provision "ansible_local" do |ansible|
ansible.playbook = "ansible/rust-slave.yml"
ansible.raw_arguments = "--vault-pass /home/vagrant/.ansible/vault-pass"
end
rust_slave_centos.vm.provider "virtualbox" do |vb|
vb.memory = 2048
vb.customize ["modifyvm", :id, "--audio", "none"]
end
end
config.vm.define "docker_slave_quick-centos-7.6-x86_64" do |docker_slave_quick|
docker_slave_quick.vm.box = "maidsafe/docker_slave-centos-7.6-x86_64"
docker_slave_quick.vm.network :private_network, :ip => "#{ENV['DOCKER_SLAVE_IP_ADDRESS']}"
docker_slave_quick.vm.provider "virtualbox" do |vb|
vb.cpus = 2
vb.memory = 2048
vb.customize ["modifyvm", :id, "--audio", "none"]
end
end
config.vm.define "docker_slave-centos-7.6-x86_64" do |docker_slave_centos|
docker_slave_centos.vm.box = "centos/7"
docker_slave_centos.vm.network :private_network, :ip => "#{ENV['DOCKER_SLAVE_IP_ADDRESS']}"
docker_slave_centos.vm.provision "file", source: "~/.ansible/vault-pass", destination: "/home/vagrant/.ansible/vault-pass"
docker_slave_centos.vm.provision "shell", path: "scripts/sh/setup_ansible.sh"
docker_slave_centos.vm.provision "shell", path: "scripts/sh/install_external_java_role.sh", privileged: false
docker_slave_centos.vm.provision "ansible_local" do |ansible|
ansible.playbook = "ansible/docker-slave.yml"
ansible.inventory_path = "environments/vagrant/hosts"
ansible.raw_arguments = "--vault-pass /home/vagrant/.ansible/vault-pass"
ansible.extra_vars = { cloud_environment: "none" }
end
docker_slave_centos.vm.provider "virtualbox" do |vb|
vb.cpus = 2
vb.memory = 2048
vb.customize ["modifyvm", :id, "--audio", "none"]
end
end
config.vm.define "rust_slave-ubuntu-trusty-x86_64" do |rust_slave_ubuntu|
rust_slave_ubuntu.vm.box = "ubuntu/trusty64"
rust_slave_ubuntu.vm.provision "file", source: "~/.ansible/vault-pass", destination: "/home/vagrant/.ansible/vault-pass"
rust_slave_ubuntu.vm.provision "shell", path: "scripts/sh/setup_ansible.sh"
rust_slave_ubuntu.vm.provision "shell", path: "scripts/sh/install_external_java_role.sh", privileged: false
rust_slave_ubuntu.vm.provision "ansible_local" do |ansible|
ansible.playbook = "ansible/rust-slave.yml"
ansible.raw_arguments = "--vault-pass /home/vagrant/.ansible/vault-pass"
end
rust_slave_ubuntu.vm.provider "virtualbox" do |vb|
vb.memory = 2048
end
end
config.vm.define "base-windows-2012_r2-x86_64" do |windows_slave|
windows_slave.vm.synced_folder '.', '/vagrant', disabled: true
windows_slave.vm.box = "windows2012_r2"
windows_slave.vm.box_url = "https://s3.amazonaws.com/safe-vagrant-boxes/windows2012r2-virtualbox.box"
windows_slave.vm.guest = :windows
windows_slave.vm.communicator = "winrm"
windows_slave.winrm.username = "vagrant"
windows_slave.winrm.password = "vagrant"
windows_slave.vm.provider "virtualbox" do |vb|
vb.memory = 2048
vb.gui = true
vb.customize ["modifyvm", :id, "--audio", "none"]
vb.customize ["modifyvm", :id, "--clipboard", "bidirectional"]
end
end
config.vm.define "base-windows-2016-x86_64" do |windows_slave|
windows_slave.vm.synced_folder '.', '/vagrant', disabled: true
windows_slave.vm.box = "windows2016"
windows_slave.vm.box_url = "https://s3.amazonaws.com/safe-vagrant-boxes/windows2016-virtualbox.box"
windows_slave.vm.guest = :windows
windows_slave.vm.communicator = "winrm"
windows_slave.winrm.username = "vagrant"
windows_slave.winrm.password = "vagrant"
windows_slave.vm.provider "virtualbox" do |vb|
vb.memory = 2048
vb.gui = true
vb.customize ["modifyvm", :id, "--audio", "none"]
vb.customize ["modifyvm", :id, "--clipboard", "bidirectional"]
end
end
config.vm.define "rust_slave_git_bash-windows-2012_r2-x86_64" do |windows_slave|
windows_slave.vm.synced_folder '.', '/vagrant', disabled: true
windows_slave.vm.box = "windows2012_r2"
windows_slave.vm.box_url = "https://s3.amazonaws.com/safe-vagrant-boxes/windows2012r2-virtualbox.box"
windows_slave.vm.guest = :windows
windows_slave.vm.communicator = "winrm"
windows_slave.winrm.username = "vagrant"
windows_slave.winrm.password = "vagrant"
windows_slave.vm.provision "shell", inline: "choco install -y git"
windows_slave.vm.provision "shell", path: "scripts/ps/install_rustup.ps1"
windows_slave.vm.provision "shell", path: "scripts/bat/tools.bat"
windows_slave.vm.provider "virtualbox" do |vb|
vb.memory = 2048
vb.gui = true
vb.customize ["modifyvm", :id, "--audio", "none"]
vb.customize ["modifyvm", :id, "--clipboard", "bidirectional"]
end
end
config.vm.define "jenkins_rust_slave-windows-2016-x86_64" do |windows_slave|
windows_slave.vm.synced_folder '.', '/vagrant', disabled: true
windows_slave.vm.box = "maidsafe/windows-2016-travis_slave"
windows_slave.vm.box_url = "https://s3.amazonaws.com/safe-vagrant-boxes/travis_slave-windows-2016-virtualbox-x86_64.box"
windows_slave.vm.guest = :windows
windows_slave.vm.communicator = "winrm"
windows_slave.winrm.username = "vagrant"
windows_slave.winrm.password = "vagrant"
windows_slave.vm.provision "ansible" do |ansible|
ansible.playbook = "ansible/win-jenkins-slave.yml"
ansible.inventory_path = "environments/vagrant/hosts"
ansible.vault_password_file = "~/.ansible/vault-pass"
ansible.extra_vars = {
jenkins_master_dns: "#{ENV['JENKINS_MASTER_IP_ADDRESS']}"
}
end
windows_slave.vm.provision "shell", path: "scripts/bat/tools.bat"
windows_slave.vm.provider "virtualbox" do |vb|
vb.memory = 2048
vb.gui = true
vb.customize ["modifyvm", :id, "--audio", "none"]
vb.customize ["modifyvm", :id, "--clipboard", "bidirectional"]
end
end
config.vm.define "travis_rust_slave-windows-2016-x86_64" do |windows_slave|
windows_slave.vm.synced_folder '.', '/vagrant', disabled: true
windows_slave.vm.box = "maidsafe/windows-2016-travis_slave"
windows_slave.vm.box_url = "https://s3.amazonaws.com/safe-vagrant-boxes/travis_slave-windows-2016-virtualbox-x86_64.box"
windows_slave.vm.guest = :windows
windows_slave.vm.communicator = "winrm"
windows_slave.winrm.username = "vagrant"
windows_slave.winrm.password = "vagrant"
windows_slave.vm.provision "ansible" do |ansible|
ansible.playbook = "ansible/win-travis-slave.yml"
ansible.limit = "travis_rust_slave-windows-2016-x86_64"
ansible.inventory_path = "environments/vagrant/hosts"
ansible.vault_password_file = "~/.ansible/vault-pass"
ansible.extra_vars = {
jenkins_service_account_user: "" # This is necessary to instruct the role *not* to use the service account.
}
end
windows_slave.vm.provision "shell", path: "scripts/bat/tools.bat"
windows_slave.vm.provider "virtualbox" do |vb|
vb.memory = 2048
vb.gui = true
vb.customize ["modifyvm", :id, "--audio", "none"]
vb.customize ["modifyvm", :id, "--clipboard", "bidirectional"]
end
end
config.vm.define "rust_slave_msys2-windows-2012_r2-x86_64" do |windows_slave|
windows_slave.vm.synced_folder '.', '/vagrant', disabled: true
windows_slave.vm.box = "windows2012_r2"
windows_slave.vm.box_url = "https://s3.amazonaws.com/safe-vagrant-boxes/windows2012r2-virtualbox.box"
windows_slave.vm.guest = :windows
windows_slave.vm.communicator = "winrm"
windows_slave.winrm.username = "vagrant"
windows_slave.winrm.password = "vagrant"
windows_slave.vm.provision "shell", path: "scripts/bat/setup_mingw.bat"
windows_slave.vm.provision "shell", path: "scripts/ps/install_rustup.ps1"
windows_slave.vm.provision "shell", path: "scripts/bat/tools.bat"
windows_slave.vm.provider "virtualbox" do |vb|
vb.memory = 2048
vb.gui = true
vb.customize ["modifyvm", :id, "--audio", "none"]
vb.customize ["modifyvm", :id, "--clipboard", "bidirectional"]
end
end
config.vm.define "docker_slave-centos-7.6-x86_64-aws" do |docker_slave_aws|
docker_slave_aws.vm.box = "dummy"
docker_slave_aws.vm.provider :aws do |aws, override|
aws.access_key_id = "#{ENV['AWS_ACCESS_KEY_ID']}"
aws.secret_access_key = "#{ENV['AWS_SECRET_ACCESS_KEY']}"
aws.region = "eu-west-2"
aws.ami = "ami-0eab3a90fc693af19"
aws.instance_type = "t2.micro"
aws.security_groups = ["vagrant"]
aws.keypair_name = "vagrant"
aws.block_device_mapping = [
{
'DeviceName' => '/dev/sdb',
'Ebs.VolumeSize' => 50,
'Ebs.DeleteOnTermination' => true,
'Ebs.VolumeType' => 'gp2'
},
{
'DeviceName' => '/dev/sdc',
'Ebs.VolumeSize' => 50,
'Ebs.DeleteOnTermination' => true,
'Ebs.VolumeType' => 'gp2'
}
]
aws.tags = {
'Name' => 'docker_slave_001',
'full_name' => 'docker_slave-centos-7.6-x86_64',
'group' => 'slaves',
'environment' => 'dev'
}
override.ssh.username = "centos"
override.ssh.private_key_path = "~/.ssh/vagrant"
end
end
config.vm.define "util_slave-centos-7.6-x86_64-aws" do |util_slave_aws|
util_slave_aws.vm.box = "dummy"
util_slave_aws.vm.synced_folder ".", "/vagrant", disabled: true
util_slave_aws.vm.provider :aws do |aws, override|
aws.access_key_id = "#{ENV['AWS_ACCESS_KEY_ID']}"
aws.secret_access_key = "#{ENV['AWS_SECRET_ACCESS_KEY']}"
aws.region = "eu-west-2"
aws.ami = "ami-0eab3a90fc693af19"
aws.instance_type = "t2.small"
aws.security_groups = ["vagrant"]
aws.keypair_name = "vagrant"
aws.block_device_mapping = [
{
'DeviceName' => '/dev/sdb',
'Ebs.VolumeSize' => 50,
'Ebs.DeleteOnTermination' => true,
'Ebs.VolumeType' => 'gp2'
},
{
'DeviceName' => '/dev/sdc',
'Ebs.VolumeSize' => 50,
'Ebs.DeleteOnTermination' => true,
'Ebs.VolumeType' => 'gp2'
}
]
aws.tags = {
'Name' => 'util_slave',
'full_name' => 'util_slave-centos-7.6-x86_64',
'group' => 'util_slaves',
'environment' => 'dev'
}
override.ssh.username = "centos"
override.ssh.private_key_path = "~/.ssh/vagrant"
end
end
config.vm.provision :hosts do |hosts_config|
hosts_config.add_host "#{ENV['JENKINS_MASTER_IP_ADDRESS']}", ["#{ENV['JENKINS_MASTER_URL']}"]
hosts_config.add_host "#{ENV['DOCKER_SLAVE_IP_ADDRESS']}", ["#{ENV['DOCKER_SLAVE_URL']}"]
end
config.vm.define "kali_linux-v2019.2.0-x86_64" do |kali_linux|
kali_linux.vm.box = "offensive-security/kali-linux"
kali_linux.vm.provider "virtualbox" do |vb|
vb.memory = "4096"
vb.customize ["modifyvm", :id, "--vram", "128"]
end
end
config.vm.define "pen_test_desktop-lubuntu-18.04.04-x86_64" do |lubuntu_desktop|
lubuntu_desktop.vm.box = "chenhan/lubuntu-desktop-18.04"
lubuntu_desktop.vm.box_version = "20180704.0.0"
lubuntu_desktop.vm.provision "shell", path: "scripts/sh/loicsetup.sh"
lubuntu_desktop.vm.provider "virtualbox" do |vb|
vb.memory = "4096"
vb.customize ["modifyvm", :id, "--vram", "128"]
end
end
end