From 13c0f6fed442176d545684201940903c6d03dc82 Mon Sep 17 00:00:00 2001 From: David Moreau-Simard Date: Wed, 7 Sep 2016 18:12:13 -0400 Subject: [PATCH] Add magnum testing support to scenario003 Change-Id: Idcf2a889baede92d4522537a192295bae6cde950 --- Puppetfile | 4 ++ README.md | 3 +- fixtures/scenario003.pp | 9 ++++ manifests/magnum.pp | 107 ++++++++++++++++++++++++++++++++++++++++ manifests/tempest.pp | 10 ++++ openstack_modules.txt | 1 + run_tests.sh | 10 ++++ zuul.d/base.yaml | 1 + 8 files changed, 144 insertions(+), 1 deletion(-) create mode 100644 manifests/magnum.pp diff --git a/Puppetfile b/Puppetfile index c836575ed..f9ce4d678 100644 --- a/Puppetfile +++ b/Puppetfile @@ -61,6 +61,10 @@ mod 'keystone', :git => 'https://opendev.org/openstack/puppet-keystone', :ref => 'master' +mod 'magnum', + :git => 'https://git.openstack.org/openstack/puppet-magnum', + :ref => 'master' + mod 'manila', :git => 'https://opendev.org/openstack/puppet-manila', :ref => 'master' diff --git a/README.md b/README.md index ab6587484..15b55c26d 100644 --- a/README.md +++ b/README.md @@ -62,8 +62,9 @@ scenario](#all-in-one). | ironic | | X | | | | | zaqar | | X | | | | | murano | | | X | | | +| magnum | | | X | | | | mistral | | | X | | | -| barbican | | X | | | | +| barbican | | X | X | | | | ceph | X | | | X | | | ceph rgw | | | | X | | | vitrage | X | | | | | diff --git a/fixtures/scenario003.pp b/fixtures/scenario003.pp index 5744ce621..6608b02a1 100644 --- a/fixtures/scenario003.pp +++ b/fixtures/scenario003.pp @@ -128,6 +128,11 @@ if $mistral_enabled { } include openstack_integration::provision +include openstack_integration::barbican +class { 'openstack_integration::magnum': + cert_manager_type => 'barbican' +} + class { 'openstack_integration::tempest': designate => $designate_enabled, trove => $trove_enabled, @@ -136,4 +141,8 @@ class { 'openstack_integration::tempest': horizon => true, murano => $murano_enabled, heat => true, + # NOTE(tobasco): We have tempest disabled because we cannot + # run it when instances does not have internet acces to + # deploy for example Docker. + magnum => false, } diff --git a/manifests/magnum.pp b/manifests/magnum.pp new file mode 100644 index 000000000..d4fd77ae3 --- /dev/null +++ b/manifests/magnum.pp @@ -0,0 +1,107 @@ +# Configure the Magnum service +# +# [*cert_manager_type*] +# (optional) Cert manager to use +# Can be 'barbican', 'x509keypair' or 'local'. +# Defaults to 'barbican'. +# + +class openstack_integration::magnum ( + $cert_manager_type = 'barbican' +) { + + include openstack_integration::config + include openstack_integration::params + + rabbitmq_user { 'magnum': + admin => true, + password => 'an_even_bigger_secret', + provider => 'rabbitmqctl', + require => Class['rabbitmq'], + } + rabbitmq_user_permissions { 'magnum@/': + configure_permission => '.*', + write_permission => '.*', + read_permission => '.*', + provider => 'rabbitmqctl', + require => Class['rabbitmq'], + } + + if $::openstack_integration::config::ssl { + openstack_integration::ssl_key { 'magnum': + require => Package['magnum-common'], + } + $key_file = "/etc/magnum/ssl/private/${::fqdn}.pem" + $crt_file = $::openstack_integration::params::cert_path + File[$key_file] ~> Service<| tag == 'magnum-service' |> + Exec['update-ca-certificates'] ~> Service<| tag == 'magnum-service' |> + } else { + $key_file = undef + $crt_file = undef + } + + class { 'magnum::keystone::auth': + public_url => "${::openstack_integration::config::base_url}:9511", + internal_url => "${::openstack_integration::config::base_url}:9511", + admin_url => "${::openstack_integration::config::base_url}:9511", + password => 'a_big_secret', + } + + class { 'magnum::keystone::authtoken': + password => 'a_big_secret', + user_domain_name => 'Default', + project_domain_name => 'Default', + auth_url => "${::openstack_integration::config::base_url}:35357/v3", + www_authenticate_uri => "${::openstack_integration::config::base_url}:5000/v3", + memcached_servers => $::openstack_integration::config::memcached_servers, + } + + class { 'magnum::db::mysql': + password => 'magnum', + } + + class { 'magnum::db': + database_connection => 'mysql+pymysql://magnum:magnum@127.0.0.1/magnum', + } + + class { 'magnum::keystone::domain': + domain_password => 'oh_my_no_secret', + } + + class { 'magnum::logging': + debug => true, + } + + class { 'magnum': + notification_transport_url => os_transport_url({ + 'transport' => $::openstack_integration::config::messaging_notify_proto, + 'host' => $::openstack_integration::config::host, + 'port' => $::openstack_integration::config::messaging_notify_port, + 'username' => 'magnum', + 'password' => 'an_even_bigger_secret', + }), + default_transport_url => os_transport_url({ + 'transport' => $::openstack_integration::config::messaging_default_proto, + 'host' => $::openstack_integration::config::host, + 'port' => $::openstack_integration::config::messaging_default_port, + 'username' => 'magnum', + 'password' => 'an_even_bigger_secret', + }), + rabbit_use_ssl => $::openstack_integration::config::ssl, + } + + class { 'magnum::api': + host => $::openstack_integration::config::host, + enabled_ssl => $::openstack_integration::config::ssl, + ssl_cert_file => $crt_file, + ssl_key_file => $key_file + } + + class { 'magnum::conductor': } + class { 'magnum::client': } + class { 'magnum::certificates': + cert_manager_type => $cert_manager_type + } + class { 'magnum::clients': } + +} diff --git a/manifests/tempest.pp b/manifests/tempest.pp index c41962094..5c2e28485 100644 --- a/manifests/tempest.pp +++ b/manifests/tempest.pp @@ -64,6 +64,10 @@ # (optional) Define if Neutron Dynamic routing needs to be tested. # Default to false. # +# [*magnum*] +# (optional) Define if Magmum needs to be tested. +# Default to false. +# # [*mistral*] # (optional) Define if Mistral needs to be tested. # Default to false. @@ -130,6 +134,7 @@ class openstack_integration::tempest ( $l2gw = false, $l2gw_switch = undef, $dr = false, + $magnum = false, $mistral = false, $murano = false, $neutron = true, @@ -272,4 +277,9 @@ class openstack_integration::tempest ( ec2api_tester_roles => ['member'], } + if $magnum { + class { 'tempest::magnum': + tempest_config_file => '/tmp/openstack/tempest/etc/tempest.conf', + } + } } diff --git a/openstack_modules.txt b/openstack_modules.txt index a93178955..98970c8fe 100644 --- a/openstack_modules.txt +++ b/openstack_modules.txt @@ -13,6 +13,7 @@ heat horizon ironic keystone +magnum manila mistral monasca diff --git a/run_tests.sh b/run_tests.sh index a165f5d0e..589347237 100755 --- a/run_tests.sh +++ b/run_tests.sh @@ -301,6 +301,16 @@ uses_debs || echo "test_telemetry_integration" >> /tmp/openstack/tempest/test-wh # https://bugs.launchpad.net/ironic/+bug/1554237 echo "ironic_tempest_plugin.tests.api.admin.test_drivers" >> /tmp/openstack/tempest/test-whitelist.txt +# NOTE(tobasco): Disabled because magnum network access from inside instance to +# deploy docker for example. +# Magnum +#echo "test_create_list_sign_delete_clusters" >> /tmp/openstack/tempest/test-whitelist.txt +# Below is here just for testing in ci, would be removed soon, at least below version of werkzeug is required for magnum tls to work +#if is_fedora; then +# $SUDO yum -y install http://cbs.centos.org/kojifiles/packages/python-werkzeug/0.11.6/1.el7/noarch/python-werkzeug-0.11.6-1.el7.noarch.rpm +# $SUDO systemctl restart openstack-magnum-* +#fi + # Zaqar echo "v2.test_queues.TestManageQueue" >> /tmp/openstack/tempest/test-whitelist.txt diff --git a/zuul.d/base.yaml b/zuul.d/base.yaml index b8750b9fc..9979fee7a 100644 --- a/zuul.d/base.yaml +++ b/zuul.d/base.yaml @@ -19,6 +19,7 @@ - openstack/puppet-horizon - openstack/puppet-ironic - openstack/puppet-keystone + - openstack/puppet-magnum - openstack/puppet-manila - openstack/puppet-mistral - openstack/puppet-monasca