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