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