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
This commit is contained in:
Mark Vanderwiel 2015-11-03 16:27:38 -06:00
parent d037a24175
commit f890bfeb0d
11 changed files with 52 additions and 16 deletions

0
.chef/encrypted_data_bag_secret Executable file → Normal file
View File

0
.chef/knife.rb Executable file → Normal file
View File

View File

@ -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

View File

@ -15,7 +15,15 @@ controller_config = <<-ENDCONFIG
v.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
end
config.vm.network "public_network",
bridge: '<put your interface device name here>'
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'

View File

@ -15,7 +15,15 @@ controller_config = <<-ENDCONFIG
v.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
end
config.vm.network "public_network",
bridge: '<put your interface device name here>'
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'

View File

@ -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 `<put your interface device name here>`,
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`

View File

@ -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 `<put your interface device name here>`.
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.

View File

@ -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 `<put your interface device name here>`.
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...

View File

@ -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: '<put your interface device name here>'
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: '<put your interface device name here>'
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

0
roles/os-object-storage-setup.json Executable file → Normal file
View File

View File

@ -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: {