From 5fe4a2daf1a115946909102fcf4ffb24690a3bec Mon Sep 17 00:00:00 2001 From: Denis Egorenko Date: Wed, 11 May 2016 21:18:21 +0300 Subject: [PATCH] Create separate task for uploading Murano package When we have enabled Glare for Murano, Core library package will be uploaded to current Glance backend - Swift or RadosGW - hence we must be sure that both already prepared and ready to use. Change-Id: If0a684aa9b0410e28a82b1501633c0ebdb64dc67 Closes-bug: #1572785 (cherry picked from commit e8dd56f5f8ac639ebfef95c151225bc408ed2be2) --- .../examples/murano/tasks.yaml | 15 +++++++++ .../examples/murano/upload_murano_package.pp | 1 + .../manifests/murano/murano.pp | 14 -------- .../manifests/murano/upload_murano_package.pp | 6 ++++ .../modular/murano/upload_murano_package.pp | 3 ++ tests/noop/spec/hosts/murano/murano_spec.rb | 32 +------------------ .../murano/upload_murano_package_spec.rb | 21 ++++++++++++ 7 files changed, 47 insertions(+), 45 deletions(-) create mode 100644 deployment/puppet/openstack_tasks/examples/murano/upload_murano_package.pp create mode 100644 deployment/puppet/openstack_tasks/manifests/murano/upload_murano_package.pp create mode 100644 deployment/puppet/osnailyfacter/modular/murano/upload_murano_package.pp create mode 100644 tests/noop/spec/hosts/murano/upload_murano_package_spec.rb diff --git a/deployment/puppet/openstack_tasks/examples/murano/tasks.yaml b/deployment/puppet/openstack_tasks/examples/murano/tasks.yaml index 14ab74415a..23ec6ca1b2 100644 --- a/deployment/puppet/openstack_tasks/examples/murano/tasks.yaml +++ b/deployment/puppet/openstack_tasks/examples/murano/tasks.yaml @@ -112,3 +112,18 @@ puppet_modules: /etc/puppet/modules timeout: 1800 +- id: upload_murano_package + type: puppet + version: 2.1.0 + role: [primary-controller] + requires: [upload_cirros] + required_for: [post_deployment_end] + condition: + yaql_exp: > + $.murano.enabled and changedAny($.murano_settings.murano_glance_artifacts_plugin) + cross-depends: + - name: upload_cirros + parameters: + puppet_manifest: /etc/puppet/modules/openstack_tasks/examples/murano/upload_murano_package.pp + puppet_modules: /etc/puppet/modules + timeout: 180 diff --git a/deployment/puppet/openstack_tasks/examples/murano/upload_murano_package.pp b/deployment/puppet/openstack_tasks/examples/murano/upload_murano_package.pp new file mode 100644 index 0000000000..bd0d2da891 --- /dev/null +++ b/deployment/puppet/openstack_tasks/examples/murano/upload_murano_package.pp @@ -0,0 +1 @@ +class { '::openstack_tasks::murano::upload_murano_package' :} diff --git a/deployment/puppet/openstack_tasks/manifests/murano/murano.pp b/deployment/puppet/openstack_tasks/manifests/murano/murano.pp index ac5487841b..ba626baf6a 100644 --- a/deployment/puppet/openstack_tasks/manifests/murano/murano.pp +++ b/deployment/puppet/openstack_tasks/manifests/murano/murano.pp @@ -182,20 +182,6 @@ class openstack_tasks::murano::murano { lb_defaults => $lb_defaults } - if roles_include('primary-controller') { - - $internal_auth_url = "${internal_auth_protocol}://${internal_auth_address}:5000" - $admin_identity_url = "${admin_auth_protocol}://${admin_auth_address}:35357" - - class { '::osnailyfacter::wait_for_keystone_backends':} - murano::application { 'io.murano' : } - - Class['::osnailyfacter::wait_for_keystone_backends'] -> ::Osnailyfacter::Wait_for_backend['murano-api'] - ::Osnailyfacter::Wait_for_backend['murano-api'] -> Murano::Application['io.murano'] - - Service['murano-api'] -> Murano::Application['io.murano'] - } - Firewall[$firewall_rule] -> Class['::murano::api'] Service['murano-api'] -> ::Osnailyfacter::Wait_for_backend['murano-api'] diff --git a/deployment/puppet/openstack_tasks/manifests/murano/upload_murano_package.pp b/deployment/puppet/openstack_tasks/manifests/murano/upload_murano_package.pp new file mode 100644 index 0000000000..a63c959dab --- /dev/null +++ b/deployment/puppet/openstack_tasks/manifests/murano/upload_murano_package.pp @@ -0,0 +1,6 @@ +class openstack_tasks::murano::upload_murano_package { + + notice('MODULAR: murano/upload_murano_package.pp') + + murano::application { 'io.murano' : } +} diff --git a/deployment/puppet/osnailyfacter/modular/murano/upload_murano_package.pp b/deployment/puppet/osnailyfacter/modular/murano/upload_murano_package.pp new file mode 100644 index 0000000000..3bfe9b5a66 --- /dev/null +++ b/deployment/puppet/osnailyfacter/modular/murano/upload_murano_package.pp @@ -0,0 +1,3 @@ +class { '::openstack_tasks::murano::upload_murano_package' :} + +warning('osnailyfacter/modular/./murano/upload_murano_package.pp is deprecated in mitaka and will be removed in newton. Please use openstack_tasks/examples/./murano/upload_murano_package.pp') diff --git a/tests/noop/spec/hosts/murano/murano_spec.rb b/tests/noop/spec/hosts/murano/murano_spec.rb index 258b7ad896..41cbc8e8d4 100644 --- a/tests/noop/spec/hosts/murano/murano_spec.rb +++ b/tests/noop/spec/hosts/murano/murano_spec.rb @@ -197,37 +197,7 @@ describe manifest do it { should contain_concat__fragment('murano_dashboard_section').with_content(/METADATA_CACHE_DIR = '\/var\/cache\/murano-dashboard'/)} it { should_not contain_exec('django_syncdb') } - enable = (Noop.hiera_structure('murano/enabled') and Noop.hiera('role') == 'primary-controller') - - context 'on primary controller', :if => enable do - it 'should declare murano::application resource correctly' do - should contain_murano__application('io.murano') - end - - it 'should have explicit ordering between LB classes and particular actions' do - expect(graph).to ensure_transitive_dependency("Haproxy_backend_status[keystone-public]", - "Haproxy_backend_status[murano-api]") - expect(graph).to ensure_transitive_dependency("Haproxy_backend_status[keystone-admin]", - "Haproxy_backend_status[murano-api]") - expect(graph).to ensure_transitive_dependency("Haproxy_backend_status[murano-api]", - "Murano::Application[io.murano]") - end - # Test for non-haproxy backend - it { - if Noop.hiera('external_lb', false) - url = admin_url - provider = 'http' - else - url = 'http://' + service_endpoint + ':10000/;csv' - provider = Puppet::Type.type(:haproxy_backend_status).defaultprovider.name - end - should contain_haproxy_backend_status('keystone-admin').with( - :url => url, - :provider => provider - ) - } - end - + # Test for non-haproxy backend it { if Noop.hiera('external_lb', false) url = murano_url diff --git a/tests/noop/spec/hosts/murano/upload_murano_package_spec.rb b/tests/noop/spec/hosts/murano/upload_murano_package_spec.rb new file mode 100644 index 0000000000..92a8c2e6a1 --- /dev/null +++ b/tests/noop/spec/hosts/murano/upload_murano_package_spec.rb @@ -0,0 +1,21 @@ +# ROLE: primary-controller +# ROLE: controller + +require 'spec_helper' +require 'shared-examples' +manifest = 'murano/upload_murano_package.pp' + +describe manifest do + shared_examples 'catalog' do + + enable = (Noop.hiera_structure('murano/enabled') and Noop.hiera('role') == 'primary-controller') + + context 'on primary controller', :if => enable do + it 'should declare murano::application resource correctly' do + should contain_murano__application('io.murano') + end + end + end # end of shared_examples + + test_ubuntu_and_centos manifest +end