From f890bfeb0d73d7560e378d2a690ffb56023b49ec Mon Sep 17 00:00:00 2001 From: Mark Vanderwiel Date: Tue, 3 Nov 2015 16:27:38 -0600 Subject: [PATCH] Fix interface selection to be automatic Added a list of possible interfaces for which the vagrant provisioner will choose the first one that is available. No more editing the test recipes. Cleaned up the os selection to hide the version specific stuff to be consistent with the environment logic. Fixed up some file modes. Forced the chef client config directory as it can search in bad places in some scenarios. Change-Id: I38a7a86b58893b912af99fabf04ca9052f914346 --- .chef/encrypted_data_bag_secret | 0 .chef/knife.rb | 0 Rakefile | 15 +++++++++------ aio-neutron.rb | 10 +++++++++- aio-nova.rb | 10 +++++++++- doc/aio-neutron.md | 4 ++-- doc/aio-nova.md | 2 +- doc/multi-nova.md | 4 ++-- multi-nova.rb | 20 ++++++++++++++++++-- roles/os-object-storage-setup.json | 0 vagrant_linux.rb | 3 ++- 11 files changed, 52 insertions(+), 16 deletions(-) mode change 100755 => 100644 .chef/encrypted_data_bag_secret mode change 100755 => 100644 .chef/knife.rb mode change 100755 => 100644 roles/os-object-storage-setup.json diff --git a/.chef/encrypted_data_bag_secret b/.chef/encrypted_data_bag_secret old mode 100755 new mode 100644 diff --git a/.chef/knife.rb b/.chef/knife.rb old mode 100755 new mode 100644 diff --git a/Rakefile b/Rakefile index e61925f..7a4e538 100644 --- a/Rakefile +++ b/Rakefile @@ -1,3 +1,6 @@ +current_dir = File.dirname(__FILE__) +client_opts = "--force-formatter -z --config #{current_dir}/.chef/knife.rb" + task default: ["test"] desc "Default gate tests to run" @@ -18,7 +21,7 @@ end desc "Destroy machines" task :destroy_machines do - run_command('chef-client --force-formatter -z destroy_all.rb') + run_command("chef-client #{client_opts} destroy_all.rb") end desc "Vendor your cookbooks/" @@ -36,22 +39,22 @@ end desc "All-in-One Neutron build" task :aio_neutron => :create_key do - run_command('chef-client --force-formatter -z vagrant_linux.rb aio-neutron.rb') + run_command("chef-client #{client_opts} vagrant_linux.rb aio-neutron.rb") end desc "All-in-One Nova-networking build" task :aio_nova => :create_key do - run_command('chef-client --force-formatter -z vagrant_linux.rb aio-nova.rb') + run_command("chef-client #{client_opts} vagrant_linux.rb aio-nova.rb") end desc "Multi-Neutron build" task :multi_neutron => :create_key do - run_command('chef-client --force-formatter -z vagrant_linux.rb multi-neutron.rb') + run_command("chef-client #{client_opts} vagrant_linux.rb multi-neutron.rb") end desc "Multi-Nova-networking build" task :multi_nova => :create_key do - run_command('chef-client --force-formatter -z vagrant_linux.rb multi-nova.rb') + run_command("chef-client #{client_opts} vagrant_linux.rb multi-nova.rb") end desc "Blow everything away" @@ -176,7 +179,7 @@ task :integration => [:create_key, :berks_vendor] do for i in 1..3 puts "####### Pass #{i}" # Kick off chef client in local mode, will converge OpenStack right on the gate job "in place" - sh %(sudo chef-client --force-logger -z -E integration-aio-neutron -r 'role[allinone-compute]','role[os-image-upload]','recipe[openstack-integration-test::setup]') + sh %(sudo chef-client #{client_opts} -E integration-aio-neutron -r 'role[allinone-compute]','role[os-image-upload]','recipe[openstack-integration-test::setup]') _dump_logs _setup_local_network if i == 1 _run_basic_queries diff --git a/aio-neutron.rb b/aio-neutron.rb index b0648ff..ba30775 100644 --- a/aio-neutron.rb +++ b/aio-neutron.rb @@ -15,7 +15,15 @@ controller_config = <<-ENDCONFIG v.customize ["modifyvm", :id, "--natdnshostresolver1", "on"] end config.vm.network "public_network", - bridge: '' + bridge: ["en0: USB Ethernet", + "en1: USB Ethernet", + "en2: USB Ethernet", + "en3: USB Ethernet", + "en4: USB Ethernet", + "en0: Wi-Fi (AirPort)", + "en1: Wi-Fi (AirPort)", + "en2: Wi-Fi (AirPort)", + "Intel(R) Centrino(R) Advanced-N 6205"] ENDCONFIG env = 'vagrant-aio-neutron' diff --git a/aio-nova.rb b/aio-nova.rb index 461da34..45cbb22 100644 --- a/aio-nova.rb +++ b/aio-nova.rb @@ -15,7 +15,15 @@ controller_config = <<-ENDCONFIG v.customize ["modifyvm", :id, "--natdnshostresolver1", "on"] end config.vm.network "public_network", - bridge: '' + bridge: ["en0: USB Ethernet", + "en1: USB Ethernet", + "en2: USB Ethernet", + "en3: USB Ethernet", + "en4: USB Ethernet", + "en0: Wi-Fi (AirPort)", + "en1: Wi-Fi (AirPort)", + "en2: Wi-Fi (AirPort)", + "Intel(R) Centrino(R) Advanced-N 6205"] ENDCONFIG env = 'vagrant-aio-nova' diff --git a/doc/aio-neutron.md b/doc/aio-neutron.md index ef4b850..08bf698 100644 --- a/doc/aio-neutron.md +++ b/doc/aio-neutron.md @@ -9,8 +9,8 @@ Changes need to be made to the aio-neutron.rb file. ### Device interface The device interface must be is specified by name in the aio-neutron.rb file. -There is one place to change, look for ``, -this is because of OVS needing to slurp up an adapter for internet access. +There is one place to change, look for `bridge: [....]`. If your interface is not in the list, add it. +This is because of OVS needing to slurp up an adapter for internet access. Note: To see a list of virtualbox network interface names use: `$ vboxmanage list bridgedifs` diff --git a/doc/aio-nova.md b/doc/aio-nova.md index b4754d6..a8e6803 100644 --- a/doc/aio-nova.md +++ b/doc/aio-nova.md @@ -9,7 +9,7 @@ Changes need to be made to the aio-nova.rb file. ### Device interface The device interface must be is specified by name in the aio-nova.rb file. -There is one place to change, look for ``. +There is one place to change, look for `bridge: [....]`. If your interface is not in the list, add it. This is for an extra network adapter to your network, this is good practise for the more advance setups. diff --git a/doc/multi-nova.md b/doc/multi-nova.md index bca148c..51bf43c 100644 --- a/doc/multi-nova.md +++ b/doc/multi-nova.md @@ -18,11 +18,11 @@ For example, on my home network, my laptop has an IP of 192.168.1.xxx, so I set ### Device interface The device interface must be is specified by name in the multi-nova.rb file. -There are two places to change, look for ``. +There are two places to change, look for `bridge: [....]`. If your interface is not in the list, add it. Note: To see a list of virtualbox network interface names use: `$ vboxmanage list bridgedifs` + For Windows 7, open the Control Panel, Network and Internet, Network Connections. Look in the Connectivity column for a row with "Internet access", and use the "Device Name". For example, 'Intel(R) Centrino(R) Advanced-N 6205'. -+ For Mac, this works from some: 'en0: Wi-Fi (AirPort)' ++ For Mac, this works from some: 'en0: Wi-Fi (AirPort)' or 'en3: USB Ethernet' + For Linux, ...TODO... diff --git a/multi-nova.rb b/multi-nova.rb index 0c3d73f..7e001a9 100644 --- a/multi-nova.rb +++ b/multi-nova.rb @@ -16,7 +16,15 @@ controller_config = <<-ENDCONFIG v.customize ["modifyvm", :id, "--natdnshostresolver1", "on"] end config.vm.network "public_network", ip: "172.16.100.60", - bridge: '' + bridge: ["en0: USB Ethernet", + "en1: USB Ethernet", + "en2: USB Ethernet", + "en3: USB Ethernet", + "en4: USB Ethernet", + "en0: Wi-Fi (AirPort)", + "en1: Wi-Fi (AirPort)", + "en2: Wi-Fi (AirPort)", + "Intel(R) Centrino(R) Advanced-N 6205"] ENDCONFIG env = 'vagrant-multi-nova' @@ -46,7 +54,15 @@ config.vm.provider "virtualbox" do |v| v.customize ["modifyvm", :id, "--natdnshostresolver1", "on"] end config.vm.network "public_network", ip: "172.16.100.#{ip_suff}", - bridge: '' + bridge: ["en0: USB Ethernet", + "en1: USB Ethernet", + "en2: USB Ethernet", + "en3: USB Ethernet", + "en4: USB Ethernet", + "en0: Wi-Fi (AirPort)", + "en1: Wi-Fi (AirPort)", + "en2: Wi-Fi (AirPort)", + "Intel(R) Centrino(R) Advanced-N 6205"] ENDCONFIG role 'os-compute-worker' chef_environment env diff --git a/roles/os-object-storage-setup.json b/roles/os-object-storage-setup.json old mode 100755 new mode 100644 diff --git a/vagrant_linux.rb b/vagrant_linux.rb index 416ea04..8f22442 100644 --- a/vagrant_linux.rb +++ b/vagrant_linux.rb @@ -8,7 +8,8 @@ vagrant_box 'ubuntu14' do url 'http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_ubuntu-14.04_chef-provisionerless.box' end -os = ENV['REPO_OS'] || 'ubuntu14' +os = 'ubuntu14' +os = 'centos7.1' if ENV['REPO_OS'].to_s.include?('centos') with_driver "vagrant:#{File.dirname(__FILE__)}/vms" with_machine_options vagrant_options: {