forked from cloudfoundry/bosh
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVagrantfile
98 lines (83 loc) · 3.58 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
env = ENV.to_hash
vm_box = 'bosh-stemcell-dbef1d'
Vagrant.configure('2') do |config|
config.vm.box = vm_box
config.ssh.username = 'ubuntu'
config.vm.define :local do |local|
local.vm.box_url = "https://bosh-jenkins-artifacts.s3.amazonaws.com/bosh-vagrant-boxes/#{vm_box}-virtualbox.box"
local.vm.provider :virtualbox do |virtualbox|
virtualbox.customize ['modifyvm', :id, '--cpus', '2']
virtualbox.customize ['modifyvm', :id, '--memory', '2048']
end
end
config.vm.define :local2 do |local|
local.vm.box_url = "https://bosh-jenkins-artifacts.s3.amazonaws.com/bosh-vagrant-boxes/#{vm_box}-virtualbox.box"
local.vm.provider :virtualbox do |virtualbox|
virtualbox.customize ['modifyvm', :id, '--cpus', '2']
virtualbox.customize ['modifyvm', :id, '--memory', '2048']
end
end
config.vm.define :remote do |remote|
remote.vm.box_url = "https://bosh-jenkins-artifacts.s3.amazonaws.com/bosh-vagrant-boxes/#{vm_box}-aws.box"
remote.vm.provider :aws do |aws, override|
aws.instance_type = 'm1.large'
aws.access_key_id = env.fetch('BOSH_AWS_ACCESS_KEY_ID')
aws.secret_access_key = env.fetch('BOSH_AWS_SECRET_ACCESS_KEY')
aws.keypair_name = 'bosh'
aws.security_groups = ['bosh-stemcell']
aws.tags = { 'Name' => vm_box }
override.ssh.username = 'ubuntu'
override.ssh.private_key_path = '~/.ssh/id_rsa_bosh'
end
end
config.vm.provision :shell do |shell|
shell.inline = <<-BASH
cat > /etc/apt/sources.list <<EOS
deb http://us.archive.ubuntu.com/ubuntu/ raring main restricted
deb-src http://us.archive.ubuntu.com/ubuntu/ raring main restricted
deb http://us.archive.ubuntu.com/ubuntu/ raring-updates main restricted
deb-src http://us.archive.ubuntu.com/ubuntu/ raring-updates main restricted
deb http://security.ubuntu.com/ubuntu raring-security main restricted
deb-src http://security.ubuntu.com/ubuntu raring-security main restricted
deb http://security.ubuntu.com/ubuntu raring-security universe
deb-src http://security.ubuntu.com/ubuntu raring-security universe
deb http://security.ubuntu.com/ubuntu raring-security multiverse
deb-src http://security.ubuntu.com/ubuntu raring-security multiverse
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://us.archive.ubuntu.com/ubuntu/ raring universe
deb-src http://us.archive.ubuntu.com/ubuntu/ raring universe
deb http://us.archive.ubuntu.com/ubuntu/ raring-updates universe
deb-src http://us.archive.ubuntu.com/ubuntu/ raring-updates universe
deb http://us.archive.ubuntu.com/ubuntu/ raring multiverse
deb-src http://us.archive.ubuntu.com/ubuntu/ raring multiverse
deb http://us.archive.ubuntu.com/ubuntu/ raring-updates multiverse
deb-src http://us.archive.ubuntu.com/ubuntu/ raring-updates multiverse
EOS
apt-get -y update
BASH
end
config.vm.provision :shell do |shell|
shell.inline = <<-BASH
mkdir -p /mnt/stemcells
chown -R ubuntu /mnt/stemcells
mkdir -p /bosh/tmp
git --git-dir=/bosh/.git --work-tree=/bosh checkout /bosh
(cd /bosh && git submodule update --init --recursive)
chown -R ubuntu:ubuntu /bosh
(cd /bosh && bundle install --local)
BASH
end
config.omnibus.chef_version = :latest
config.berkshelf.enabled = true
config.vm.provision :chef_solo do |chef|
chef.run_list = %w(recipe[golang] recipe[stemcell-golang])
chef.json = {
go: {
version: '1.2.2',
}
}
end
config.vm.synced_folder '../.git', '/bosh/.git'
end