Allow Orchestration of Image Backend
Adds a horizon::image_backend parameter that can be overriden to allow explicit definition of the supported image types etc. that are supported for the end user. The underlying python representation per setting is an array of tuples, however in puppet and hiera this is a hash as all options have an order of 2. A typical configuration may look like: horizon::image_backend: image_formats: '': 'Select image format' qcow2: 'QCOW2 - QEMU Emulator' raw: 'Raw' Change-Id: Ieb92240ed86f67b73911ec627312093e797fa15f
This commit is contained in:
parent
06e150fa18
commit
b956399c2a
@ -243,6 +243,12 @@
|
|||||||
# All entities will be created in the default domain.
|
# All entities will be created in the default domain.
|
||||||
# Default to undefined
|
# Default to undefined
|
||||||
#
|
#
|
||||||
|
# [*image_backend*]
|
||||||
|
# (optional) Overrides the default image backend settings. This allows the list of supported
|
||||||
|
# image types etc. to be explicitly defined.
|
||||||
|
# Example: image_backend => { 'image_formats' => { '' => 'Select type', 'qcow2' => 'QCOW2' } }
|
||||||
|
# Default to empty hash
|
||||||
|
#
|
||||||
# === Examples
|
# === Examples
|
||||||
#
|
#
|
||||||
# class { 'horizon':
|
# class { 'horizon':
|
||||||
@ -301,6 +307,7 @@ class horizon(
|
|||||||
$api_versions = {},
|
$api_versions = {},
|
||||||
$keystone_multidomain_support = false,
|
$keystone_multidomain_support = false,
|
||||||
$keystone_default_domain = undef,
|
$keystone_default_domain = undef,
|
||||||
|
$image_backend = {},
|
||||||
# DEPRECATED PARAMETERS
|
# DEPRECATED PARAMETERS
|
||||||
$can_set_mount_point = undef,
|
$can_set_mount_point = undef,
|
||||||
$vhost_extra_params = undef,
|
$vhost_extra_params = undef,
|
||||||
|
@ -332,6 +332,56 @@ describe 'horizon' do
|
|||||||
|
|
||||||
it { is_expected.not_to contain_file(params[:file_upload_temp_dir]) }
|
it { is_expected.not_to contain_file(params[:file_upload_temp_dir]) }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
context 'with image_backend' do
|
||||||
|
before do
|
||||||
|
params.merge!({
|
||||||
|
:image_backend => {
|
||||||
|
'image_formats' => {
|
||||||
|
'' => 'Select image format',
|
||||||
|
'aki' => 'AKI - Amazon Kernel Image',
|
||||||
|
'ami' => 'AMI - Amazon Machine Image',
|
||||||
|
'ari' => 'ARI - Amazon Ramdisk Image',
|
||||||
|
'iso' => 'ISO - Optical Disk Image',
|
||||||
|
'qcow2' => 'QCOW2 - QEMU Emulator',
|
||||||
|
'raw' => 'Raw',
|
||||||
|
'vdi' => 'VDI',
|
||||||
|
'vhi' => 'VHI',
|
||||||
|
'vmdk' => 'VMDK',
|
||||||
|
},
|
||||||
|
'architectures' => {
|
||||||
|
'' => 'Select architecture',
|
||||||
|
'x86_64' => 'x86-64',
|
||||||
|
'aarch64' => 'ARMv8',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'configures OPENSTACK_IMAGE_BACKEND' do
|
||||||
|
verify_concat_fragment_contents(catalogue, 'local_settings.py', [
|
||||||
|
"OPENSTACK_IMAGE_BACKEND = {",
|
||||||
|
" 'image_formats': [",
|
||||||
|
" ('', _('Select image format')),",
|
||||||
|
" ('aki', _('AKI - Amazon Kernel Image')),",
|
||||||
|
" ('ami', _('AMI - Amazon Machine Image')),",
|
||||||
|
" ('ari', _('ARI - Amazon Ramdisk Image')),",
|
||||||
|
" ('iso', _('ISO - Optical Disk Image')),",
|
||||||
|
" ('qcow2', _('QCOW2 - QEMU Emulator')),",
|
||||||
|
" ('raw', _('Raw')),",
|
||||||
|
" ('vdi', _('VDI')),",
|
||||||
|
" ('vhi', _('VHI')),",
|
||||||
|
" ('vmdk', _('VMDK')),",
|
||||||
|
" ], # image_formats",
|
||||||
|
" 'architectures': [",
|
||||||
|
" ('', _('Select architecture')),",
|
||||||
|
" ('x86_64', _('x86-64')),",
|
||||||
|
" ('aarch64', _('ARMv8')),",
|
||||||
|
" ], # architectures",
|
||||||
|
"} # OPENSTACK_IMAGE_BACKEND",
|
||||||
|
])
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'on RedHat platforms' do
|
context 'on RedHat platforms' do
|
||||||
|
@ -256,6 +256,17 @@ OPENSTACK_NEUTRON_NETWORK = {
|
|||||||
# ('vmdk', _('VMDK'))
|
# ('vmdk', _('VMDK'))
|
||||||
# ]
|
# ]
|
||||||
# }
|
# }
|
||||||
|
<%- if !(@image_backend.empty?) -%>
|
||||||
|
OPENSTACK_IMAGE_BACKEND = {
|
||||||
|
<%- @image_backend.each do |opt_name,opt_val| -%>
|
||||||
|
'<%= opt_name %>': [
|
||||||
|
<%- opt_val.each do |val,label| -%>
|
||||||
|
('<%= val %>', _('<%= label %>')),
|
||||||
|
<%- end -%>
|
||||||
|
], # <%= opt_name %>
|
||||||
|
<%- end -%>
|
||||||
|
} # OPENSTACK_IMAGE_BACKEND
|
||||||
|
<%- end -%>
|
||||||
|
|
||||||
# OPENSTACK_ENDPOINT_TYPE specifies the endpoint type to use for the endpoints
|
# OPENSTACK_ENDPOINT_TYPE specifies the endpoint type to use for the endpoints
|
||||||
# in the Keystone service catalog. Use this setting when Horizon is running
|
# in the Keystone service catalog. Use this setting when Horizon is running
|
||||||
|
Loading…
Reference in New Issue
Block a user