diff --git a/Rakefile b/Rakefile index 0f59962..b4b709c 100644 --- a/Rakefile +++ b/Rakefile @@ -21,7 +21,7 @@ end desc "Destroy machines" task :destroy_machines do - run_command("chef-client #{client_opts} destroy_all.rb") + run_command("chef-client #{client_opts} -o 'provisioning::destroy_all'") end desc "Vendor your cookbooks/" @@ -83,7 +83,7 @@ end # use the correct environment depending on platform if File.exist?('/usr/bin/apt-get') - @platform = 'ubuntu14' + @platform = 'ubuntu16' elsif File.exist?('/usr/bin/yum') @platform = 'centos7' end @@ -97,7 +97,7 @@ def _run_env_queries # rubocop:disable Metrics/MethodLength false ) case @platform - when 'ubuntu14' + when 'ubuntu16' _run_commands('basic debian env queries', { 'ifconfig' => [''], 'cat' => ['/etc/apt/sources.list']}, @@ -118,11 +118,11 @@ def _run_basic_queries # rubocop:disable Metrics/MethodLength 'curl' => ['-v http://localhost', '-kv https://localhost'], 'sudo netstat' => ['-nlp'], 'nova-manage' => ['version', 'db version'], - 'nova' => %w(--version service-list hypervisor-list image-list flavor-list), + 'nova' => %w(--version service-list hypervisor-list flavor-list), 'glance-manage' => %w(db_version), 'glance' => %w(--version image-list), 'keystone-manage' => %w(db_version), - 'keystone' => %w(--version user-list endpoint-list role-list service-list tenant-list), + 'openstack' => ['--version', 'user list', 'endpoint list', 'role list', 'service list', 'project list'], 'cinder-manage' => ['version list', 'db version'], 'cinder' => %w(--version list), 'heat-manage' => ['db_version', 'service list'], @@ -131,7 +131,7 @@ def _run_basic_queries # rubocop:disable Metrics/MethodLength 'ovs-vsctl' => %w(show) } ) case @platform - when 'ubuntu14' + when 'ubuntu16' _run_commands('basic debian test queries', { 'rabbitmqctl' => %w(cluster_status), 'ifconfig' => ['']} @@ -155,32 +155,30 @@ end # Helper for setting up basic nova tests def _run_nova_tests(pass) # rubocop:disable Metrics/MethodLength _run_commands('cinder storage volume create', { - 'cinder' => ['list', "create --display_name test_volume_#{pass} 1"], + 'openstack' => ['volume list', "volume create --description test_volume_#{pass} 1"], 'sleep' => ['10'] } ) _run_commands('cinder storate volume query', { - 'cinder' => ['list'] } + 'openstack' => ['volume list'] } ) - uuid = `sudo bash -c ". /root/openrc && cinder list | grep test_volume_#{pass} | cut -d ' ' -f 2"` + uuid = `sudo bash -c ". /root/openrc && openstack volume list | grep test_volume_#{pass} | cut -d ' ' -f 2"` _run_commands('nova server create', { - 'nova' => ['list', "boot test --image cirros --flavor 1 --block-device-mapping vdb=#{uuid.chomp!}:::1"], + 'openstack' => ['server list', "server create --image cirros --flavor 1 --block-device-mapping vdb=#{uuid.chomp!}:::1 test"], 'sleep' => ['40'] } ) _run_commands('nova server cleanup', { - 'nova' => ['list', 'show test', 'delete test'], - 'sleep' => ['25'], - 'cinder' => ['list'] } + 'openstack' => ['server list', 'server show test', 'server delete test'], + 'sleep' => ['25']} ) _run_commands('nova server query', { - 'nova' => ['list'] } + 'openstack' => ['volume list', 'server list'] } ) end # Helper for setting up neutron local network def _setup_local_network # rubocop:disable Metrics/MethodLength _run_commands('neutron local network setup', { - 'neutron' => ['net-create local_net --provider:network_type local --shared', - 'subnet-create local_net --name local_subnet 192.168.1.0/24'] } + 'openstack' => ['network create --share local_net'] } ) end @@ -225,7 +223,8 @@ task :integration => [:create_key, :berks_vendor] do ensure # make sure logs are saved, pass or fail _save_logs("pass#{i}", log_dir) - sh %(sudo chown -R $USER #{log_dir}) + sh %(sudo chown -R $USER #{log_dir}/pass#{i}) + sh %(sudo chmod -R go+rx #{log_dir}/pass#{i}) end end # Run the tempest formal tests, setup with the openstack-integration-test cookbook diff --git a/environments/allinone-centos7.json b/environments/allinone-centos7.json index 5b0f521..0d8b8fe 100644 --- a/environments/allinone-centos7.json +++ b/environments/allinone-centos7.json @@ -19,10 +19,6 @@ } } }, - "yum": { - "rdo_delorean_enabled": true, - "gpgcheck": false - }, "mq": { "user": "admin" }, diff --git a/environments/allinone-ubuntu14.json b/environments/allinone-ubuntu16.json similarity index 90% rename from environments/allinone-ubuntu14.json rename to environments/allinone-ubuntu16.json index 462b948..8150690 100644 --- a/environments/allinone-ubuntu14.json +++ b/environments/allinone-ubuntu16.json @@ -1,5 +1,5 @@ { - "name": "allinone-ubuntu14", + "name": "allinone-ubuntu16", "description": "Environment used in testing the upstream cookbooks and reference Chef repository with vagrant. To be used with the vagrantfile-allinone vagrantfile. Defines the necessary attributes for a working all-in-one openstack deployment, using neutron for the networking component, and the openvswitch neutron plugin", "cookbook_versions": { }, @@ -16,9 +16,6 @@ "override_attributes": { "openstack": { "telemetry": { - "platform": { - "client_packages": ["python-ceilometerclient"] - }, "conf": { "DEFAULT": { "meter_dispatchers": "database" diff --git a/environments/baremetal-aio-neutron.json b/environments/baremetal-aio-neutron.json index 66d5ab1..d0dab30 100644 --- a/environments/baremetal-aio-neutron.json +++ b/environments/baremetal-aio-neutron.json @@ -45,13 +45,13 @@ "tenant_network_type": "gre" }, "api": { - "bind_interface": "eth1" + "bind_interface": "enp0s8" }, "quota": { "floatingip": "50" }, "l3": { - "external_network_bridge_interface": "eth1" + "external_network_bridge_interface": "enp0s8" } }, "block-storage": { diff --git a/environments/multi-node-centos7.json b/environments/multi-node-centos7.json index 529a260..93c66d9 100644 --- a/environments/multi-node-centos7.json +++ b/environments/multi-node-centos7.json @@ -80,10 +80,6 @@ "dashboard": { "server_hostname": "localhost" }, - "yum": { - "rdo_delorean_enabled": true, - "gpgcheck": false - }, "mq": { "user": "admin" }, @@ -98,7 +94,7 @@ } } }, - "tun_network_bridge_interface": "eth1", + "tun_network_bridge_interface": "enp0s8", "conf": { "DEFAULT": { "service_plugins": "router" diff --git a/environments/multi-node-ubuntu14.json b/environments/multi-node-ubuntu16.json similarity index 98% rename from environments/multi-node-ubuntu14.json rename to environments/multi-node-ubuntu16.json index d905d47..2fb13ff 100644 --- a/environments/multi-node-ubuntu14.json +++ b/environments/multi-node-ubuntu16.json @@ -1,5 +1,5 @@ { - "name": "multi-node-ubuntu14", + "name": "multi-node-ubuntu16", "cookbook_versions": { }, "json_class": "Chef::Environment", @@ -97,7 +97,7 @@ } } }, - "tun_network_bridge_interface": "eth1", + "tun_network_bridge_interface": "enp0s8", "conf": { "DEFAULT": { "service_plugins": "router" diff --git a/environments/vagrant-multi-centos7-neutron.json b/environments/vagrant-multi-centos7-neutron.json deleted file mode 100644 index 1ce52d2..0000000 --- a/environments/vagrant-multi-centos7-neutron.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "name": "vagrant-multi-neutron", - "description": "Environment used in testing the upstream cookbooks and reference Chef repository with vagrant. To be used with the Vagrantfile-multi-neutron vagrantfile. Defines the necessary attributes for a working mutltinode (1 controller/n computes) openstack deployment, using neutron (with gre tunnels between hosts) for the networking component.", - "cookbook_versions": { - }, - "json_class": "Chef::Environment", - "chef_type": "environment", - "default_attributes": { - }, - "override_attributes": { - "mariadb": { - "mysqld": { - "lc_messages_dir": "/usr/share/mariadb" - } - }, - "openstack": { - "yum": { - "rdo_delorean_enabled": true - }, - "endpoints": { - "bind_interface": "enp0s8", - "compute-vnc-bind": { - "host": "0.0.0.0" - }, - "compute-vnc": { - "host": "0.0.0.0" - } - }, - "mq": { - "user": "admin" - }, - "network": { - "service_plugins": [ "neutron.services.l3_router.l3_router_plugin.L3RouterPlugin" ], - "dhcp": { - "enable_isolated_metadata": "True" - }, - "l3":{ - "external_network_bridge_interface": "enp0s8" - } - }, - "block-storage": { - "volume": { - "create_volume_group": true, - "default_volume_type": "lvm" - } - }, - "image": { - "image_upload": true - }, - "compute": { - "novnc_proxy": { - "bind_interface": "enp0s8", - "bind_address": "0.0.0.0" - }, - "libvirt": { - "virt_type": "qemu" - }, - "network": { - "public_interface": "enp0s8", - "service_type": "neutron" - } - }, - "orchestration": { - "heat_stack_user_role": "heat_stack_user", - "stack_user_domain_name": "heat", - "stack_domain_admin": "heat_stack_admin" - } - } - } -} diff --git a/environments/vagrant-multi-neutron.json b/environments/vagrant-multi-neutron.json deleted file mode 100644 index a92cb1d..0000000 --- a/environments/vagrant-multi-neutron.json +++ /dev/null @@ -1,106 +0,0 @@ -{ - "name": "vagrant-multi-neutron", - "description": "Environment used in testing the upstream cookbooks and reference Chef repository with vagrant. To be used with the Vagrantfile-multi-neutron vagrantfile. Defines the necessary attributes for a working mutltinode (1 controller/n computes) openstack deployment, using neutron (with gre tunnels between hosts) for the networking component.", - "cookbook_versions": { - }, - "json_class": "Chef::Environment", - "chef_type": "environment", - "default_attributes": { - }, - "override_attributes": { - "mysql": { - "allow_remote_root": true, - "root_network_acl": ["%"] - }, - "openstack": { - "mq": { - "user": "admin" - }, - "identity": { - "bind_interface": "eth1" - }, - "endpoints": { - "host": "192.168.100.60", - "bind-host": "192.168.100.60", - "mq": { - "host": "192.168.100.60" - }, - "db": { - "host": "192.168.100.60" - }, - "image-api-bind":{ - "host": "192.168.100.60" - }, - "image-api":{ - "host": "192.168.100.60" - }, - "compute-vnc-bind":{ - "host": "0.0.0.0", - "bind_interface": "eth1" - }, - "compute-vnc":{ - "host": "0.0.0.0", - "bind_interface": "eth1" - } - }, - "network": { - "service_plugins": [ "neutron.services.l3_router.l3_router_plugin.L3RouterPlugin" ], - "dhcp": { - "enable_isolated_metadata": "True" - }, - "openvswitch": { - "tunnel_id_ranges": "1:1000", - "enable_tunneling": "True", - "tunnel_type": "gre", - "tenant_network_type": "gre" - }, - "api": { - "bind_interface": "eth1" - }, - "quota": { - "floatingip": "50" - }, - "l3":{ - "external_network_bridge_interface": "eth1" - } - }, - "block-storage": { - "volume": { - "create_volume_group": true, - "default_volume_type": "lvm" - } - }, - "image": { - "api": { - "bind_interface": "eth1" - }, - "registry": { - "bind_interface": "eth1" - }, - "image_upload": true - }, - "compute": { - "enabled_apis": "ec2,osapi_compute", - "novnc_proxy": { - "bind_interface": "eth1", - "bind_address": "0.0.0.0" - }, - "libvirt": { - "virt_type": "qemu" - }, - "network": { - "public_interface": "eth1", - "service_type": "neutron" - }, - "config": { - "ram_allocation_ratio": 5.0 - } - }, - "orchestration": { - "heat_stack_user_role": "heat_stack_user", - "stack_user_domain_name": "heat", - "stack_domain_admin": "heat_stack_admin" - } - } - } -} diff --git a/roles/allinone.json b/roles/allinone.json index 2ed55c1..3d348f3 100644 --- a/roles/allinone.json +++ b/roles/allinone.json @@ -10,9 +10,11 @@ "run_list": [ "recipe[apt]", "recipe[yum]", + "recipe[build-essential]", "recipe[openstack-common]", "recipe[openstack-common::logging]", "recipe[openstack-common::sysctl]", + "recipe[openstack-common::client]", "recipe[openstack-ops-database::server]", "recipe[openstack-ops-database::openstack-db]", "recipe[openstack-ops-messaging::rabbitmq-server]", @@ -37,9 +39,9 @@ "recipe[openstack-compute::nova-setup]", "recipe[openstack-compute::identity_registration]", "recipe[openstack-compute::conductor]", - "recipe[openstack-compute::scheduler]", "recipe[openstack-compute::api-os-compute]", "recipe[openstack-compute::api-metadata]", + "recipe[openstack-compute::scheduler]", "recipe[openstack-compute::nova-cert]", "recipe[openstack-compute::vncproxy]", "recipe[openstack-compute::compute]", @@ -61,9 +63,7 @@ "recipe[openstack-telemetry::agent-notification]", "recipe[openstack-telemetry::collector]", "recipe[openstack-telemetry::identity_registration]", - "recipe[openstack-telemetry::client]", "recipe[openstack-image::image_upload]", - "recipe[openstack-common::client]", "recipe[openstack-dashboard::server]" ], "env_run_lists": { diff --git a/roles/multi-node-compute.json b/roles/multi-node-compute.json index ac3cf5b..e4239d2 100644 --- a/roles/multi-node-compute.json +++ b/roles/multi-node-compute.json @@ -10,6 +10,7 @@ "run_list": [ "recipe[apt]", "recipe[yum]", + "recipe[build-essential]", "recipe[openstack-common]", "recipe[openstack-compute::compute]", "recipe[openstack-network::ml2_core_plugin]", diff --git a/roles/multi-node-controller.json b/roles/multi-node-controller.json index 9f5eb4a..f175b65 100644 --- a/roles/multi-node-controller.json +++ b/roles/multi-node-controller.json @@ -10,9 +10,11 @@ "run_list": [ "recipe[apt]", "recipe[yum]", + "recipe[build-essential]", "recipe[openstack-common]", "recipe[openstack-common::logging]", "recipe[openstack-common::sysctl]", + "recipe[openstack-common::client]", "recipe[openstack-ops-database::server]", "recipe[openstack-ops-database::openstack-db]", "recipe[openstack-ops-messaging::rabbitmq-server]", @@ -37,9 +39,9 @@ "recipe[openstack-compute::nova-setup]", "recipe[openstack-compute::identity_registration]", "recipe[openstack-compute::conductor]", - "recipe[openstack-compute::scheduler]", "recipe[openstack-compute::api-os-compute]", "recipe[openstack-compute::api-metadata]", + "recipe[openstack-compute::scheduler]", "recipe[openstack-compute::nova-cert]", "recipe[openstack-compute::vncproxy]", "recipe[openstack-compute::identity_registration]", @@ -55,7 +57,6 @@ "recipe[openstack-orchestration::api-cloudwatch]", "recipe[openstack-orchestration::identity_registration]", "recipe[openstack-image::image_upload]", - "recipe[openstack-common::client]", "recipe[openstack-dashboard::server]" ], "env_run_lists": { diff --git a/site-cookbooks/provisioning/README.md b/site-cookbooks/provisioning/README.md index 97b2873..7d5bf51 100644 --- a/site-cookbooks/provisioning/README.md +++ b/site-cookbooks/provisioning/README.md @@ -2,7 +2,7 @@ This cookbook is used for serving chef-provisioning recipes for provisioning OpenStack with Chef. It is intended to be referenced by chef-client in -local-mode a la ChefDK. +local-mode a la chef-provisioning. # recipes @@ -14,3 +14,6 @@ local-mode a la ChefDK. ## provisioning::multi-node * provisions an OpenStack Controller with Compute nodes + +## provisioning::destroy_all +* destroys all the things! (really, all the running nodes) diff --git a/site-cookbooks/provisioning/recipes/allinone.rb b/site-cookbooks/provisioning/recipes/allinone.rb index 7e27d0c..15882fc 100644 --- a/site-cookbooks/provisioning/recipes/allinone.rb +++ b/site-cookbooks/provisioning/recipes/allinone.rb @@ -27,11 +27,12 @@ controller_config = <<-ENDCONFIG v.customize ["modifyvm", :id, "--nicpromisc2", "allow-all"] v.customize ["modifyvm", :id, "--natdnshostresolver1", "on"] end + config.vm.network "private_network", :type => 'dhcp', :adapter => 2 config.vm.network "public_network", bridge: #{bridge} ENDCONFIG -env = 'allinone-ubuntu14' +env = 'allinone-ubuntu16' env = 'allinone-centos7' if ENV['REPO_OS'].to_s.include?('centos') machine 'controller' do diff --git a/destroy_all.rb b/site-cookbooks/provisioning/recipes/destroy_all.rb similarity index 100% rename from destroy_all.rb rename to site-cookbooks/provisioning/recipes/destroy_all.rb diff --git a/site-cookbooks/provisioning/recipes/multi-node.rb b/site-cookbooks/provisioning/recipes/multi-node.rb index 89353a5..2a0fb7f 100644 --- a/site-cookbooks/provisioning/recipes/multi-node.rb +++ b/site-cookbooks/provisioning/recipes/multi-node.rb @@ -8,7 +8,7 @@ controller_config = <<-ENDCONFIG config.vm.network "forwarded_port", guest: 8774, host: 8774 # compute-api config.vm.network "forwarded_port", guest: 35357, host: 35357 config.vm.provider "virtualbox" do |v| - v.memory = 4096 + v.memory = 6144 v.cpus = 2 v.customize ["modifyvm", :id, "--nicpromisc2", "allow-all"] v.customize ["modifyvm", :id, "--nicpromisc3", "allow-all"] @@ -18,7 +18,7 @@ controller_config = <<-ENDCONFIG config.vm.network "private_network", ip: "192.168.101.60" ENDCONFIG -env = 'multi-node-ubuntu14' +env = 'multi-node-ubuntu16' env = 'multi-node-centos7' if ENV['REPO_OS'].to_s.include?('centos') # create controller-node with config defined above @@ -35,7 +35,7 @@ end # config for compute-node vagrant box compute_config = <<-ENDCONFIG config.vm.provider "virtualbox" do |v| - v.memory = 4048 + v.memory = 2048 v.cpus = 2 v.customize ["modifyvm", :id, "--nicpromisc2", "allow-all"] v.customize ["modifyvm", :id, "--nicpromisc3", "allow-all"] diff --git a/site-cookbooks/provisioning/recipes/vagrant_linux.rb b/site-cookbooks/provisioning/recipes/vagrant_linux.rb index 1b45fe3..1a410c7 100644 --- a/site-cookbooks/provisioning/recipes/vagrant_linux.rb +++ b/site-cookbooks/provisioning/recipes/vagrant_linux.rb @@ -1,17 +1,9 @@ require 'chef/provisioning/vagrant_driver' -vagrant_box 'centos7.2' do - url 'http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_centos-7.2_chef-provisionerless.box' -end +os = 'ubuntu/xenial64' +os = 'centos/7' if ENV['REPO_OS'].to_s.include?('centos') -vagrant_box 'ubuntu14' do - url 'http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_ubuntu-14.04_chef-provisionerless.box' -end - -os = 'ubuntu14' -os = 'centos7.2' if ENV['REPO_OS'].to_s.include?('centos') - -with_driver "vagrant:#{File.dirname(__FILE__)}/vms" +with_driver 'vagrant' with_machine_options vagrant_options: { 'vm.box' => os }