Adapt synced glance module
- add patch Ib44cf7825de33dc251812cb9138b821a397d77e7; - add patch I7f00b9cc20cb2d11eacbfaefb86f998247cf3454; - adapt openstack/glance; - add noop tests; Partially implements: blueprint upgrade-openstack-puppet-modules Change-Id: I79aaa391c7a405db9084f48261c1bca884a268e6
This commit is contained in:
parent
e1d3ab1cae
commit
cd6dcdab96
@ -68,32 +68,32 @@ class glance::backend::cinder(
|
||||
}
|
||||
|
||||
glance_api_config {
|
||||
'DEFAULT/cinder_api_insecure': value => $cinder_api_insecure;
|
||||
'DEFAULT/cinder_catalog_info': value => $cinder_catalog_info;
|
||||
'DEFAULT/cinder_http_retries': value => $cinder_http_retries;
|
||||
'glance_store/default_store': value => 'cinder';
|
||||
'glance_store/cinder_api_insecure': value => $cinder_api_insecure;
|
||||
'glance_store/cinder_catalog_info': value => $cinder_catalog_info;
|
||||
'glance_store/cinder_http_retries': value => $cinder_http_retries;
|
||||
'glance_store/default_store': value => 'cinder';
|
||||
}
|
||||
|
||||
glance_cache_config {
|
||||
'DEFAULT/cinder_api_insecure': value => $cinder_api_insecure;
|
||||
'DEFAULT/cinder_catalog_info': value => $cinder_catalog_info;
|
||||
'DEFAULT/cinder_http_retries': value => $cinder_http_retries;
|
||||
'glance_store/cinder_api_insecure': value => $cinder_api_insecure;
|
||||
'glance_store/cinder_catalog_info': value => $cinder_catalog_info;
|
||||
'glance_store/cinder_http_retries': value => $cinder_http_retries;
|
||||
}
|
||||
|
||||
if $cinder_endpoint_template {
|
||||
glance_api_config { 'DEFAULT/cinder_endpoint_template': value => $cinder_endpoint_template; }
|
||||
glance_cache_config { 'DEFAULT/cinder_endpoint_template': value => $cinder_endpoint_template; }
|
||||
glance_api_config { 'glance_store/cinder_endpoint_template': value => $cinder_endpoint_template; }
|
||||
glance_cache_config { 'glance_store/cinder_endpoint_template': value => $cinder_endpoint_template; }
|
||||
} else {
|
||||
glance_api_config { 'DEFAULT/cinder_endpoint_template': ensure => absent; }
|
||||
glance_cache_config { 'DEFAULT/cinder_endpoint_template': ensure => absent; }
|
||||
glance_api_config { 'glance_store/cinder_endpoint_template': ensure => absent; }
|
||||
glance_cache_config { 'glance_store/cinder_endpoint_template': ensure => absent; }
|
||||
}
|
||||
|
||||
if $cinder_ca_certificates_file {
|
||||
glance_api_config { 'DEFAULT/cinder_ca_certificates_file': value => $cinder_ca_certificates_file; }
|
||||
glance_cache_config { 'DEFAULT/cinder_ca_certificates_file': value => $cinder_ca_certificates_file; }
|
||||
glance_api_config { 'glance_store/cinder_ca_certificates_file': value => $cinder_ca_certificates_file; }
|
||||
glance_cache_config { 'glance_store/cinder_ca_certificates_file': value => $cinder_ca_certificates_file; }
|
||||
} else {
|
||||
glance_api_config { 'DEFAULT/cinder_ca_certificates_file': ensure => absent; }
|
||||
glance_cache_config { 'DEFAULT/cinder_ca_certificates_file': ensure => absent; }
|
||||
glance_api_config { 'glance_store/cinder_ca_certificates_file': ensure => absent; }
|
||||
glance_cache_config { 'glance_store/cinder_ca_certificates_file': ensure => absent; }
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -29,6 +29,9 @@
|
||||
# [*swift_store_endpoint_type*]
|
||||
# Optional. Default: 'internalURL'
|
||||
#
|
||||
# [*swift_store_region*]
|
||||
# Optional. Default: ''
|
||||
#
|
||||
class glance::backend::swift(
|
||||
$swift_store_user,
|
||||
$swift_store_key,
|
||||
@ -38,6 +41,7 @@ class glance::backend::swift(
|
||||
$swift_store_large_object_size = '5120',
|
||||
$swift_store_create_container_on_put = false,
|
||||
$swift_store_endpoint_type = 'internalURL',
|
||||
$swift_store_region = '',
|
||||
) {
|
||||
|
||||
glance_api_config {
|
||||
@ -45,11 +49,12 @@ class glance::backend::swift(
|
||||
'glance_store/swift_store_user': value => $swift_store_user;
|
||||
'glance_store/swift_store_key': value => $swift_store_key;
|
||||
'glance_store/swift_store_auth_address': value => $swift_store_auth_address;
|
||||
'DEFAULT/swift_store_container': value => $swift_store_container;
|
||||
'DEFAULT/swift_store_auth_version': value => $swift_store_auth_version;
|
||||
'DEFAULT/swift_store_create_container_on_put':
|
||||
'glance_store/swift_store_region': value => $swift_store_region;
|
||||
'glance_store/swift_store_container': value => $swift_store_container;
|
||||
'glance_store/swift_store_auth_version': value => $swift_store_auth_version;
|
||||
'glance_store/swift_store_create_container_on_put':
|
||||
value => $swift_store_create_container_on_put;
|
||||
'DEFAULT/swift_store_large_object_size':
|
||||
'glance_store/swift_store_large_object_size':
|
||||
value => $swift_store_large_object_size;
|
||||
'glance_store/swift_store_endpoint_type':
|
||||
value => $swift_store_endpoint_type;
|
||||
@ -59,11 +64,11 @@ class glance::backend::swift(
|
||||
'glance_store/swift_store_user': value => $swift_store_user;
|
||||
'glance_store/swift_store_key': value => $swift_store_key;
|
||||
'glance_store/swift_store_auth_address': value => $swift_store_auth_address;
|
||||
'DEFAULT/swift_store_container': value => $swift_store_container;
|
||||
'DEFAULT/swift_store_auth_version': value => $swift_store_auth_version;
|
||||
'DEFAULT/swift_store_create_container_on_put':
|
||||
'glance_store/swift_store_container': value => $swift_store_container;
|
||||
'glance_store/swift_store_auth_version': value => $swift_store_auth_version;
|
||||
'glance_store/swift_store_create_container_on_put':
|
||||
value => $swift_store_create_container_on_put;
|
||||
'DEFAULT/swift_store_large_object_size':
|
||||
'glance_store/swift_store_large_object_size':
|
||||
value => $swift_store_large_object_size;
|
||||
}
|
||||
|
||||
|
@ -69,15 +69,15 @@ class glance::backend::vsphere(
|
||||
$vcenter_api_retry_count = '10',
|
||||
) {
|
||||
glance_api_config {
|
||||
'DEFAULT/default_store': value => 'vsphere';
|
||||
'DEFAULT/vmware_api_insecure': value => $vcenter_api_insecure;
|
||||
'DEFAULT/vmware_server_host': value => $vcenter_host;
|
||||
'DEFAULT/vmware_server_username': value => $vcenter_user;
|
||||
'DEFAULT/vmware_server_password': value => $vcenter_password;
|
||||
'DEFAULT/vmware_datastore_name': value => $vcenter_datastore;
|
||||
'DEFAULT/vmware_store_image_dir': value => $vcenter_image_dir;
|
||||
'DEFAULT/vmware_task_poll_interval': value => $vcenter_task_poll_interval;
|
||||
'DEFAULT/vmware_api_retry_count': value => $vcenter_api_retry_count;
|
||||
'DEFAULT/vmware_datacenter_path': value => $vcenter_datacenter;
|
||||
'glance_store/default_store': value => 'vsphere';
|
||||
'glance_store/vmware_api_insecure': value => $vcenter_api_insecure;
|
||||
'glance_store/vmware_server_host': value => $vcenter_host;
|
||||
'glance_store/vmware_server_username': value => $vcenter_user;
|
||||
'glance_store/vmware_server_password': value => $vcenter_password;
|
||||
'glance_store/vmware_datastore_name': value => $vcenter_datastore;
|
||||
'glance_store/vmware_store_image_dir': value => $vcenter_image_dir;
|
||||
'glance_store/vmware_task_poll_interval': value => $vcenter_task_poll_interval;
|
||||
'glance_store/vmware_api_retry_count': value => $vcenter_api_retry_count;
|
||||
'glance_store/vmware_datacenter_path': value => $vcenter_datacenter;
|
||||
}
|
||||
}
|
||||
|
@ -32,18 +32,18 @@ describe 'glance::backend::cinder' do
|
||||
|
||||
it 'configures glance-api.conf' do
|
||||
is_expected.to contain_glance_api_config('glance_store/default_store').with_value('cinder')
|
||||
is_expected.to contain_glance_api_config('DEFAULT/cinder_api_insecure').with_value(false)
|
||||
is_expected.to contain_glance_api_config('DEFAULT/cinder_catalog_info').with_value('volume:cinder:publicURL')
|
||||
is_expected.to contain_glance_api_config('DEFAULT/cinder_http_retries').with_value('3')
|
||||
is_expected.to contain_glance_api_config('DEFAULT/cinder_ca_certificates_file').with(:ensure => 'absent')
|
||||
is_expected.to contain_glance_api_config('DEFAULT/cinder_endpoint_template').with(:ensure => 'absent')
|
||||
is_expected.to contain_glance_api_config('glance_store/cinder_api_insecure').with_value(false)
|
||||
is_expected.to contain_glance_api_config('glance_store/cinder_catalog_info').with_value('volume:cinder:publicURL')
|
||||
is_expected.to contain_glance_api_config('glance_store/cinder_http_retries').with_value('3')
|
||||
is_expected.to contain_glance_api_config('glance_store/cinder_ca_certificates_file').with(:ensure => 'absent')
|
||||
is_expected.to contain_glance_api_config('glance_store/cinder_endpoint_template').with(:ensure => 'absent')
|
||||
end
|
||||
it 'configures glance-cache.conf' do
|
||||
is_expected.to contain_glance_cache_config('DEFAULT/cinder_api_insecure').with_value(false)
|
||||
is_expected.to contain_glance_cache_config('DEFAULT/cinder_catalog_info').with_value('volume:cinder:publicURL')
|
||||
is_expected.to contain_glance_cache_config('DEFAULT/cinder_http_retries').with_value('3')
|
||||
is_expected.to contain_glance_cache_config('DEFAULT/cinder_ca_certificates_file').with(:ensure => 'absent')
|
||||
is_expected.to contain_glance_cache_config('DEFAULT/cinder_endpoint_template').with(:ensure => 'absent')
|
||||
is_expected.to contain_glance_cache_config('glance_store/cinder_api_insecure').with_value(false)
|
||||
is_expected.to contain_glance_cache_config('glance_store/cinder_catalog_info').with_value('volume:cinder:publicURL')
|
||||
is_expected.to contain_glance_cache_config('glance_store/cinder_http_retries').with_value('3')
|
||||
is_expected.to contain_glance_cache_config('glance_store/cinder_ca_certificates_file').with(:ensure => 'absent')
|
||||
is_expected.to contain_glance_cache_config('glance_store/cinder_endpoint_template').with(:ensure => 'absent')
|
||||
end
|
||||
end
|
||||
|
||||
@ -59,18 +59,18 @@ describe 'glance::backend::cinder' do
|
||||
end
|
||||
it 'configures glance-api.conf' do
|
||||
is_expected.to contain_glance_api_config('glance_store/default_store').with_value('cinder')
|
||||
is_expected.to contain_glance_api_config('DEFAULT/cinder_api_insecure').with_value(true)
|
||||
is_expected.to contain_glance_api_config('DEFAULT/cinder_ca_certificates_file').with_value('/etc/ssh/ca.crt')
|
||||
is_expected.to contain_glance_api_config('DEFAULT/cinder_catalog_info').with_value('volume:cinder:internalURL')
|
||||
is_expected.to contain_glance_api_config('DEFAULT/cinder_endpoint_template').with_value('http://srv-foo:8776/v1/%(project_id)s')
|
||||
is_expected.to contain_glance_api_config('DEFAULT/cinder_http_retries').with_value('10')
|
||||
is_expected.to contain_glance_api_config('glance_store/cinder_api_insecure').with_value(true)
|
||||
is_expected.to contain_glance_api_config('glance_store/cinder_ca_certificates_file').with_value('/etc/ssh/ca.crt')
|
||||
is_expected.to contain_glance_api_config('glance_store/cinder_catalog_info').with_value('volume:cinder:internalURL')
|
||||
is_expected.to contain_glance_api_config('glance_store/cinder_endpoint_template').with_value('http://srv-foo:8776/v1/%(project_id)s')
|
||||
is_expected.to contain_glance_api_config('glance_store/cinder_http_retries').with_value('10')
|
||||
end
|
||||
it 'configures glance-cache.conf' do
|
||||
is_expected.to contain_glance_cache_config('DEFAULT/cinder_api_insecure').with_value(true)
|
||||
is_expected.to contain_glance_cache_config('DEFAULT/cinder_ca_certificates_file').with_value('/etc/ssh/ca.crt')
|
||||
is_expected.to contain_glance_cache_config('DEFAULT/cinder_catalog_info').with_value('volume:cinder:internalURL')
|
||||
is_expected.to contain_glance_cache_config('DEFAULT/cinder_endpoint_template').with_value('http://srv-foo:8776/v1/%(project_id)s')
|
||||
is_expected.to contain_glance_cache_config('DEFAULT/cinder_http_retries').with_value('10')
|
||||
is_expected.to contain_glance_cache_config('glance_store/cinder_api_insecure').with_value(true)
|
||||
is_expected.to contain_glance_cache_config('glance_store/cinder_ca_certificates_file').with_value('/etc/ssh/ca.crt')
|
||||
is_expected.to contain_glance_cache_config('glance_store/cinder_catalog_info').with_value('volume:cinder:internalURL')
|
||||
is_expected.to contain_glance_cache_config('glance_store/cinder_endpoint_template').with_value('http://srv-foo:8776/v1/%(project_id)s')
|
||||
is_expected.to contain_glance_cache_config('glance_store/cinder_http_retries').with_value('10')
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -24,22 +24,23 @@ describe 'glance::backend::swift' do
|
||||
is_expected.to contain_glance_api_config('glance_store/default_store').with_value('swift')
|
||||
is_expected.to contain_glance_api_config('glance_store/swift_store_key').with_value('key')
|
||||
is_expected.to contain_glance_api_config('glance_store/swift_store_user').with_value('user')
|
||||
is_expected.to contain_glance_api_config('DEFAULT/swift_store_auth_version').with_value('2')
|
||||
is_expected.to contain_glance_api_config('DEFAULT/swift_store_large_object_size').with_value('5120')
|
||||
is_expected.to contain_glance_api_config('glance_store/swift_store_auth_version').with_value('2')
|
||||
is_expected.to contain_glance_api_config('glance_store/swift_store_large_object_size').with_value('5120')
|
||||
is_expected.to contain_glance_api_config('glance_store/swift_store_auth_address').with_value('127.0.0.1:5000/v2.0/')
|
||||
is_expected.to contain_glance_api_config('DEFAULT/swift_store_container').with_value('glance')
|
||||
is_expected.to contain_glance_api_config('DEFAULT/swift_store_create_container_on_put').with_value(false)
|
||||
is_expected.to contain_glance_api_config('glance_store/swift_store_container').with_value('glance')
|
||||
is_expected.to contain_glance_api_config('glance_store/swift_store_create_container_on_put').with_value(false)
|
||||
is_expected.to contain_glance_api_config('glance_store/swift_store_endpoint_type').with_value('internalURL')
|
||||
is_expected.to contain_glance_api_config('glance_store/swift_store_region').with_value('')
|
||||
end
|
||||
|
||||
it 'configures glance-cache.conf' do
|
||||
is_expected.to contain_glance_cache_config('glance_store/swift_store_key').with_value('key')
|
||||
is_expected.to contain_glance_cache_config('glance_store/swift_store_user').with_value('user')
|
||||
is_expected.to contain_glance_cache_config('DEFAULT/swift_store_auth_version').with_value('2')
|
||||
is_expected.to contain_glance_cache_config('DEFAULT/swift_store_large_object_size').with_value('5120')
|
||||
is_expected.to contain_glance_cache_config('glance_store/swift_store_auth_version').with_value('2')
|
||||
is_expected.to contain_glance_cache_config('glance_store/swift_store_large_object_size').with_value('5120')
|
||||
is_expected.to contain_glance_cache_config('glance_store/swift_store_auth_address').with_value('127.0.0.1:5000/v2.0/')
|
||||
is_expected.to contain_glance_cache_config('DEFAULT/swift_store_container').with_value('glance')
|
||||
is_expected.to contain_glance_cache_config('DEFAULT/swift_store_create_container_on_put').with_value(false)
|
||||
is_expected.to contain_glance_cache_config('glance_store/swift_store_container').with_value('glance')
|
||||
is_expected.to contain_glance_cache_config('glance_store/swift_store_create_container_on_put').with_value(false)
|
||||
end
|
||||
end
|
||||
|
||||
@ -53,24 +54,26 @@ describe 'glance::backend::swift' do
|
||||
:swift_store_auth_address => '127.0.0.2:8080/v1.0/',
|
||||
:swift_store_container => 'swift',
|
||||
:swift_store_create_container_on_put => true,
|
||||
:swift_store_endpoint_type => 'publicURL'
|
||||
:swift_store_endpoint_type => 'publicURL',
|
||||
:swift_store_region => 'RegionTwo'
|
||||
}
|
||||
end
|
||||
|
||||
it 'configures glance-api.conf' do
|
||||
is_expected.to contain_glance_api_config('DEFAULT/swift_store_container').with_value('swift')
|
||||
is_expected.to contain_glance_api_config('DEFAULT/swift_store_create_container_on_put').with_value(true)
|
||||
is_expected.to contain_glance_api_config('DEFAULT/swift_store_auth_version').with_value('1')
|
||||
is_expected.to contain_glance_api_config('DEFAULT/swift_store_large_object_size').with_value('100')
|
||||
is_expected.to contain_glance_api_config('glance_store/swift_store_container').with_value('swift')
|
||||
is_expected.to contain_glance_api_config('glance_store/swift_store_create_container_on_put').with_value(true)
|
||||
is_expected.to contain_glance_api_config('glance_store/swift_store_auth_version').with_value('1')
|
||||
is_expected.to contain_glance_api_config('glance_store/swift_store_large_object_size').with_value('100')
|
||||
is_expected.to contain_glance_api_config('glance_store/swift_store_auth_address').with_value('127.0.0.2:8080/v1.0/')
|
||||
is_expected.to contain_glance_api_config('glance_store/swift_store_endpoint_type').with_value('publicURL')
|
||||
is_expected.to contain_glance_api_config('glance_store/swift_store_region').with_value('RegionTwo')
|
||||
end
|
||||
|
||||
it 'configures glance-cache.conf' do
|
||||
is_expected.to contain_glance_cache_config('DEFAULT/swift_store_container').with_value('swift')
|
||||
is_expected.to contain_glance_cache_config('DEFAULT/swift_store_create_container_on_put').with_value(true)
|
||||
is_expected.to contain_glance_cache_config('DEFAULT/swift_store_auth_version').with_value('1')
|
||||
is_expected.to contain_glance_cache_config('DEFAULT/swift_store_large_object_size').with_value('100')
|
||||
is_expected.to contain_glance_cache_config('glance_store/swift_store_container').with_value('swift')
|
||||
is_expected.to contain_glance_cache_config('glance_store/swift_store_create_container_on_put').with_value(true)
|
||||
is_expected.to contain_glance_cache_config('glance_store/swift_store_auth_version').with_value('1')
|
||||
is_expected.to contain_glance_cache_config('glance_store/swift_store_large_object_size').with_value('100')
|
||||
is_expected.to contain_glance_cache_config('glance_store/swift_store_auth_address').with_value('127.0.0.2:8080/v1.0/')
|
||||
end
|
||||
end
|
||||
|
@ -40,16 +40,16 @@ describe 'glance::backend::vsphere' do
|
||||
}
|
||||
end
|
||||
it 'configures glance-api.conf' do
|
||||
is_expected.to contain_glance_api_config('DEFAULT/default_store').with_value('vsphere')
|
||||
is_expected.to contain_glance_api_config('DEFAULT/vmware_api_insecure').with_value('False')
|
||||
is_expected.to contain_glance_api_config('DEFAULT/vmware_server_host').with_value('10.0.0.1')
|
||||
is_expected.to contain_glance_api_config('DEFAULT/vmware_server_username').with_value('root')
|
||||
is_expected.to contain_glance_api_config('DEFAULT/vmware_server_password').with_value('123456')
|
||||
is_expected.to contain_glance_api_config('DEFAULT/vmware_datastore_name').with_value('Datastore')
|
||||
is_expected.to contain_glance_api_config('DEFAULT/vmware_store_image_dir').with_value('/openstack_glance')
|
||||
is_expected.to contain_glance_api_config('DEFAULT/vmware_task_poll_interval').with_value('5')
|
||||
is_expected.to contain_glance_api_config('DEFAULT/vmware_api_retry_count').with_value('10')
|
||||
is_expected.to contain_glance_api_config('DEFAULT/vmware_datacenter_path').with_value('Datacenter')
|
||||
is_expected.to contain_glance_api_config('glance_store/default_store').with_value('vsphere')
|
||||
is_expected.to contain_glance_api_config('glance_store/vmware_api_insecure').with_value('False')
|
||||
is_expected.to contain_glance_api_config('glance_store/vmware_server_host').with_value('10.0.0.1')
|
||||
is_expected.to contain_glance_api_config('glance_store/vmware_server_username').with_value('root')
|
||||
is_expected.to contain_glance_api_config('glance_store/vmware_server_password').with_value('123456')
|
||||
is_expected.to contain_glance_api_config('glance_store/vmware_datastore_name').with_value('Datastore')
|
||||
is_expected.to contain_glance_api_config('glance_store/vmware_store_image_dir').with_value('/openstack_glance')
|
||||
is_expected.to contain_glance_api_config('glance_store/vmware_task_poll_interval').with_value('5')
|
||||
is_expected.to contain_glance_api_config('glance_store/vmware_api_retry_count').with_value('10')
|
||||
is_expected.to contain_glance_api_config('glance_store/vmware_datacenter_path').with_value('Datacenter')
|
||||
end
|
||||
end
|
||||
|
||||
@ -68,9 +68,9 @@ describe 'glance::backend::vsphere' do
|
||||
}
|
||||
end
|
||||
it 'configures glance-api.conf' do
|
||||
is_expected.to contain_glance_api_config('DEFAULT/vmware_api_insecure').with_value('True')
|
||||
is_expected.to contain_glance_api_config('DEFAULT/vmware_task_poll_interval').with_value('6')
|
||||
is_expected.to contain_glance_api_config('DEFAULT/vmware_api_retry_count').with_value('11')
|
||||
is_expected.to contain_glance_api_config('glance_store/vmware_api_insecure').with_value('True')
|
||||
is_expected.to contain_glance_api_config('glance_store/vmware_task_poll_interval').with_value('6')
|
||||
is_expected.to contain_glance_api_config('glance_store/vmware_api_retry_count').with_value('11')
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -64,7 +64,7 @@ class openstack::glance (
|
||||
$use_syslog = false,
|
||||
$show_image_direct_url = true,
|
||||
$swift_store_large_object_size = '5120',
|
||||
$pipeline = 'keystone+cachemanagement',
|
||||
$pipeline = 'keystone',
|
||||
# Facility is common for all glance services
|
||||
$syslog_log_facility = 'LOG_LOCAL2',
|
||||
$glance_image_cache_max_size = '10737418240',
|
||||
@ -82,7 +82,6 @@ class openstack::glance (
|
||||
$rabbit_notification_exchange = 'glance',
|
||||
$rabbit_notification_topic = 'notifications',
|
||||
$amqp_durable_queues = false,
|
||||
$control_exchange = 'glance',
|
||||
$known_stores = false,
|
||||
$rbd_store_user = 'images',
|
||||
$rbd_store_pool = 'images',
|
||||
@ -110,68 +109,61 @@ class openstack::glance (
|
||||
keystone_user => $glance_user,
|
||||
keystone_password => $glance_user_password,
|
||||
keystone_tenant => $glance_tenant,
|
||||
sql_connection => $sql_connection,
|
||||
database_connection => $sql_connection,
|
||||
enabled => $enabled,
|
||||
registry_host => $registry_host,
|
||||
use_syslog => $use_syslog,
|
||||
log_facility => $syslog_log_facility,
|
||||
sql_idle_timeout => $idle_timeout,
|
||||
database_idle_timeout => $idle_timeout,
|
||||
show_image_direct_url => $show_image_direct_url,
|
||||
pipeline => $pipeline,
|
||||
known_stores => $known_stores,
|
||||
}
|
||||
|
||||
glance_api_config {
|
||||
'DEFAULT/control_exchange': value => $control_exchange;
|
||||
'DEFAULT/sql_max_pool_size': value => $max_pool_size;
|
||||
'DEFAULT/sql_max_retries': value => $max_retries;
|
||||
'DEFAULT/sql_max_overflow': value => $max_overflow;
|
||||
'DEFAULT/registry_client_protocol': value => "http";
|
||||
'DEFAULT/delayed_delete': value => "False";
|
||||
'DEFAULT/scrub_time': value => "43200";
|
||||
'DEFAULT/scrubber_datadir': value => "/var/lib/glance/scrubber";
|
||||
'DEFAULT/image_cache_dir': value => "/var/lib/glance/image-cache/";
|
||||
'DEFAULT/auth_region': value => $region;
|
||||
'keystone_authtoken/signing_dir': value => '/tmp/keystone-signing-glance';
|
||||
'keystone_authtoken/signing_dirname': value => '/tmp/keystone-signing-glance';
|
||||
'database/sql_max_pool_size': value => $max_pool_size;
|
||||
'database/sql_max_retries': value => $max_retries;
|
||||
'database/sql_max_overflow': value => $max_overflow;
|
||||
'DEFAULT/delayed_delete': value => "False";
|
||||
'DEFAULT/scrub_time': value => "43200";
|
||||
'DEFAULT/scrubber_datadir': value => "/var/lib/glance/scrubber";
|
||||
'DEFAULT/auth_region': value => $region;
|
||||
'keystone_authtoken/signing_dir': value => '/tmp/keystone-signing-glance';
|
||||
'keystone_authtoken/token_cache_time': value => '-1';
|
||||
}
|
||||
|
||||
glance_cache_config {
|
||||
'DEFAULT/sql_max_pool_size': value => $max_pool_size;
|
||||
'DEFAULT/sql_max_retries': value => $max_retries;
|
||||
'DEFAULT/sql_max_overflow': value => $max_overflow;
|
||||
'DEFAULT/use_syslog': value => $use_syslog;
|
||||
'DEFAULT/image_cache_dir': value => "/var/lib/glance/image-cache/";
|
||||
'DEFAULT/log_file': value => "/var/log/glance/image-cache.log";
|
||||
'DEFAULT/image_cache_stall_time': value => "86400";
|
||||
'DEFAULT/image_cache_invalid_entry_grace_period': value => "3600";
|
||||
'DEFAULT/image_cache_max_size': value => $glance_image_cache_max_size;
|
||||
'DEFAULT/os_region_name': value => $region;
|
||||
}
|
||||
|
||||
# Install and configure glance-registry
|
||||
class { 'glance::registry':
|
||||
verbose => $verbose,
|
||||
debug => $debug,
|
||||
bind_host => $bind_host,
|
||||
auth_host => $keystone_host,
|
||||
auth_port => '35357',
|
||||
auth_type => 'keystone',
|
||||
keystone_user => $glance_user,
|
||||
keystone_password => $glance_user_password,
|
||||
keystone_tenant => $glance_tenant,
|
||||
sql_connection => $sql_connection,
|
||||
enabled => $enabled,
|
||||
use_syslog => $use_syslog,
|
||||
log_facility => $syslog_log_facility,
|
||||
sql_idle_timeout => $idle_timeout,
|
||||
verbose => $verbose,
|
||||
debug => $debug,
|
||||
bind_host => $bind_host,
|
||||
auth_host => $keystone_host,
|
||||
auth_port => '35357',
|
||||
auth_type => 'keystone',
|
||||
keystone_user => $glance_user,
|
||||
keystone_password => $glance_user_password,
|
||||
keystone_tenant => $glance_tenant,
|
||||
database_connection => $sql_connection,
|
||||
enabled => $enabled,
|
||||
use_syslog => $use_syslog,
|
||||
log_facility => $syslog_log_facility,
|
||||
database_idle_timeout => $idle_timeout,
|
||||
}
|
||||
|
||||
glance_registry_config {
|
||||
'DEFAULT/sql_max_pool_size': value => $max_pool_size;
|
||||
'DEFAULT/sql_max_retries': value => $max_retries;
|
||||
'DEFAULT/sql_max_overflow': value => $max_overflow;
|
||||
'keystone_authtoken/signing_dir': value => '/tmp/keystone-signing-glance';
|
||||
'keystone_authtoken/signing_dirname': value => '/tmp/keystone-signing-glance';
|
||||
'database/sql_max_pool_size': value => $max_pool_size;
|
||||
'database/sql_max_retries': value => $max_retries;
|
||||
'database/sql_max_overflow': value => $max_overflow;
|
||||
'keystone_authtoken/signing_dir': value => '/tmp/keystone-signing-glance';
|
||||
}
|
||||
|
||||
# puppet-glance assumes rabbit_hosts is an array of [node:port, node:port]
|
||||
@ -207,10 +199,6 @@ class openstack::glance (
|
||||
notification_driver => $notification_driver,
|
||||
}
|
||||
|
||||
glance_api_config {
|
||||
'DEFAULT/notification_strategy': value => 'rabbit';
|
||||
}
|
||||
|
||||
# syslog additional settings default/use_syslog_rfc_format = true
|
||||
if $use_syslog {
|
||||
glance_api_config {
|
||||
@ -240,7 +228,7 @@ class openstack::glance (
|
||||
if !defined(Service['glance-api']) {
|
||||
notify{ "Module ${module_name} cannot notify service glance-api on package swift update": }
|
||||
}
|
||||
class { "glance::backend::$glance_backend":
|
||||
class { "glance::backend::swift":
|
||||
swift_store_user => "${glance_tenant}:${glance_user}",
|
||||
swift_store_key=> $glance_user_password,
|
||||
swift_store_create_container_on_put => "True",
|
||||
|
@ -46,7 +46,7 @@ $glance_vcenter_image_dir = $glance_hash['vc_image_dir']
|
||||
$glance_vcenter_api_retry_count = '20'
|
||||
$glance_image_cache_max_size = $glance_hash['image_cache_max_size']
|
||||
$glance_show_image_direct_url = pick($glance_hash['show_image_direct_url'], true)
|
||||
$glance_pipeline = pick($glance_hash['pipeline'], 'keystone+cachemanagement')
|
||||
$glance_pipeline = pick($glance_hash['pipeline'], 'keystone')
|
||||
$glance_large_object_size = pick($glance_hash['large_object_size'], '5120')
|
||||
|
||||
if ($storage_hash['images_ceph']) {
|
||||
@ -106,10 +106,6 @@ class { 'openstack::glance':
|
||||
ceilometer => $ceilometer_hash[enabled],
|
||||
}
|
||||
|
||||
glance_api_config {
|
||||
'keystone_authtoken/token_cache_time': value => '-1';
|
||||
}
|
||||
|
||||
####### Disable upstart startup on install #######
|
||||
if($::operatingsystem == 'Ubuntu') {
|
||||
tweaks::ubuntu_service_override { 'glance-api':
|
||||
|
@ -17,13 +17,12 @@ describe manifest do
|
||||
'allowed_hosts' => allowed_hosts,
|
||||
)
|
||||
end
|
||||
#TODO: uncomment in keystone module adaptation patch
|
||||
# allowed_hosts.each do |host|
|
||||
# it "should define openstacklib::db::mysql::host_access for #{glance_db_dbname} DB for #{host}" do
|
||||
# should contain_openstacklib__db__mysql__host_access("#{glance_db_dbname}_#{host}")
|
||||
# end
|
||||
# end
|
||||
end # end of shared_examples
|
||||
allowed_hosts.each do |host|
|
||||
it "should define openstacklib::db::mysql::host_access for #{glance_db_dbname} DB for #{host}" do
|
||||
should contain_openstacklib__db__mysql__host_access("#{glance_db_dbname}_#{host}")
|
||||
end
|
||||
end
|
||||
end
|
||||
test_ubuntu_and_centos manifest
|
||||
end
|
||||
|
||||
|
@ -3,6 +3,85 @@ require 'shared-examples'
|
||||
manifest = 'glance/glance.pp'
|
||||
|
||||
describe manifest do
|
||||
shared_examples 'catalog' do
|
||||
|
||||
# TODO All this stuff should be moved to shared examples controller* tests.
|
||||
glance_config = Noop.hiera_structure 'glance'
|
||||
storage_config = Noop.hiera_structure 'storage'
|
||||
max_pool_size = Noop.hiera('max_pool_size')
|
||||
max_overflow = Noop.hiera('max_overflow')
|
||||
max_retries = '-1'
|
||||
use_syslog = Noop.hiera('use_syslog', 'true')
|
||||
region = Noop.hiera('region', 'RegionOne')
|
||||
if glance_config && glance_config.has_key?('pipeline')
|
||||
pipeline = glance_config['pipeline']
|
||||
else
|
||||
pipeline = 'keystone'
|
||||
end
|
||||
|
||||
it 'should declare glance classes' do
|
||||
should contain_class('glance::api').with('pipeline' => pipeline)
|
||||
should contain_class('glance::registry')
|
||||
should contain_class('glance::notify::rabbitmq')
|
||||
end
|
||||
|
||||
it 'should configure glance api config' do
|
||||
should contain_glance_api_config('database/sql_max_pool_size').with_value(max_pool_size)
|
||||
should contain_glance_api_config('database/sql_max_overflow').with_value(max_overflow)
|
||||
should contain_glance_api_config('database/sql_max_retries').with_value(max_retries)
|
||||
should contain_glance_api_config('DEFAULT/delayed_delete').with_value('False')
|
||||
should contain_glance_api_config('DEFAULT/scrub_time').with_value('43200')
|
||||
should contain_glance_api_config('DEFAULT/scrubber_datadir').with_value('/var/lib/glance/scrubber')
|
||||
should contain_glance_api_config('DEFAULT/auth_region').with_value(region)
|
||||
should contain_glance_api_config('keystone_authtoken/signing_dir').with_value('/tmp/keystone-signing-glance')
|
||||
should contain_glance_api_config('keystone_authtoken/token_cache_time').with_value('-1')
|
||||
end
|
||||
|
||||
it 'should configure glance cache config' do
|
||||
should contain_glance_cache_config('DEFAULT/use_syslog').with_value(use_syslog)
|
||||
should contain_glance_cache_config('DEFAULT/image_cache_dir').with_value('/var/lib/glance/image-cache/')
|
||||
should contain_glance_cache_config('DEFAULT/log_file').with_value('/var/log/glance/image-cache.log')
|
||||
should contain_glance_cache_config('DEFAULT/image_cache_stall_time').with_value('86400')
|
||||
should contain_glance_cache_config('DEFAULT/os_region_name').with_value(region)
|
||||
if glance_config && glance_config.has_key?('image_cache_max_size')
|
||||
glance_image_cache_max_size = glance_config['image_cache_max_size']
|
||||
should contain_glance_cache_config('DEFAULT/image_cache_max_size').with_value(glance_image_cache_max_size)
|
||||
end
|
||||
end
|
||||
|
||||
it 'should configure glance registry config' do
|
||||
should contain_glance_registry_config('database/sql_max_pool_size').with_value(max_pool_size)
|
||||
should contain_glance_registry_config('database/sql_max_overflow').with_value(max_overflow)
|
||||
should contain_glance_registry_config('database/sql_max_retries').with_value(max_retries)
|
||||
should contain_glance_registry_config('keystone_authtoken/signing_dir').with_value('/tmp/keystone-signing-glance')
|
||||
end
|
||||
|
||||
if use_syslog
|
||||
it 'should configure rfc format' do
|
||||
should contain_glance_api_config('DEFAULT/use_syslog_rfc_format').with_value('true')
|
||||
should contain_glance_cache_config('DEFAULT/use_syslog_rfc_format').with_value('true')
|
||||
should contain_glance_registry_config('DEFAULT/use_syslog_rfc_format').with_value('true')
|
||||
end
|
||||
end
|
||||
|
||||
if storage_config && storage_config.has_key?('images_ceph') && storage_config['images_ceph']
|
||||
let :params do { :glance_backend => 'ceph', } end
|
||||
it 'should declare ceph backend' do
|
||||
should contain_class('glance::backend::rbd')
|
||||
end
|
||||
elsif storage_config && storage_config.has_key?('images_vcenter') && storage_config['images_vcenter']
|
||||
let :params do { :glance_backend => 'vmware', } end
|
||||
it 'should declare vmware backend' do
|
||||
should contain_class('glance::backend::vsphere')
|
||||
end
|
||||
else
|
||||
let :params do { :glance_backend => 'swift', } end
|
||||
it 'should declare swift backend' do
|
||||
should contain_class('glance::backend::swift').with('swift_store_region' => region)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
test_ubuntu_and_centos manifest
|
||||
end
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user