From bd2cfcfb9e9c4bee5aa68f4255da090e122baf4a Mon Sep 17 00:00:00 2001 From: Ivan Font Date: Fri, 7 Oct 2016 13:06:42 -0700 Subject: [PATCH] Updates to fix running with OpenStack Signed-off-by: Ivan Font --- Vagrantfile | 21 ++++++++++----------- vagrant_variables.yml.openstack | 28 +++++++++++++++++----------- 2 files changed, 27 insertions(+), 22 deletions(-) diff --git a/Vagrantfile b/Vagrantfile index 2a7aa5607..4afec8368 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -9,7 +9,7 @@ DEBUG = false config_file=File.expand_path(File.join(File.dirname(__FILE__), 'vagrant_variables.yml')) settings=YAML.load_file(config_file) -LABEL_PREFIX = settings['label_prefix'] ? settings['label_prefix'] : "" +LABEL_PREFIX = settings['label_prefix'] ? settings['label_prefix'] + "-" : "" NMONS = settings['mon_vms'] NOSDS = settings['osd_vms'] NMDSS = settings['mds_vms'] @@ -30,14 +30,6 @@ ETH = settings['eth'] DOCKER = settings['docker'] USER = settings['ssh_username'] -if BOX == 'openstack' - require 'vagrant-openstack-provider' - if not USER then - USER = settings['os_ssh_username'] - end - LABEL_PREFIX = "#{USER}-" -end - ASSIGN_STATIC_IP = !(BOX == 'openstack' or BOX == 'linode') ansible_provision = proc do |ansible| @@ -162,8 +154,15 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| os.image = settings['os_image'] os.keypair_name = settings['os_keypair_name'] os.security_groups = ['default'] - os.networks = settings['os_networks'] - os.floating_ip_pool = settings['os_floating_ip_pool'] + + if settings['os.networks'] then + os.networks = settings['os_networks'] + end + + if settings['os.floating_ip_pool'] then + os.floating_ip_pool = settings['os_floating_ip_pool'] + end + config.vm.provision "shell", inline: "true", upload_path: "/home/#{USER}/vagrant-shell" end elsif BOX == 'linode' diff --git a/vagrant_variables.yml.openstack b/vagrant_variables.yml.openstack index 34f96379d..797ecc42b 100644 --- a/vagrant_variables.yml.openstack +++ b/vagrant_variables.yml.openstack @@ -9,7 +9,9 @@ osd_vms: 1 mds_vms: 0 rgw_vms: 0 nfs_vms: 0 +rbd_mirror_vms: 0 client_vms: 0 +iscsi_gw_vms: 0 # Deploy RESTAPI on each of the Monitors #restapi: false @@ -31,17 +33,21 @@ vagrant_box: 'openstack' # When using Atomic Hosts (RHEL or CentOS), uncomment the line below to skip package installation #skip_tags: 'with_pkg' -# For deploying on OpenStack VMs uncomment these vars and assign values. +# Set a label prefix for the machines in this cluster to differentiate +# between different concurrent clusters e.g. your OpenStack username +label_prefix: 'your-openstack-username' + +# For deploying on OpenStack VMs uncomment these vars and assign values. # You can use env vars for the values if it makes sense. -#os_ssh_username : -#os_ssh_private_key_path : -#os_openstack_auth_url : -#os_username : ENV['OS_USERNAME'] -#os_password : ENV['OS_PASSWORD'] -#os_tenant_name : -#os_region : -#os_flavor : -#os_image : -#os_keypair_name : +#ssh_username : +#ssh_private_key_path : +#os_openstack_auth_url : +#os_username : +#os_password : +#os_tenant_name : +#os_region : +#os_flavor : +#os_image : +#os_keypair_name : #os_networks : #os_floating_ip_pool :