Victor Morales | 89ce321 | 2017-06-16 18:32:48 -0500 | [diff] [blame] | 1 | # -*- mode: ruby -*- |
| 2 | # vi: set ft=ruby : |
| 3 | |
| 4 | conf = { |
| 5 | # Generic parameters used across all ONAP components |
| 6 | 'public_net_id' => '00000000-0000-0000-0000-000000000000', |
| 7 | 'key_name' => 'ecomp_key', |
| 8 | 'pub_key' => '', |
| 9 | 'nexus_repo' => 'https://nexus.onap.org/content/sites/raw', |
| 10 | 'nexus_docker_repo' => 'nexus3.onap.org:10001', |
| 11 | 'nexus_username' => 'docker', |
| 12 | 'nexus_password' => 'docker', |
| 13 | 'dmaap_topic' => 'AUTO', |
| 14 | 'artifacts_version' => '1.0.0', |
| 15 | 'docker_version' => '1.0-STAGING-latest', |
| 16 | 'gerrit_branch' => 'master', |
| 17 | # Parameters for DCAE instantiation |
| 18 | 'dcae_zone' => 'iad4', |
| 19 | 'dcae_state' => 'vi', |
| 20 | 'openstack_tenant_id' => '', |
| 21 | 'openstack_username' => '', |
| 22 | 'openstack_api_key' => '', |
| 23 | 'openstack_password' => '', |
| 24 | 'nexus_repo_root' => 'https://nexus.onap.org', |
| 25 | 'nexus_url_snapshot' => 'https://nexus.onap.org/content/repositories/snapshots', |
| 26 | 'gitlab_branch' => 'master', |
Victor Morales | dd07480 | 2017-07-26 16:06:35 -0500 | [diff] [blame] | 27 | 'build_image' => 'True', |
Idan Amit | 0a29555 | 2017-08-17 17:03:59 +0300 | [diff] [blame] | 28 | 'pull_docker_image' => 'True', |
Victor Morales | dd07480 | 2017-07-26 16:06:35 -0500 | [diff] [blame] | 29 | 'odl_version' => '0.5.3-Boron-SR3', |
Idan Amit | 1690e08 | 2017-08-20 08:58:14 +0300 | [diff] [blame] | 30 | 'clone_repo' => 'True', |
Victor Morales | 2909e2e | 2017-08-08 15:51:52 -0500 | [diff] [blame] | 31 | 'compile_repo' => 'False', |
| 32 | 'enable_oparent' => 'True' |
Victor Morales | 89ce321 | 2017-06-16 18:32:48 -0500 | [diff] [blame] | 33 | } |
| 34 | |
Victor Morales | dd07480 | 2017-07-26 16:06:35 -0500 | [diff] [blame] | 35 | Vagrant.require_version ">= 1.8.6" |
| 36 | |
| 37 | # Determine the OS for the host computer |
| 38 | module OS |
| 39 | def OS.windows? |
| 40 | (/cygwin|mswin|mingw|bccwin|wince|emx/ =~ RUBY_PLATFORM) != nil |
| 41 | end |
| 42 | |
| 43 | def OS.mac? |
| 44 | (/darwin/ =~ RUBY_PLATFORM) != nil |
| 45 | end |
| 46 | |
| 47 | def OS.unix? |
| 48 | !OS.windows? |
| 49 | end |
| 50 | |
| 51 | def OS.linux? |
| 52 | OS.unix? and not OS.mac? |
| 53 | end |
| 54 | end |
| 55 | |
| 56 | if OS.windows? |
| 57 | puts "Vagrant launched from windows. This configuration has not fully tested." |
| 58 | end |
| 59 | |
| 60 | # Determine the provider used |
| 61 | provider = (ENV['VAGRANT_DEFAULT_PROVIDER'] || :virtualbox).to_sym |
| 62 | puts "Using #{provider} provider" |
| 63 | |
Victor Morales | 89ce321 | 2017-06-16 18:32:48 -0500 | [diff] [blame] | 64 | vd_conf = ENV.fetch('VD_CONF', 'etc/settings.yaml') |
| 65 | if File.exist?(vd_conf) |
| 66 | require 'yaml' |
| 67 | user_conf = YAML.load_file(vd_conf) |
| 68 | conf.update(user_conf) |
| 69 | end |
| 70 | |
| 71 | deploy_mode = ENV.fetch('DEPLOY_MODE', 'individual') |
| 72 | sdc_volume='vol1-sdc-data.vdi' |
| 73 | |
| 74 | Vagrant.configure("2") do |config| |
| 75 | |
| 76 | if ENV['http_proxy'] != nil and ENV['https_proxy'] != nil and ENV['no_proxy'] != nil |
| 77 | if not Vagrant.has_plugin?('vagrant-proxyconf') |
| 78 | system 'vagrant plugin install vagrant-proxyconf' |
| 79 | raise 'vagrant-proxyconf was installed but it requires to execute again' |
| 80 | end |
| 81 | config.proxy.http = ENV['http_proxy'] |
| 82 | config.proxy.https = ENV['https_proxy'] |
| 83 | config.proxy.no_proxy = ENV['no_proxy'] |
| 84 | end |
| 85 | |
Victor Morales | d403648 | 2017-08-15 17:54:14 -0500 | [diff] [blame] | 86 | if Vagrant.has_plugin?('vagrant-vbguest') |
| 87 | puts 'vagrant-vbguest auto_update feature will be disable to avoid sharing conflicts' |
| 88 | config.vbguest.auto_update = false |
| 89 | end |
| 90 | |
Victor Morales | 89ce321 | 2017-06-16 18:32:48 -0500 | [diff] [blame] | 91 | config.vm.box = 'ubuntu/trusty64' |
Victor Morales | dd07480 | 2017-07-26 16:06:35 -0500 | [diff] [blame] | 92 | if provider == :libvirt |
| 93 | config.vm.box = 'sputnik13/trusty64' |
Victor Morales | f62e7b8 | 2017-07-27 17:26:06 -0500 | [diff] [blame] | 94 | if not Vagrant.has_plugin?('vagrant-libvirt') |
| 95 | system 'vagrant plugin install vagrant-libvirt' |
| 96 | raise 'vagrant-libvirt was installed but it requires to execute again' |
| 97 | end |
Victor Morales | dd07480 | 2017-07-26 16:06:35 -0500 | [diff] [blame] | 98 | end |
| 99 | if provider == :openstack |
| 100 | config.vm.box = nil |
| 101 | config.ssh.username = 'ubuntu' |
| 102 | if not Vagrant.has_plugin?('vagrant-openstack-provider') |
| 103 | system 'vagrant plugin install vagrant-openstack-provider' |
| 104 | raise 'vagrant-openstack-provider was installed but it requires to execute again' |
| 105 | end |
| 106 | end |
Victor Morales | 89ce321 | 2017-06-16 18:32:48 -0500 | [diff] [blame] | 107 | #config.vm.provision "docker" |
| 108 | config.vm.synced_folder './opt', '/opt/', create: true |
| 109 | config.vm.synced_folder './lib', '/var/onap/', create: true |
| 110 | config.vm.synced_folder '~/.m2', '/root/.m2/', create: true |
| 111 | |
Victor Morales | dd07480 | 2017-07-26 16:06:35 -0500 | [diff] [blame] | 112 | config.vm.provider :virtualbox do |v| |
Victor Morales | 89ce321 | 2017-06-16 18:32:48 -0500 | [diff] [blame] | 113 | v.customize ["modifyvm", :id, "--memory", 4 * 1024] |
| 114 | end |
Victor Morales | dd07480 | 2017-07-26 16:06:35 -0500 | [diff] [blame] | 115 | config.vm.provider :libvirt do |v| |
Victor Morales | 89ce321 | 2017-06-16 18:32:48 -0500 | [diff] [blame] | 116 | v.memory = 4 * 1024 |
| 117 | v.nested = true |
| 118 | end |
Victor Morales | dd07480 | 2017-07-26 16:06:35 -0500 | [diff] [blame] | 119 | config.vm.provider :openstack do |v| |
| 120 | |
| 121 | v.openstack_auth_url = ENV.fetch('OS_AUTH_URL', '') |
| 122 | v.tenant_name = ENV.fetch('OS_TENANT_NAME', '') |
| 123 | v.username = ENV.fetch('OS_USERNAME', '') |
| 124 | v.password = ENV.fetch('OS_PASSWORD', '') |
| 125 | v.region = ENV.fetch('OS_REGION_NAME', '') |
| 126 | v.identity_api_version = ENV.fetch('OS_IDENTITY_API_VERSION', '') |
| 127 | v.domain_name = ENV.fetch('OS_PROJECT_DOMAIN_ID', '') |
| 128 | v.project_name = ENV.fetch('OS_PROJECT_NAME', '') |
| 129 | |
| 130 | v.floating_ip_pool = ENV.fetch('OS_FLOATING_IP_POOL', '') |
| 131 | v.floating_ip_pool_always_allocate = (ENV['OS_FLOATING_IP_ALWAYS_ALLOCATE'] == 'true') |
| 132 | v.image = ENV.fetch('OS_IMAGE', '') |
| 133 | v.security_groups = [ENV.fetch('OS_SEC_GROUP', '')] |
| 134 | v.flavor = 'm1.medium' |
| 135 | v.networks = ENV.fetch('OS_NETWORK', '') |
| 136 | end |
Victor Morales | 89ce321 | 2017-06-16 18:32:48 -0500 | [diff] [blame] | 137 | |
| 138 | case deploy_mode |
| 139 | |
| 140 | when 'all-in-one' |
| 141 | |
| 142 | config.vm.define :all_in_one do |all_in_one| |
| 143 | all_in_one.vm.hostname = 'all-in-one' |
| 144 | all_in_one.vm.network :private_network, ip: '192.168.50.3' |
| 145 | all_in_one.vm.provider "virtualbox" do |v| |
| 146 | v.customize ["modifyvm", :id, "--memory", 12 * 1024] |
| 147 | unless File.exist?(sdc_volume) |
| 148 | v.customize ['createhd', '--filename', sdc_volume, '--size', 20 * 1024] |
| 149 | end |
| 150 | v.customize ['storageattach', :id, '--storagectl', 'SATAController', '--port', 1, '--device', 0, '--type', 'hdd', '--medium', sdc_volume] |
| 151 | end |
| 152 | all_in_one.vm.provider "libvirt" do |v| |
| 153 | v.memory = 12 * 1024 |
| 154 | v.nested = true |
| 155 | v.storage :file, path: sdc_volume, bus: 'sata', device: 'vdb', size: '2G' |
| 156 | end |
Victor Morales | dd07480 | 2017-07-26 16:06:35 -0500 | [diff] [blame] | 157 | all_in_one.vm.provider "openstack" do |v| |
| 158 | v.server_name = 'all-in-one' |
| 159 | v.flavor = 'm1.xlarge' |
| 160 | end |
Victor Morales | 89ce321 | 2017-06-16 18:32:48 -0500 | [diff] [blame] | 161 | all_in_one.vm.provision 'shell' do |s| |
Nate Potter | 8a0c945 | 2017-08-02 15:17:41 -0700 | [diff] [blame] | 162 | s.path = 'vagrant_utils/postinstall.sh' |
Idan Amit | bf1e7f0 | 2017-08-20 16:05:46 +0300 | [diff] [blame] | 163 | s.args = ['mr', 'sdc', 'aai', 'mso', 'robot', 'vid', 'sdnc', 'portal', 'dcae', 'policy', 'appc', 'vfc'] |
Victor Morales | 89ce321 | 2017-06-16 18:32:48 -0500 | [diff] [blame] | 164 | s.env = conf |
| 165 | end |
| 166 | end |
| 167 | |
| 168 | when 'individual' |
| 169 | |
| 170 | config.vm.define :dns do |dns| |
| 171 | dns.vm.hostname = 'dns' |
| 172 | dns.vm.network :private_network, ip: '192.168.50.3' |
| 173 | dns.vm.provider "virtualbox" do |v| |
| 174 | v.customize ["modifyvm", :id, "--memory", 1 * 1024] |
| 175 | end |
| 176 | dns.vm.provider "libvirt" do |v| |
| 177 | v.memory = 1 * 1024 |
| 178 | v.nested = true |
| 179 | end |
Victor Morales | dd07480 | 2017-07-26 16:06:35 -0500 | [diff] [blame] | 180 | dns.vm.provider "openstack" do |v| |
| 181 | v.server_name = 'dns' |
| 182 | v.flavor = 'm1.small' |
| 183 | end |
Victor Morales | 89ce321 | 2017-06-16 18:32:48 -0500 | [diff] [blame] | 184 | dns.vm.provision 'shell' do |s| |
Nate Potter | 8a0c945 | 2017-08-02 15:17:41 -0700 | [diff] [blame] | 185 | s.path = 'vagrant_utils/postinstall.sh' |
Victor Morales | 89ce321 | 2017-06-16 18:32:48 -0500 | [diff] [blame] | 186 | s.env = conf |
| 187 | end |
| 188 | end |
| 189 | |
Victor Morales | dd07480 | 2017-07-26 16:06:35 -0500 | [diff] [blame] | 190 | config.vm.define :mr do |mr| |
| 191 | mr.vm.hostname = 'message-router' |
| 192 | mr.vm.network :private_network, ip: '192.168.50.4' |
| 193 | mr.vm.provider "openstack" do |v| |
| 194 | v.server_name = 'message-router' |
| 195 | end |
| 196 | mr.vm.provision 'shell' do |s| |
Nate Potter | 8a0c945 | 2017-08-02 15:17:41 -0700 | [diff] [blame] | 197 | s.path = 'vagrant_utils/postinstall.sh' |
Victor Morales | 89ce321 | 2017-06-16 18:32:48 -0500 | [diff] [blame] | 198 | s.args = ['mr'] |
| 199 | s.env = conf |
| 200 | end |
| 201 | end |
| 202 | |
| 203 | config.vm.define :sdc do |sdc| |
| 204 | sdc.vm.hostname = 'sdc' |
| 205 | sdc.vm.network :private_network, ip: '192.168.50.5' |
| 206 | sdc.vm.provider "virtualbox" do |v| |
Victor Morales | 89ce321 | 2017-06-16 18:32:48 -0500 | [diff] [blame] | 207 | unless File.exist?(sdc_volume) |
| 208 | v.customize ['createhd', '--filename', sdc_volume, '--size', 20 * 1024] |
| 209 | end |
| 210 | v.customize ['storageattach', :id, '--storagectl', 'SATAController', '--port', 1, '--device', 0, '--type', 'hdd', '--medium', sdc_volume] |
| 211 | end |
| 212 | sdc.vm.provider "libvirt" do |v| |
Victor Morales | 89ce321 | 2017-06-16 18:32:48 -0500 | [diff] [blame] | 213 | v.storage :file, path: sdc_volume, bus: 'sata', device: 'vdb', size: '2G' |
| 214 | end |
Victor Morales | dd07480 | 2017-07-26 16:06:35 -0500 | [diff] [blame] | 215 | sdc.vm.provider "openstack" do |v| |
| 216 | v.server_name = 'sdc' |
| 217 | end |
Victor Morales | 89ce321 | 2017-06-16 18:32:48 -0500 | [diff] [blame] | 218 | sdc.vm.provision 'shell' do |s| |
Nate Potter | 8a0c945 | 2017-08-02 15:17:41 -0700 | [diff] [blame] | 219 | s.path = 'vagrant_utils/postinstall.sh' |
Idan Amit | bf1e7f0 | 2017-08-20 16:05:46 +0300 | [diff] [blame] | 220 | s.args = ['sdc'] |
Victor Morales | 89ce321 | 2017-06-16 18:32:48 -0500 | [diff] [blame] | 221 | s.env = conf |
| 222 | end |
| 223 | end |
Victor Morales | d403648 | 2017-08-15 17:54:14 -0500 | [diff] [blame] | 224 | |
Victor Morales | 89ce321 | 2017-06-16 18:32:48 -0500 | [diff] [blame] | 225 | config.vm.define :aai do |aai| |
| 226 | aai.vm.hostname = 'aai' |
| 227 | aai.vm.network :private_network, ip: '192.168.50.6' |
Victor Morales | dd07480 | 2017-07-26 16:06:35 -0500 | [diff] [blame] | 228 | aai.vm.provider "openstack" do |v| |
| 229 | v.server_name = 'aai' |
| 230 | end |
Victor Morales | d403648 | 2017-08-15 17:54:14 -0500 | [diff] [blame] | 231 | aai.vm.provision 'shell' do |s| |
Nate Potter | 8a0c945 | 2017-08-02 15:17:41 -0700 | [diff] [blame] | 232 | s.path = 'vagrant_utils/postinstall.sh' |
Victor Morales | 89ce321 | 2017-06-16 18:32:48 -0500 | [diff] [blame] | 233 | s.args = ['aai'] |
| 234 | s.env = conf |
| 235 | end |
| 236 | end |
Victor Morales | d403648 | 2017-08-15 17:54:14 -0500 | [diff] [blame] | 237 | |
Victor Morales | 89ce321 | 2017-06-16 18:32:48 -0500 | [diff] [blame] | 238 | config.vm.define :mso do |mso| |
Victor Morales | dd07480 | 2017-07-26 16:06:35 -0500 | [diff] [blame] | 239 | mso.vm.hostname = 'mso' |
Victor Morales | 89ce321 | 2017-06-16 18:32:48 -0500 | [diff] [blame] | 240 | mso.vm.network :private_network, ip: '192.168.50.7' |
Victor Morales | dd07480 | 2017-07-26 16:06:35 -0500 | [diff] [blame] | 241 | mso.vm.provider "openstack" do |v| |
| 242 | v.server_name = 'mso' |
| 243 | end |
Victor Morales | d403648 | 2017-08-15 17:54:14 -0500 | [diff] [blame] | 244 | mso.vm.provision 'shell' do |s| |
Nate Potter | 8a0c945 | 2017-08-02 15:17:41 -0700 | [diff] [blame] | 245 | s.path = 'vagrant_utils/postinstall.sh' |
Victor Morales | 89ce321 | 2017-06-16 18:32:48 -0500 | [diff] [blame] | 246 | s.args = ['mso'] |
| 247 | s.env = conf |
| 248 | end |
| 249 | end |
| 250 | |
| 251 | config.vm.define :robot do |robot| |
| 252 | robot.vm.hostname = 'robot' |
| 253 | robot.vm.network :private_network, ip: '192.168.50.8' |
Victor Morales | dd07480 | 2017-07-26 16:06:35 -0500 | [diff] [blame] | 254 | robot.vm.provider "openstack" do |v| |
| 255 | v.server_name = 'robot' |
| 256 | end |
Victor Morales | 89ce321 | 2017-06-16 18:32:48 -0500 | [diff] [blame] | 257 | robot.vm.provision 'shell' do |s| |
Nate Potter | 8a0c945 | 2017-08-02 15:17:41 -0700 | [diff] [blame] | 258 | s.path = 'vagrant_utils/postinstall.sh' |
Victor Morales | 89ce321 | 2017-06-16 18:32:48 -0500 | [diff] [blame] | 259 | s.args = ['robot'] |
| 260 | s.env = conf |
| 261 | end |
| 262 | end |
Victor Morales | d403648 | 2017-08-15 17:54:14 -0500 | [diff] [blame] | 263 | |
Victor Morales | 89ce321 | 2017-06-16 18:32:48 -0500 | [diff] [blame] | 264 | config.vm.define :vid do |vid| |
| 265 | vid.vm.hostname = 'vid' |
| 266 | vid.vm.network :private_network, ip: '192.168.50.9' |
Victor Morales | dd07480 | 2017-07-26 16:06:35 -0500 | [diff] [blame] | 267 | vid.vm.provider "openstack" do |v| |
| 268 | v.server_name = 'vid' |
| 269 | end |
Victor Morales | 89ce321 | 2017-06-16 18:32:48 -0500 | [diff] [blame] | 270 | vid.vm.provision 'shell' do |s| |
Nate Potter | 8a0c945 | 2017-08-02 15:17:41 -0700 | [diff] [blame] | 271 | s.path = 'vagrant_utils/postinstall.sh' |
Victor Morales | 89ce321 | 2017-06-16 18:32:48 -0500 | [diff] [blame] | 272 | s.args = ['vid'] |
| 273 | s.env = conf |
| 274 | end |
| 275 | end |
Victor Morales | d403648 | 2017-08-15 17:54:14 -0500 | [diff] [blame] | 276 | |
Victor Morales | 89ce321 | 2017-06-16 18:32:48 -0500 | [diff] [blame] | 277 | config.vm.define :sdnc do |sdnc| |
| 278 | sdnc.vm.hostname = 'sdnc' |
| 279 | sdnc.vm.network :private_network, ip: '192.168.50.10' |
Victor Morales | dd07480 | 2017-07-26 16:06:35 -0500 | [diff] [blame] | 280 | sdnc.vm.provider "openstack" do |v| |
| 281 | v.server_name = 'sdnc' |
| 282 | end |
Victor Morales | 89ce321 | 2017-06-16 18:32:48 -0500 | [diff] [blame] | 283 | sdnc.vm.provision 'shell' do |s| |
Nate Potter | 8a0c945 | 2017-08-02 15:17:41 -0700 | [diff] [blame] | 284 | s.path = 'vagrant_utils/postinstall.sh' |
Victor Morales | 89ce321 | 2017-06-16 18:32:48 -0500 | [diff] [blame] | 285 | s.args = ['sdnc'] |
| 286 | s.env = conf |
| 287 | end |
| 288 | end |
Victor Morales | d403648 | 2017-08-15 17:54:14 -0500 | [diff] [blame] | 289 | |
Victor Morales | 89ce321 | 2017-06-16 18:32:48 -0500 | [diff] [blame] | 290 | config.vm.define :portal do |portal| |
| 291 | portal.vm.hostname = 'portal' |
| 292 | portal.vm.network :private_network, ip: '192.168.50.11' |
Victor Morales | dd07480 | 2017-07-26 16:06:35 -0500 | [diff] [blame] | 293 | portal.vm.provider "openstack" do |v| |
| 294 | v.server_name = 'portal' |
| 295 | end |
Victor Morales | 89ce321 | 2017-06-16 18:32:48 -0500 | [diff] [blame] | 296 | portal.vm.provision 'shell' do |s| |
Nate Potter | 8a0c945 | 2017-08-02 15:17:41 -0700 | [diff] [blame] | 297 | s.path = 'vagrant_utils/postinstall.sh' |
Victor Morales | 89ce321 | 2017-06-16 18:32:48 -0500 | [diff] [blame] | 298 | s.args = ['portal'] |
| 299 | s.env = conf |
| 300 | end |
| 301 | end |
Victor Morales | d403648 | 2017-08-15 17:54:14 -0500 | [diff] [blame] | 302 | |
Victor Morales | 89ce321 | 2017-06-16 18:32:48 -0500 | [diff] [blame] | 303 | config.vm.define :dcae do |dcae| |
| 304 | dcae.vm.hostname = 'dcae' |
| 305 | dcae.vm.network :private_network, ip: '192.168.50.12' |
Victor Morales | dd07480 | 2017-07-26 16:06:35 -0500 | [diff] [blame] | 306 | dcae.vm.provider "openstack" do |v| |
| 307 | v.server_name = 'dcae' |
| 308 | end |
Victor Morales | 89ce321 | 2017-06-16 18:32:48 -0500 | [diff] [blame] | 309 | dcae.vm.provision 'shell' do |s| |
Nate Potter | 8a0c945 | 2017-08-02 15:17:41 -0700 | [diff] [blame] | 310 | s.path = 'vagrant_utils/postinstall.sh' |
Victor Morales | 89ce321 | 2017-06-16 18:32:48 -0500 | [diff] [blame] | 311 | s.args = ['dcae'] |
| 312 | s.env = conf |
| 313 | end |
| 314 | end |
Victor Morales | d403648 | 2017-08-15 17:54:14 -0500 | [diff] [blame] | 315 | |
Victor Morales | 89ce321 | 2017-06-16 18:32:48 -0500 | [diff] [blame] | 316 | config.vm.define :policy do |policy| |
| 317 | policy.vm.hostname = 'policy' |
| 318 | policy.vm.network :private_network, ip: '192.168.50.13' |
Victor Morales | dd07480 | 2017-07-26 16:06:35 -0500 | [diff] [blame] | 319 | policy.vm.provider "openstack" do |v| |
| 320 | v.server_name = 'policy' |
| 321 | end |
Victor Morales | 89ce321 | 2017-06-16 18:32:48 -0500 | [diff] [blame] | 322 | policy.vm.provision 'shell' do |s| |
Nate Potter | 8a0c945 | 2017-08-02 15:17:41 -0700 | [diff] [blame] | 323 | s.path = 'vagrant_utils/postinstall.sh' |
Victor Morales | 89ce321 | 2017-06-16 18:32:48 -0500 | [diff] [blame] | 324 | s.args = ['policy'] |
| 325 | s.env = conf |
| 326 | end |
| 327 | end |
Victor Morales | d403648 | 2017-08-15 17:54:14 -0500 | [diff] [blame] | 328 | |
Victor Morales | 89ce321 | 2017-06-16 18:32:48 -0500 | [diff] [blame] | 329 | config.vm.define :appc do |appc| |
| 330 | appc.vm.hostname = 'appc' |
| 331 | appc.vm.network :private_network, ip: '192.168.50.14' |
Victor Morales | dd07480 | 2017-07-26 16:06:35 -0500 | [diff] [blame] | 332 | appc.vm.provider "openstack" do |v| |
| 333 | v.server_name = 'appc' |
| 334 | end |
Victor Morales | 89ce321 | 2017-06-16 18:32:48 -0500 | [diff] [blame] | 335 | appc.vm.provision 'shell' do |s| |
Nate Potter | 8a0c945 | 2017-08-02 15:17:41 -0700 | [diff] [blame] | 336 | s.path = 'vagrant_utils/postinstall.sh' |
Victor Morales | 89ce321 | 2017-06-16 18:32:48 -0500 | [diff] [blame] | 337 | s.args = ['appc'] |
| 338 | s.env = conf |
| 339 | end |
| 340 | end |
| 341 | |
Victor Morales | dd07480 | 2017-07-26 16:06:35 -0500 | [diff] [blame] | 342 | config.vm.define :vfc do |vfc| |
| 343 | vfc.vm.hostname = 'vfc' |
| 344 | vfc.vm.network :private_network, ip: '192.168.50.15' |
| 345 | vfc.vm.provider "openstack" do |v| |
| 346 | v.server_name = 'vfc' |
| 347 | end |
Shashank Kumar Shankar | 6cc4a43 | 2017-09-05 13:26:19 -0700 | [diff] [blame] | 348 | vfc.vm.provision 'docker' |
Victor Morales | dd07480 | 2017-07-26 16:06:35 -0500 | [diff] [blame] | 349 | vfc.vm.provision 'shell' do |s| |
Nate Potter | 8a0c945 | 2017-08-02 15:17:41 -0700 | [diff] [blame] | 350 | s.path = 'vagrant_utils/postinstall.sh' |
Victor Morales | dd07480 | 2017-07-26 16:06:35 -0500 | [diff] [blame] | 351 | s.args = ['vfc'] |
| 352 | s.env = conf |
| 353 | end |
| 354 | end |
| 355 | |
Victor Morales | 000de53 | 2017-08-31 17:28:10 -0500 | [diff] [blame] | 356 | config.vm.define :multicloud do |multicloud| |
| 357 | multicloud.vm.hostname = 'multicloud' |
| 358 | multicloud.vm.network :private_network, ip: '192.168.50.16' |
| 359 | multicloud.vm.provider "openstack" do |v| |
| 360 | v.server_name = 'multicloud' |
| 361 | end |
| 362 | multicloud.vm.provision 'shell' do |s| |
| 363 | s.path = 'vagrant_utils/postinstall.sh' |
| 364 | s.args = ['multicloud'] |
| 365 | s.env = conf |
| 366 | end |
| 367 | end |
| 368 | |
Victor Morales | dd07480 | 2017-07-26 16:06:35 -0500 | [diff] [blame] | 369 | when 'testing' |
| 370 | |
| 371 | config.vm.define :testing do |testing| |
| 372 | test_suite = ENV.fetch('TEST_SUITE', '*') |
| 373 | test_case = ENV.fetch('TEST_CASE', '*') |
| 374 | |
| 375 | testing.vm.hostname = 'testing' |
| 376 | testing.vm.network :private_network, ip: '192.168.50.3' |
| 377 | testing.vm.synced_folder './tests', '/var/onap_tests/', create: true |
| 378 | testing.vm.provider "virtualbox" do |v| |
Victor Morales | 158c18c | 2017-08-06 11:23:15 -0500 | [diff] [blame] | 379 | v.customize ["modifyvm", :id, "--memory", 4 * 1024] |
Victor Morales | dd07480 | 2017-07-26 16:06:35 -0500 | [diff] [blame] | 380 | end |
| 381 | testing.vm.provider "libvirt" do |v| |
Victor Morales | 158c18c | 2017-08-06 11:23:15 -0500 | [diff] [blame] | 382 | v.memory = 4 * 1024 |
Victor Morales | dd07480 | 2017-07-26 16:06:35 -0500 | [diff] [blame] | 383 | v.nested = true |
| 384 | end |
| 385 | testing.vm.provider "openstack" do |v| |
| 386 | v.server_name = 'testing' |
| 387 | v.flavor = 'm1.small' |
| 388 | end |
| 389 | testing.vm.provision 'shell' do |s| |
Nate Potter | 8a0c945 | 2017-08-02 15:17:41 -0700 | [diff] [blame] | 390 | s.path = 'vagrant_utils/unit_testing.sh' |
Victor Morales | dd07480 | 2017-07-26 16:06:35 -0500 | [diff] [blame] | 391 | s.args = [test_suite, test_case] |
| 392 | s.env = conf |
| 393 | end |
| 394 | end |
| 395 | |
Victor Morales | 89ce321 | 2017-06-16 18:32:48 -0500 | [diff] [blame] | 396 | end |
| 397 | end |