Allow alternate locations for Cirros image
When creating the demo environment, the Cirros image was downloaded from a hardcoded location. This can create issues in environments placed behind a proxy or isolated. This patch adds a new config option (CONFIG_PROVISION_DEMO_CIRROS_URL) where a local file path or remote URL can be specified. Be aware that it requires a fix to puppet-glance to work (https://review.openstack.org/132813). Change-Id: I2e6a3ba9822624d16c63f88c30d24d26d6d0c3e0 Fixes: bz#1147716
This commit is contained in:
@@ -537,6 +537,9 @@ Provision Config Parameters
|
|||||||
**CONFIG_PROVISION_DEMO_FLOATRANGE**
|
**CONFIG_PROVISION_DEMO_FLOATRANGE**
|
||||||
The CIDR network address for the floating IP subnet.
|
The CIDR network address for the floating IP subnet.
|
||||||
|
|
||||||
|
**CONFIG_PROVISION_CIRROS_URL**
|
||||||
|
A URL or local file location for the Cirros demo image used for Glance.
|
||||||
|
|
||||||
**CONFIG_PROVISION_TEMPEST**
|
**CONFIG_PROVISION_TEMPEST**
|
||||||
Whether to configure tempest for testing.
|
Whether to configure tempest for testing.
|
||||||
|
|
||||||
@@ -552,7 +555,6 @@ Provision Config Parameters
|
|||||||
**CONFIG_PROVISION_TEMPEST_REPO_URI**
|
**CONFIG_PROVISION_TEMPEST_REPO_URI**
|
||||||
The uri of the tempest git repository to use.
|
The uri of the tempest git repository to use.
|
||||||
|
|
||||||
|
|
||||||
Log files and Debug info
|
Log files and Debug info
|
||||||
------------------------
|
------------------------
|
||||||
|
|
||||||
|
|||||||
@@ -21,6 +21,10 @@ from packstack.modules.ospluginutils import (appendManifestFile,
|
|||||||
PLUGIN_NAME = "OS-Provision"
|
PLUGIN_NAME = "OS-Provision"
|
||||||
PLUGIN_NAME_COLORED = utils.color_text(PLUGIN_NAME, 'blue')
|
PLUGIN_NAME_COLORED = utils.color_text(PLUGIN_NAME, 'blue')
|
||||||
|
|
||||||
|
DEMO_CIRRUS_URL = (
|
||||||
|
'http://download.cirros-cloud.net/0.3.3/cirros-0.3.3-x86_64-disk.img'
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def initConfig(controller):
|
def initConfig(controller):
|
||||||
|
|
||||||
@@ -106,6 +110,21 @@ def initConfig(controller):
|
|||||||
"USE_DEFAULT": False,
|
"USE_DEFAULT": False,
|
||||||
"NEED_CONFIRM": False,
|
"NEED_CONFIRM": False,
|
||||||
"CONDITION": False},
|
"CONDITION": False},
|
||||||
|
|
||||||
|
{"CMD_OPTION": "provision-cirros-url",
|
||||||
|
"USAGE": "A URL or local file location for the Cirros demo image "
|
||||||
|
"used for Glance",
|
||||||
|
"PROMPT": "Enter the URL or local file location for the Cirros "
|
||||||
|
"image",
|
||||||
|
"OPTION_LIST": False,
|
||||||
|
"VALIDATORS": [validators.validate_not_empty],
|
||||||
|
"DEFAULT_VALUE": DEMO_CIRRUS_URL,
|
||||||
|
"MASK_INPUT": False,
|
||||||
|
"LOOSE_VALIDATION": True,
|
||||||
|
"CONF_NAME": "CONFIG_PROVISION_CIRROS_URL",
|
||||||
|
"USE_DEFAULT": False,
|
||||||
|
"NEED_CONFIRM": False,
|
||||||
|
"CONDITION": False},
|
||||||
],
|
],
|
||||||
|
|
||||||
"TEMPEST_GIT_REFS": [
|
"TEMPEST_GIT_REFS": [
|
||||||
@@ -286,7 +305,7 @@ def create_storage_manifest(config, messages):
|
|||||||
if config['CONFIG_UNSUPPORTED'] != 'y':
|
if config['CONFIG_UNSUPPORTED'] != 'y':
|
||||||
config['CONFIG_STORAGE_HOST'] = config['CONFIG_CONTROLLER_HOST']
|
config['CONFIG_STORAGE_HOST'] = config['CONFIG_CONTROLLER_HOST']
|
||||||
|
|
||||||
if config['CONFIG_PROVISION_TEMPEST'] == "y":
|
if config['CONFIG_PROVISION_TEMPEST']:
|
||||||
template = "provision_tempest_glance.pp"
|
template = "provision_tempest_glance.pp"
|
||||||
else:
|
else:
|
||||||
template = "provision_demo_glance.pp"
|
template = "provision_demo_glance.pp"
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
## Images
|
## Images
|
||||||
## Glance
|
## Glance
|
||||||
$image_name = 'cirros'
|
$image_name = 'cirros'
|
||||||
$image_source = 'http://download.cirros-cloud.net/0.3.1/cirros-0.3.1-x86_64-disk.img'
|
$image_source = hiera('CONFIG_PROVISION_CIRROS_URL')
|
||||||
$image_ssh_user = 'cirros'
|
$image_ssh_user = 'cirros'
|
||||||
|
|
||||||
glance_image { $image_name:
|
glance_image { $image_name:
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ if $provision_tempest_user != '' {
|
|||||||
|
|
||||||
## Glance
|
## Glance
|
||||||
$image_name = 'cirros'
|
$image_name = 'cirros'
|
||||||
$image_source = 'http://download.cirros-cloud.net/0.3.1/cirros-0.3.1-x86_64-disk.img'
|
$image_source = hiera('CONFIG_PROVISION_TEMPEST_CIRROS_URL')
|
||||||
$image_ssh_user = 'cirros'
|
$image_ssh_user = 'cirros'
|
||||||
|
|
||||||
## Neutron
|
## Neutron
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
## Glance
|
## Glance
|
||||||
$image_name = 'cirros'
|
$image_name = 'cirros'
|
||||||
$image_source = 'http://download.cirros-cloud.net/0.3.1/cirros-0.3.1-x86_64-disk.img'
|
$image_source = hiera('CONFIG_PROVISION_CIRROS_URL')
|
||||||
$image_ssh_user = 'cirros'
|
$image_ssh_user = 'cirros'
|
||||||
|
|
||||||
## Tempest
|
## Tempest
|
||||||
|
|||||||
Reference in New Issue
Block a user