aboutsummaryrefslogtreecommitdiffstats
path: root/vagrant/prebuilt/Vagrantfile
blob: f7717635360eb5698e37b90f5adf9f8a1d9a46dd (plain)
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
# -*- encoding: utf-8 -*- 
# ============LICENSE_START======================================================= 
# org.onap.vvp/engagementmgr
# ===================================================================
# Copyright © 2017 AT&T Intellectual Property. All rights reserved.
# ===================================================================
#
# Unless otherwise specified, all software contained herein is licensed
# under the Apache License, Version 2.0 (the “License”);
# you may not use this software except in compliance with the License.
# You may obtain a copy of the License at
#
#             http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
#
#
# Unless otherwise specified, all documentation contained herein is licensed
# under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
# you may not use this documentation except in compliance with the License.
# You may obtain a copy of the License at
#
#             https://creativecommons.org/licenses/by/4.0/
#
# Unless required by applicable law or agreed to in writing, documentation
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# ============LICENSE_END============================================
#
# ECOMP is a trademark and service mark of AT&T Intellectual Property.
# -*- mode: ruby -*-
# # vi: set ft=ruby :
Vagrant.require_version ">= 1.6.0"
yaml_conf = YAML.load_file('config.yml')

Vagrant.configure("2") do |config|

  # always use Vagrant's insecure key
  config.ssh.insert_key = false

  # plugin conflict
  if Vagrant.has_plugin?("vagrant-vbguest") then
    config.vbguest.auto_update = false
  end

  yaml_conf["boxen"].each do |box|
    config.vm.define box["name"] do |conf|
      conf.vm.box = box["box"]
      conf.vm.box_version = ">= 1151.0.0"
      conf.vm.box_url = "http://stable.release.core-os.net/amd64-usr/current/coreos_production_vagrant.json"

      ["vmware_fusion", "vmware_workstation"].each do |vmware|
        conf.vm.provider vmware do |v, override|
          v.vmx['numvcpus'] = box["cpus"]
          v.vmx['memsize'] = box["memory"]
          v.gui = false

          override.vm.box_url = "http://%s.release.core-os.net/amd64-usr/current/coreos_production_vagrant_vmware_fusion.json" % $update_channel
        end # vmware
      end # override

      conf.vm.provider :virtualbox do |v|
        v.cpus = box["cpus"]
        v.gui = false
        v.memory = box["memory"]

        # On VirtualBox, we don't have guest additions or a functional vboxsf
        # in CoreOS, so tell Vagrant that so it can be smarter.
        v.check_guest_additions = false
        v.functional_vboxsf     = false
      end # v

      conf.vm.network :private_network, :ip => box["ips"][0]
      conf.vm.provision "ansible" do |ansible|
        ansible.extra_vars   = { hosts: yaml_conf["hosts"]}
        ansible.playbook     = "../../ansible/infrastructure.yml"
      end # ansible
    end # conf
  end # box
end # config