Merge pull request #159 from enovance/bug/81/sbadia
Expose image location to trusted clients (GH-81)
This commit is contained in:
		@@ -92,25 +92,20 @@ class cloud::image(
 | 
			
		||||
  $encoded_glance_password = uriescape($glance_db_password)
 | 
			
		||||
 | 
			
		||||
  class { 'glance::api':
 | 
			
		||||
    sql_connection    => "mysql://${encoded_glance_user}:${encoded_glance_password}@${glance_db_host}/glance",
 | 
			
		||||
    registry_host     => $openstack_vip,
 | 
			
		||||
    registry_port     => $ks_glance_registry_internal_port,
 | 
			
		||||
    verbose           => $verbose,
 | 
			
		||||
    debug             => $debug,
 | 
			
		||||
    auth_host         => $ks_keystone_internal_host,
 | 
			
		||||
    keystone_password => $ks_glance_password,
 | 
			
		||||
    keystone_tenant   => 'services',
 | 
			
		||||
    keystone_user     => 'glance',
 | 
			
		||||
    log_facility      => $log_facility,
 | 
			
		||||
    bind_host         => $api_eth,
 | 
			
		||||
    bind_port         => $ks_glance_api_internal_port,
 | 
			
		||||
    use_syslog        => $use_syslog,
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  #TODO(sbadia): Wait https://review.openstack.org/69688
 | 
			
		||||
  #See branch bug/81/sbadia and https://github.com/enovance/puppet-cloud/issues/81
 | 
			
		||||
  glance_api_config {
 | 
			
		||||
    'DEFAULT/show_image_direct_url': value => true;
 | 
			
		||||
    sql_connection        => "mysql://${encoded_glance_user}:${encoded_glance_password}@${glance_db_host}/glance",
 | 
			
		||||
    registry_host         => $openstack_vip,
 | 
			
		||||
    registry_port         => $ks_glance_registry_internal_port,
 | 
			
		||||
    verbose               => $verbose,
 | 
			
		||||
    debug                 => $debug,
 | 
			
		||||
    auth_host             => $ks_keystone_internal_host,
 | 
			
		||||
    keystone_password     => $ks_glance_password,
 | 
			
		||||
    keystone_tenant       => 'services',
 | 
			
		||||
    keystone_user         => 'glance',
 | 
			
		||||
    show_image_direct_url => true,
 | 
			
		||||
    log_facility          => $log_facility,
 | 
			
		||||
    bind_host             => $api_eth,
 | 
			
		||||
    bind_port             => $ks_glance_api_internal_port,
 | 
			
		||||
    use_syslog            => $use_syslog,
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  class { 'glance::registry':
 | 
			
		||||
 
 | 
			
		||||
@@ -19,61 +19,63 @@ require 'spec_helper'
 | 
			
		||||
 | 
			
		||||
describe 'cloud::image' do
 | 
			
		||||
 | 
			
		||||
  shared_examples_for 'openstack image' do
 | 
			
		||||
  let :params do
 | 
			
		||||
    { :glance_db_host                   => '10.0.0.1',
 | 
			
		||||
      :glance_db_user                   => 'glance',
 | 
			
		||||
      :glance_db_password               => 'secrete',
 | 
			
		||||
      :ks_keystone_internal_host        => '10.0.0.1',
 | 
			
		||||
      :ks_glance_internal_host          => '10.0.0.1',
 | 
			
		||||
      :openstack_vip                    => '10.0.0.42',
 | 
			
		||||
      :ks_glance_api_internal_port      => '9292',
 | 
			
		||||
      :ks_glance_registry_internal_port => '9191',
 | 
			
		||||
      :ks_glance_password               => 'secrete',
 | 
			
		||||
      :rabbit_host                      => '10.0.0.1',
 | 
			
		||||
      :rabbit_password                  => 'secrete',
 | 
			
		||||
      :rbd_store_user                   => 'glance',
 | 
			
		||||
      :rbd_store_pool                   => 'images',
 | 
			
		||||
      :debug                            => true,
 | 
			
		||||
      :verbose                          => true,
 | 
			
		||||
      :use_syslog                       => true,
 | 
			
		||||
      :log_facility                     => 'LOG_LOCAL0',
 | 
			
		||||
      :api_eth                          => '10.0.0.1'
 | 
			
		||||
    }
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
    let :params do
 | 
			
		||||
      { :glance_db_host                   => '10.0.0.1',
 | 
			
		||||
        :glance_db_user                   => 'glance',
 | 
			
		||||
        :glance_db_password               => 'secrete',
 | 
			
		||||
        :ks_keystone_internal_host        => '10.0.0.1',
 | 
			
		||||
        :ks_glance_internal_host          => '10.0.0.1',
 | 
			
		||||
        :openstack_vip                    => '10.0.0.42',
 | 
			
		||||
        :ks_glance_api_internal_port      => '9292',
 | 
			
		||||
        :ks_glance_registry_internal_port => '9191',
 | 
			
		||||
        :ks_glance_password               => 'secrete',
 | 
			
		||||
        :rabbit_host                      => '10.0.0.1',
 | 
			
		||||
        :rabbit_password                  => 'secrete',
 | 
			
		||||
        :rbd_store_user                   => 'glance',
 | 
			
		||||
        :rbd_store_pool                   => 'images',
 | 
			
		||||
        :debug                            => true,
 | 
			
		||||
        :verbose                          => true,
 | 
			
		||||
        :use_syslog                       => true,
 | 
			
		||||
        :log_facility                     => 'LOG_LOCAL0',
 | 
			
		||||
        :api_eth                          => '10.0.0.1' }
 | 
			
		||||
    end
 | 
			
		||||
  shared_examples_for 'openstack image' do
 | 
			
		||||
 | 
			
		||||
    it 'configure glance-api' do
 | 
			
		||||
      should contain_class('glance::api').with(
 | 
			
		||||
          :sql_connection        => 'mysql://glance:secrete@10.0.0.1/glance',
 | 
			
		||||
          :keystone_password     => 'secrete',
 | 
			
		||||
          :registry_host         => '10.0.0.42',
 | 
			
		||||
          :registry_port         => '9191',
 | 
			
		||||
          :keystone_tenant       => 'services',
 | 
			
		||||
          :keystone_user         => 'glance',
 | 
			
		||||
          :verbose               => true,
 | 
			
		||||
          :debug                 => true,
 | 
			
		||||
          :auth_host             => '10.0.0.1',
 | 
			
		||||
          :log_facility          => 'LOG_LOCAL0',
 | 
			
		||||
          :bind_host             => '10.0.0.1',
 | 
			
		||||
          :bind_port             => '9292',
 | 
			
		||||
          :use_syslog            => true
 | 
			
		||||
        )
 | 
			
		||||
        :sql_connection        => 'mysql://glance:secrete@10.0.0.1/glance',
 | 
			
		||||
        :keystone_password     => 'secrete',
 | 
			
		||||
        :registry_host         => '10.0.0.42',
 | 
			
		||||
        :registry_port         => '9191',
 | 
			
		||||
        :keystone_tenant       => 'services',
 | 
			
		||||
        :keystone_user         => 'glance',
 | 
			
		||||
        :show_image_direct_url => true,
 | 
			
		||||
        :verbose               => true,
 | 
			
		||||
        :debug                 => true,
 | 
			
		||||
        :auth_host             => '10.0.0.1',
 | 
			
		||||
        :log_facility          => 'LOG_LOCAL0',
 | 
			
		||||
        :bind_host             => '10.0.0.1',
 | 
			
		||||
        :bind_port             => '9292',
 | 
			
		||||
        :use_syslog            => true
 | 
			
		||||
      )
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    it 'configure glance-registry' do
 | 
			
		||||
      should contain_class('glance::registry').with(
 | 
			
		||||
          :sql_connection    => 'mysql://glance:secrete@10.0.0.1/glance',
 | 
			
		||||
          :keystone_password => 'secrete',
 | 
			
		||||
          :keystone_tenant   => 'services',
 | 
			
		||||
          :keystone_user     => 'glance',
 | 
			
		||||
          :verbose           => true,
 | 
			
		||||
          :debug             => true,
 | 
			
		||||
          :auth_host         => '10.0.0.1',
 | 
			
		||||
          :log_facility      => 'LOG_LOCAL0',
 | 
			
		||||
          :bind_host         => '10.0.0.1',
 | 
			
		||||
          :bind_port         => '9191',
 | 
			
		||||
          :use_syslog        => true
 | 
			
		||||
        )
 | 
			
		||||
        :sql_connection        => 'mysql://glance:secrete@10.0.0.1/glance',
 | 
			
		||||
        :keystone_password     => 'secrete',
 | 
			
		||||
        :keystone_tenant       => 'services',
 | 
			
		||||
        :keystone_user         => 'glance',
 | 
			
		||||
        :verbose               => true,
 | 
			
		||||
        :debug                 => true,
 | 
			
		||||
        :auth_host             => '10.0.0.1',
 | 
			
		||||
        :log_facility          => 'LOG_LOCAL0',
 | 
			
		||||
        :bind_host             => '10.0.0.1',
 | 
			
		||||
        :bind_port             => '9191',
 | 
			
		||||
        :use_syslog            => true
 | 
			
		||||
      )
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    # TODO(EmilienM) Disabled for now
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user