blob: a7b293f7af4d30250affe27834602a9acff7344e [file] [log] [blame]
Michael Hwang2de95ed2018-08-01 16:22:13 -04001# ============LICENSE_START=======================================================
2# org.onap.dcae
3# ================================================================================
4# Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
5# ================================================================================
6# Licensed under the Apache License, Version 2.0 (the "License");
7# you may not use this file except in compliance with the License.
8# You may obtain a copy of the License at
9#
10# http://www.apache.org/licenses/LICENSE-2.0
11#
12# Unless required by applicable law or agreed to in writing, software
13# distributed under the License is distributed on an "AS IS" BASIS,
14# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15# See the License for the specific language governing permissions and
16# limitations under the License.
17# ============LICENSE_END=========================================================
18#
19# ECOMP is a trademark and service mark of AT&T Intellectual Property.
20
21# -*- mode: ruby -*-
22# vi: set ft=ruby :
23
24Vagrant.configure("2") do |config|
25 # use official ubuntu image for virtualbox
26 config.vm.provider "virtualbox" do |vb, override|
27 override.vm.box = "ubuntu/xenial64"
28 override.vm.synced_folder ".", "/srv/dcae-onboarding"
29 vb.customize ["modifyvm", :id, "--memory", "1024"]
30 vb.customize ["modifyvm", :id, "--cpus", "2"]
31 end
32
33 # use third party image and NFS sharing for lxc
34 config.vm.provider "lxc" do |_, override|
35 override.vm.box = "generic/ubuntu1604"
36 override.vm.synced_folder ".", "/srv/dcae-onboarding", :type => "nfs"
37 end
38
39 # use third party image and NFS sharing for libvirt
40 config.vm.provider "libvirt" do |_, override|
41 override.vm.box = "generic/ubuntu1604"
42 override.vm.synced_folder ".", "/srv/dcae-onboarding", :type => "nfs"
43 end
44
45 # configure shared package cache if possible
46 if Vagrant.has_plugin?("vagrant-cachier")
47 config.cache.enable :apt
48 config.cache.scope = :box
49 end
50
51 # port forward for webrick on 3000
52 # Access to docker engine
53 config.vm.network :forwarded_port, :guest => 2376, :host => 2376
54 # Access to consul
55 config.vm.network :forwarded_port, :guest => 8500, :host => 8500
56 # Access to config binding
57 config.vm.network :forwarded_port, :guest => 10000, :host => 10000
58 # Access to onboarding db
59 config.vm.network :forwarded_port, :guest => 5432, :host => 5432
60 # Access to local docker registry
61 config.vm.network :forwarded_port, :guest => 8443, :host => 8443
62
63 # Access to ephemeral ports which docker engine uses when using the
64 # -P option when doing "docker run". The range comes from
65 # /proc/sys/net/ipv4/ip_local_port_range and its a small slice of the range.
66 (32768..32775).each do |ephemeral_port|
67 config.vm.network :forwarded_port, :guest => ephemeral_port, :host => ephemeral_port
68 end
69
70 # provision using a simple shell script
71 config.vm.provision :shell, :path => "provision.sh"
72end