Ability to provide demo image's properties

Is really needed when when non-standard image is used.
Provide it as a string, luckily, glance_image can accept properties
as a string, it has simple parser for "key=value[,key1=value2]..."-like inputs.

Change-Id: Ib85c2165c0b8c7f0732cf333f5ad8709e88063db
This commit is contained in:
Evgeny Antyshev 2017-02-15 13:23:26 +00:00
parent bc8eecf86f
commit 2052808b87
4 changed files with 22 additions and 0 deletions

View File

@ -995,6 +995,9 @@ Provisioning demo config
**CONFIG_PROVISION_IMAGE_FORMAT**
Format for the demo image (default "qcow2").
**CONFIG_PROVISION_IMAGE_PROPERTIES**
Properties of the demo image (none by default).
**CONFIG_PROVISION_IMAGE_SSH_USER**
User to use when connecting to instances booted from the demo image.

View File

@ -135,6 +135,19 @@ def initConfig(controller):
"NEED_CONFIRM": False,
"CONDITION": False},
{"CMD_OPTION": "provision-image-properties",
"PROMPT": ("Enter the comma-separated list of key=value pairs "
"to set as the properties of the demo image"),
"OPTION_LIST": False,
"VALIDATORS": [],
"DEFAULT_VALUE": "",
"MASK_INPUT": False,
"LOOSE_VALIDATION": True,
"CONF_NAME": "CONFIG_PROVISION_IMAGE_PROPERTIES",
"USE_DEFAULT": False,
"NEED_CONFIRM": False,
"CONDITION": False},
{"CMD_OPTION": "provision-image-ssh-user",
"PROMPT": ("Enter the name of a user to use when connecting "
"to the demo image via ssh"),

View File

@ -3,6 +3,7 @@ class packstack::provision::glance ()
$image_name = hiera('CONFIG_PROVISION_IMAGE_NAME')
$image_source = hiera('CONFIG_PROVISION_IMAGE_URL')
$image_format = hiera('CONFIG_PROVISION_IMAGE_FORMAT')
$image_properties = hiera('CONFIG_PROVISION_IMAGE_PROPERTIES')
$uec_image_name = hiera('CONFIG_PROVISION_UEC_IMAGE_NAME')
$uec_image_source_kernel = hiera('CONFIG_PROVISION_UEC_IMAGE_KERNEL_URL')
$uec_image_source_ramdisk = hiera('CONFIG_PROVISION_UEC_IMAGE_RAMDISK_URL')
@ -14,6 +15,7 @@ class packstack::provision::glance ()
container_format => 'bare',
disk_format => $image_format,
source => $image_source,
properties => $image_properties
}
if str2bool(hiera('CONFIG_PROVISION_TEMPEST')) {

View File

@ -0,0 +1,4 @@
---
features:
- New config parameter CONFIG_PROVISION_IMAGE_PROPERTIES
introduced, useful when provided image needs custom parameters