[Ironic] Configure Swift as Glance backend when Ironic enabled

Glance should use Swift backend to get images available to use in Ironic
If images_ceph is selected, Glance should use Swift API via RadosGW

Ironic also should be configured to use RadosGW endpoint.

Implements: blueprint fuel-integrate-ironic (partially)

Change-Id: Ia71e69f7171d245c12ccbd862fafdc0e7c216d67
This commit is contained in:
Andrey Shestakov 2015-11-18 11:30:38 +02:00
parent 715085df55
commit 045703cd64
4 changed files with 18 additions and 1 deletions

View File

@ -21,6 +21,7 @@ $ceilometer_hash = hiera_hash('ceilometer', {})
$region = hiera('region','RegionOne')
$glance_endpoint = $management_vip
$service_workers = pick($glance_hash['glance_workers'], min(max($::processorcount, 2), 16))
$ironic_hash = hiera_hash('ironic', {})
$default_log_levels = hiera_hash('default_log_levels')
@ -56,7 +57,7 @@ $glance_large_object_size = pick($glance_hash['large_object_size'], '5120'
$rados_connect_timeout = '30'
if ($storage_hash['images_ceph']) {
if ($storage_hash['images_ceph'] and !$ironic_hash['enabled']) {
$glance_backend = 'ceph'
$glance_known_stores = [ 'glance.store.rbd.Store', 'glance.store.http.Store' ]
$glance_show_image_direct_url = pick($glance_hash['show_image_direct_url'], true)

View File

@ -21,6 +21,7 @@ $use_syslog = hiera('use_syslog', true)
$syslog_log_facility_ironic = hiera('syslog_log_facility_ironic', 'LOG_USER')
$rabbit_hash = hiera_hash('rabbit_hash')
$rabbit_ha_queues = hiera('rabbit_ha_queues')
$storage_hash = hiera('storage')
$ironic_tenant = pick($ironic_hash['tenant'],'services')
$ironic_user = pick($ironic_hash['auth_name'],'ironic')
@ -35,6 +36,11 @@ $database_connection = "mysql://${db_name}:${db_password}@${db_host}/${db
$tftp_root = '/var/lib/ironic/tftpboot'
$temp_url_endpoint_type = $storage_hash['images_ceph'] ? {
true => 'radosgw',
default => 'swift'
}
package { 'ironic-fa-deploy':
ensure => 'present',
}
@ -72,6 +78,7 @@ ironic_config {
'keystone_authtoken/admin_password': value => $ironic_user_password, secret => true;
'glance/swift_temp_url_key': value => $ironic_swift_tempurl_key;
'glance/swift_endpoint_url': value => "http://${baremetal_vip}:8080";
'glance/temp_url_endpoint_type': value => $temp_url_endpoint_type;
'conductor/api_url': value => "http://${baremetal_vip}:6385";
}

View File

@ -14,6 +14,7 @@ describe manifest do
use_syslog = Noop.hiera('use_syslog', 'true')
use_stderr = Noop.hiera('use_stderr', 'false')
region = Noop.hiera('region', 'RegionOne')
ironic_enabled = Noop.hiera_structure('ironic/enabled', false)
default_log_levels_hash = Noop.hiera_hash 'default_log_levels'
default_log_levels = Noop.puppet_function 'join_keys_to_values',default_log_levels_hash,'='
if glance_config && glance_config.has_key?('pipeline')
@ -90,6 +91,11 @@ describe manifest do
else
show_image_direct_url = true
end
if ironic_enabled
it 'should declare swift backend' do
should contain_class('glance::backend::swift')
end
end
let :params do { :glance_backend => 'ceph', } end
it 'should declare ceph backend' do
should contain_class('glance::backend::rbd')

View File

@ -7,6 +7,7 @@ describe manifest do
rabbit_user = Noop.hiera_structure 'rabbit/user', 'nova'
rabbit_password = Noop.hiera_structure 'rabbit/password'
ironic_enabled = Noop.hiera_structure 'ironic/enabled'
storage_config = Noop.hiera_structure 'storage'
if ironic_enabled
it 'should ensure that ironic-fa-deploy is installed' do
@ -26,10 +27,12 @@ describe manifest do
neutron_endpoint = Noop.hiera 'neutron_endpoint', service_endpoint
neutron_url = "http://#{neutron_endpoint}:9696"
ironic_user = Noop.hiera_structure 'ironic/user', 'ironic'
temp_url_endpoint_type = (storage_config['images_ceph']) ? 'radosgw' : 'swift'
it 'ironic config should have propper config options' do
should contain_ironic_config('pxe/tftp_root').with('value' => '/var/lib/ironic/tftpboot')
should contain_ironic_config('neutron/url').with('value' => neutron_url)
should contain_ironic_config('keystone_authtoken/admin_user').with('value' => ironic_user)
should contain_ironic_config('glance/temp_url_endpoint_type').with('value' => temp_url_endpoint_type)
end
tftp_root = '/var/lib/ironic/tftpboot'