Refactor provisioning
- Unite demo user and tempest user provisioning - Unite glance provisioning - Unite network provisioning - Run provisioning on correct nodes - network and users on controller - glance on storage nodes Change-Id: Ief9d9c224d0f94557f42d64d62e1e9d314db9ad6
This commit is contained in:
@@ -983,6 +983,9 @@ Provisioning tempest config
|
|||||||
**CONFIG_PROVISION_TEMPEST_REPO_REVISION**
|
**CONFIG_PROVISION_TEMPEST_REPO_REVISION**
|
||||||
Revision (branch) of the Integration Test Suite git repository.
|
Revision (branch) of the Integration Test Suite git repository.
|
||||||
|
|
||||||
|
**CONFIG_TEMPEST_HOST**
|
||||||
|
Host to deploy Tempest on. On multinode installs defaults to first host in CONFIG_NETWORK_HOSTS.
|
||||||
|
|
||||||
Provisioning all-in-one ovs bridge config
|
Provisioning all-in-one ovs bridge config
|
||||||
-----------------------------------------
|
-----------------------------------------
|
||||||
|
|
||||||
|
|||||||
@@ -139,6 +139,18 @@ def initConfig(controller):
|
|||||||
],
|
],
|
||||||
|
|
||||||
"PROVISION_TEMPEST": [
|
"PROVISION_TEMPEST": [
|
||||||
|
{"CMD_OPTION": "tempest-host",
|
||||||
|
"PROMPT": "Enter the host where to deploy Tempest",
|
||||||
|
"OPTION_LIST": [],
|
||||||
|
"VALIDATORS": [validators.validate_ssh],
|
||||||
|
"DEFAULT_VALUE": utils.get_localhost_ip(),
|
||||||
|
"MASK_INPUT": False,
|
||||||
|
"LOOSE_VALIDATION": True,
|
||||||
|
"CONF_NAME": "CONFIG_TEMPEST_HOST",
|
||||||
|
"USE_DEFAULT": False,
|
||||||
|
"NEED_CONFIRM": False,
|
||||||
|
"CONDITION": False},
|
||||||
|
|
||||||
{"CMD_OPTION": "provision-tempest-user",
|
{"CMD_OPTION": "provision-tempest-user",
|
||||||
"PROMPT": ("Enter the name of the Tempest Provisioning user "
|
"PROMPT": ("Enter the name of the Tempest Provisioning user "
|
||||||
"(if blank, Tempest will be configured in a "
|
"(if blank, Tempest will be configured in a "
|
||||||
@@ -284,94 +296,53 @@ def initSequences(controller):
|
|||||||
config['CONFIG_PROVISION_TEMPEST'] != "y"):
|
config['CONFIG_PROVISION_TEMPEST'] != "y"):
|
||||||
return
|
return
|
||||||
|
|
||||||
provision_steps = []
|
provision_steps = [
|
||||||
|
{'title': 'Adding Provisioning manifest entries',
|
||||||
if config['CONFIG_PROVISION_DEMO'] == "y":
|
'functions': [create_provision_manifest]},
|
||||||
provision_steps.append(
|
{'title': 'Adding Provisioning Glance manifest entries',
|
||||||
{'title': 'Adding Provisioning Demo manifest entries',
|
'functions': [create_storage_manifest]},
|
||||||
'functions': [create_demo_manifest]}
|
]
|
||||||
)
|
|
||||||
|
|
||||||
if config['CONFIG_PROVISION_TEMPEST'] == "y":
|
|
||||||
provision_steps.append(
|
|
||||||
{'title': 'Adding Provisioning Tempest manifest entries',
|
|
||||||
'functions': [create_tempest_manifest]}
|
|
||||||
)
|
|
||||||
|
|
||||||
if (config['CONFIG_PROVISION_TEMPEST'] == "y" or
|
if (config['CONFIG_PROVISION_TEMPEST'] == "y" or
|
||||||
config['CONFIG_PROVISION_DEMO'] == "y"):
|
config['CONFIG_PROVISION_DEMO'] == "y"):
|
||||||
provision_steps.append(
|
provision_steps.append(
|
||||||
{'title': 'Adding Provisioning Demo bridge manifest entries',
|
{'title': 'Adding Provisioning Demo bridge manifest entries',
|
||||||
'functions': [create_bridge_manifest]}
|
'functions': [create_bridge_manifest]}
|
||||||
)
|
)
|
||||||
|
if config['CONFIG_PROVISION_TEMPEST'] == "y":
|
||||||
provision_steps.append(
|
provision_steps.append(
|
||||||
{'title': 'Adding Provisioning Glance manifest entries',
|
{'title': 'Adding Provisioning Tempest manifest entries',
|
||||||
'functions': [create_storage_manifest]},
|
'functions': [create_tempest_manifest]}
|
||||||
)
|
)
|
||||||
|
|
||||||
marshall_conf_bool(config, 'CONFIG_PROVISION_TEMPEST')
|
|
||||||
marshall_conf_bool(config, 'CONFIG_PROVISION_OVS_BRIDGE')
|
|
||||||
|
|
||||||
controller.addSequence("Provisioning for Demo and Testing Usage",
|
controller.addSequence("Provisioning for Demo and Testing Usage",
|
||||||
[], [], provision_steps)
|
[], [], provision_steps)
|
||||||
|
|
||||||
|
|
||||||
# ------------------------- helper functions -------------------------
|
|
||||||
|
|
||||||
def marshall_conf_bool(conf, key):
|
|
||||||
if conf[key] == 'y':
|
|
||||||
conf[key] = True
|
|
||||||
else:
|
|
||||||
conf[key] = False
|
|
||||||
|
|
||||||
|
|
||||||
def using_neutron(config):
|
|
||||||
# Using the neutron or nova api servers as the provisioning target
|
|
||||||
# will suffice for the all-in-one case.
|
|
||||||
if config['CONFIG_NEUTRON_INSTALL'] != "y":
|
|
||||||
# The provisioning template requires the name of the external
|
|
||||||
# bridge but the value will be missing if neutron isn't
|
|
||||||
# configured to be installed.
|
|
||||||
config['CONFIG_NEUTRON_L3_EXT_BRIDGE'] = 'br-ex'
|
|
||||||
|
|
||||||
# Set template-specific parameter to configure whether neutron is
|
|
||||||
# available. The value needs to be true/false rather than the y/n.
|
|
||||||
# provided by CONFIG_NEUTRON_INSTALL.
|
|
||||||
config['PROVISION_NEUTRON_AVAILABLE'] = config['CONFIG_NEUTRON_INSTALL']
|
|
||||||
marshall_conf_bool(config, 'PROVISION_NEUTRON_AVAILABLE')
|
|
||||||
|
|
||||||
|
|
||||||
# -------------------------- step functions --------------------------
|
# -------------------------- step functions --------------------------
|
||||||
|
|
||||||
def create_demo_manifest(config, messages):
|
def create_provision_manifest(config, messages):
|
||||||
using_neutron(config)
|
manifest_file = '%s_provision.pp' % config['CONFIG_CONTROLLER_HOST']
|
||||||
manifest_file = '%s_provision_demo.pp' % config['CONFIG_CONTROLLER_HOST']
|
manifest_data = getManifestTemplate("provision")
|
||||||
manifest_data = getManifestTemplate("provision_demo")
|
appendManifestFile(manifest_file, manifest_data, 'provision')
|
||||||
appendManifestFile(manifest_file, manifest_data)
|
|
||||||
|
|
||||||
|
def create_bridge_manifest(config, messages):
|
||||||
|
for host in utils.split_hosts(config['CONFIG_NETWORK_HOSTS']):
|
||||||
|
manifest_file = '{}_provision_bridge.pp'.format(host)
|
||||||
|
manifest_data = getManifestTemplate("provision_bridge")
|
||||||
|
appendManifestFile(manifest_file, manifest_data, 'provision')
|
||||||
|
|
||||||
|
|
||||||
def create_storage_manifest(config, messages):
|
def create_storage_manifest(config, messages):
|
||||||
if config['CONFIG_GLANCE_INSTALL'] == 'y':
|
if config['CONFIG_GLANCE_INSTALL'] == 'y':
|
||||||
if config['CONFIG_PROVISION_TEMPEST']:
|
template = "provision_glance"
|
||||||
template = "provision_tempest_glance"
|
|
||||||
else:
|
|
||||||
template = "provision_demo_glance"
|
|
||||||
manifest_file = '%s_provision_glance' % config['CONFIG_STORAGE_HOST']
|
manifest_file = '%s_provision_glance' % config['CONFIG_STORAGE_HOST']
|
||||||
manifest_data = getManifestTemplate(template)
|
manifest_data = getManifestTemplate(template)
|
||||||
appendManifestFile(manifest_file, manifest_data)
|
appendManifestFile(manifest_file, manifest_data, 'provision')
|
||||||
|
|
||||||
|
|
||||||
def create_bridge_manifest(config, messages):
|
|
||||||
using_neutron(config)
|
|
||||||
for host in utils.split_hosts(config['CONFIG_NETWORK_HOSTS']):
|
|
||||||
manifest_file = '{}_provision_demo_bridge.pp'.format(host)
|
|
||||||
manifest_data = getManifestTemplate("provision_demo_bridge")
|
|
||||||
appendManifestFile(manifest_file, manifest_data, 'demo_bridge')
|
|
||||||
|
|
||||||
|
|
||||||
def create_tempest_manifest(config, messages):
|
def create_tempest_manifest(config, messages):
|
||||||
using_neutron(config)
|
|
||||||
manifest_file = ('%s_provision_tempest.pp' %
|
manifest_file = ('%s_provision_tempest.pp' %
|
||||||
config['CONFIG_CONTROLLER_HOST'])
|
config['CONFIG_TEMPEST_HOST'])
|
||||||
manifest_data = getManifestTemplate("provision_tempest")
|
manifest_data = getManifestTemplate("provision_tempest")
|
||||||
appendManifestFile(manifest_file, manifest_data)
|
appendManifestFile(manifest_file, manifest_data, 'tempest')
|
||||||
|
|||||||
@@ -1,37 +1,48 @@
|
|||||||
## Keystone
|
$provision_demo = str2bool(hiera('CONFIG_PROVISION_DEMO'))
|
||||||
# non admin user
|
$provision_tempest = str2bool(hiera('CONFIG_PROVISION_TEMPEST'))
|
||||||
|
$provision_neutron = str2bool(hiera('CONFIG_NEUTRON_INSTALL'))
|
||||||
|
$heat_available = str2bool(hiera('CONFIG_HEAT_INSTALL'))
|
||||||
|
|
||||||
|
if $provision_demo {
|
||||||
$username = 'demo'
|
$username = 'demo'
|
||||||
$password = hiera('CONFIG_KEYSTONE_DEMO_PW')
|
$password = hiera('CONFIG_KEYSTONE_DEMO_PW')
|
||||||
$tenant_name = 'demo'
|
$tenant_name = 'demo'
|
||||||
# admin user
|
$floating_range = hiera('CONFIG_PROVISION_DEMO_FLOATRANGE')
|
||||||
$admin_username = hiera('CONFIG_KEYSTONE_ADMIN_USERNAME')
|
} elsif $provision_tempest {
|
||||||
$admin_password = hiera('CONFIG_KEYSTONE_ADMIN_PW')
|
$username = hiera('CONFIG_PROVISION_TEMPEST_USER')
|
||||||
|
$password = hiera('CONFIG_PROVISION_TEMPEST_USER_PW')
|
||||||
|
$tenant_name = 'tempest'
|
||||||
|
$floating_range = hiera('CONFIG_PROVISION_TEMPEST_FLOATRANGE')
|
||||||
|
if (empty($tempest_user) or empty($tempest_password)) {
|
||||||
|
fail("Both CONFIG_PROVISION_TEMPEST_USER and
|
||||||
|
CONFIG_PROVISION_TEMPEST_USER_PW need to be configured.")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if $provision_demo or $provision_tempest {
|
||||||
$admin_tenant_name = 'admin'
|
$admin_tenant_name = 'admin'
|
||||||
|
|
||||||
## Neutron
|
## Neutron
|
||||||
$public_network_name = 'public'
|
$public_network_name = 'public'
|
||||||
$public_subnet_name = 'public_subnet'
|
$public_subnet_name = 'public_subnet'
|
||||||
$floating_range = hiera('CONFIG_PROVISION_DEMO_FLOATRANGE')
|
|
||||||
$private_network_name = 'private'
|
$private_network_name = 'private'
|
||||||
$private_subnet_name = 'private_subnet'
|
$private_subnet_name = 'private_subnet'
|
||||||
$fixed_range = '10.0.0.0/24'
|
$fixed_range = '10.0.0.0/24'
|
||||||
$router_name = 'router1'
|
$router_name = 'router1'
|
||||||
$provision_neutron_avail = hiera('PROVISION_NEUTRON_AVAILABLE')
|
|
||||||
|
|
||||||
## Users
|
|
||||||
|
|
||||||
keystone_tenant { $tenant_name:
|
keystone_tenant { $tenant_name:
|
||||||
ensure => present,
|
ensure => present,
|
||||||
enabled => true,
|
enabled => true,
|
||||||
description => 'default tenant',
|
description => 'default tenant',
|
||||||
}
|
}
|
||||||
|
|
||||||
keystone_user { $username:
|
keystone_user { $username:
|
||||||
ensure => present,
|
ensure => present,
|
||||||
enabled => true,
|
enabled => true,
|
||||||
password => $password,
|
password => $password,
|
||||||
}
|
}
|
||||||
|
|
||||||
if hiera('CONFIG_HEAT_INSTALL') == 'y' {
|
if $heat_available {
|
||||||
keystone_user_role { "${username}@${tenant_name}":
|
keystone_user_role { "${username}@${tenant_name}":
|
||||||
ensure => present,
|
ensure => present,
|
||||||
roles => ['_member_', 'heat_stack_owner'],
|
roles => ['_member_', 'heat_stack_owner'],
|
||||||
@@ -44,7 +55,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
## Neutron
|
## Neutron
|
||||||
if $provision_neutron_avail {
|
if $provision_neutron {
|
||||||
$neutron_deps = [Neutron_network[$public_network_name]]
|
$neutron_deps = [Neutron_network[$public_network_name]]
|
||||||
|
|
||||||
neutron_network { $public_network_name:
|
neutron_network { $public_network_name:
|
||||||
@@ -82,3 +93,4 @@
|
|||||||
ensure => present,
|
ensure => present,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
@@ -1,7 +1,14 @@
|
|||||||
|
$provision_neutron_br = str2bool(hiera('CONFIG_NEUTRON_INSTALL'))
|
||||||
|
$setup_ovs_bridge = str2bool(hiera('CONFIG_PROVISION_OVS_BRIDGE'))
|
||||||
|
$public_bridge_name = hiera('CONFIG_NEUTRON_L3_EXT_BRIDGE', 'br-ex')
|
||||||
|
$provision_tempest_br = str2bool(hiera('CONFIG_PROVISION_TEMPEST'))
|
||||||
|
$provision_demo_br = str2bool(hiera('CONFIG_PROVISION_DEMO'))
|
||||||
|
|
||||||
$setup_ovs_bridge = hiera('CONFIG_PROVISION_OVS_BRIDGE')
|
if $provision_demo_br {
|
||||||
$provision_neutron_avail = hiera('PROVISION_NEUTRON_AVAILABLE')
|
$floating_range_br = hiera('CONFIG_PROVISION_DEMO_FLOATRANGE')
|
||||||
$public_bridge_name = hiera('CONFIG_NEUTRON_L3_EXT_BRIDGE')
|
} elsif $provision_tempest_br {
|
||||||
|
$floating_range_br = hiera('CONFIG_PROVISION_TEMPEST_FLOATRANGE')
|
||||||
|
}
|
||||||
|
|
||||||
neutron_config {
|
neutron_config {
|
||||||
'keystone_authtoken/identity_uri': value => hiera('CONFIG_KEYSTONE_ADMIN_URL');
|
'keystone_authtoken/identity_uri': value => hiera('CONFIG_KEYSTONE_ADMIN_URL');
|
||||||
@@ -11,7 +18,7 @@ neutron_config {
|
|||||||
'keystone_authtoken/admin_password': value => hiera('CONFIG_NEUTRON_KS_PW');
|
'keystone_authtoken/admin_password': value => hiera('CONFIG_NEUTRON_KS_PW');
|
||||||
}
|
}
|
||||||
|
|
||||||
if $provision_neutron_avail and $setup_ovs_bridge {
|
if $provision_neutron_br and $setup_ovs_bridge {
|
||||||
Neutron_config<||> -> Neutron_l3_ovs_bridge['demo_bridge']
|
Neutron_config<||> -> Neutron_l3_ovs_bridge['demo_bridge']
|
||||||
neutron_l3_ovs_bridge { 'demo_bridge':
|
neutron_l3_ovs_bridge { 'demo_bridge':
|
||||||
name => $public_bridge_name,
|
name => $public_bridge_name,
|
||||||
@@ -22,7 +29,7 @@ if $provision_neutron_avail and $setup_ovs_bridge {
|
|||||||
firewall { '000 nat':
|
firewall { '000 nat':
|
||||||
chain => 'POSTROUTING',
|
chain => 'POSTROUTING',
|
||||||
jump => 'MASQUERADE',
|
jump => 'MASQUERADE',
|
||||||
source => hiera('CONFIG_PROVISION_DEMO_FLOATRANGE'),
|
source => $floating_range_br,
|
||||||
outiface => $::gateway_device,
|
outiface => $::gateway_device,
|
||||||
table => 'nat',
|
table => 'nat',
|
||||||
proto => 'all',
|
proto => 'all',
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
|
|
||||||
## Images
|
|
||||||
## Glance
|
|
||||||
$image_name = hiera('CONFIG_PROVISION_IMAGE_NAME')
|
|
||||||
$image_source = hiera('CONFIG_PROVISION_IMAGE_URL')
|
|
||||||
$image_ssh_user = hiera('CONFIG_PROVISION_IMAGE_SSH_USER')
|
|
||||||
$image_format = hiera('CONFIG_PROVISION_IMAGE_FORMAT')
|
|
||||||
|
|
||||||
glance_image { $image_name:
|
|
||||||
ensure => present,
|
|
||||||
is_public => 'yes',
|
|
||||||
container_format => 'bare',
|
|
||||||
disk_format => $image_format,
|
|
||||||
source => $image_source,
|
|
||||||
}
|
|
||||||
22
packstack/puppet/templates/provision_glance.pp
Normal file
22
packstack/puppet/templates/provision_glance.pp
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
$image_name = hiera('CONFIG_PROVISION_IMAGE_NAME')
|
||||||
|
$image_source = hiera('CONFIG_PROVISION_IMAGE_URL')
|
||||||
|
$image_format = hiera('CONFIG_PROVISION_IMAGE_FORMAT')
|
||||||
|
|
||||||
|
glance_image { $image_name:
|
||||||
|
ensure => present,
|
||||||
|
is_public => 'yes',
|
||||||
|
container_format => 'bare',
|
||||||
|
disk_format => $image_format,
|
||||||
|
source => $image_source,
|
||||||
|
}
|
||||||
|
|
||||||
|
if str2bool(hiera('CONFIG_PROVISION_TEMPEST')) {
|
||||||
|
$image_name_alt = "${image_name}_alt"
|
||||||
|
glance_image { $image_name_alt:
|
||||||
|
ensure => present,
|
||||||
|
is_public => 'yes',
|
||||||
|
container_format => 'bare',
|
||||||
|
disk_format => $image_format,
|
||||||
|
source => $image_source,
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -57,32 +57,6 @@ if $provision_tempest_user != '' {
|
|||||||
$nova_available = true
|
$nova_available = true
|
||||||
$swift_available = undef
|
$swift_available = undef
|
||||||
|
|
||||||
## Users
|
|
||||||
|
|
||||||
keystone_tenant { $tenant_name:
|
|
||||||
ensure => present,
|
|
||||||
enabled => true,
|
|
||||||
description => 'default tenant',
|
|
||||||
}
|
|
||||||
|
|
||||||
keystone_user { $username:
|
|
||||||
ensure => present,
|
|
||||||
enabled => true,
|
|
||||||
password => $password,
|
|
||||||
}
|
|
||||||
|
|
||||||
if hiera('CONFIG_HEAT_INSTALL') == 'y' {
|
|
||||||
keystone_user_role { "${username}@${tenant_name}":
|
|
||||||
ensure => present,
|
|
||||||
roles => ['_member_', 'heat_stack_owner'],
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
keystone_user_role { "${username}@${tenant_name}":
|
|
||||||
ensure => present,
|
|
||||||
roles => ['_member_'],
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# Support creation of a second glance image
|
# Support creation of a second glance image
|
||||||
# distinct from the first, for tempest. It
|
# distinct from the first, for tempest. It
|
||||||
# doesn't need to be a different image, just
|
# doesn't need to be a different image, just
|
||||||
@@ -107,57 +81,9 @@ if $provision_tempest_user != '' {
|
|||||||
$image_name_alt_real = $image_name
|
$image_name_alt_real = $image_name
|
||||||
}
|
}
|
||||||
|
|
||||||
## Neutron
|
|
||||||
|
|
||||||
if $neutron_available {
|
|
||||||
$neutron_deps = [Neutron_network[$public_network_name]]
|
|
||||||
|
|
||||||
neutron_network { $public_network_name:
|
|
||||||
ensure => present,
|
|
||||||
router_external => true,
|
|
||||||
tenant_name => $admin_tenant_name,
|
|
||||||
}
|
|
||||||
|
|
||||||
neutron_subnet { $public_subnet_name:
|
|
||||||
ensure => 'present',
|
|
||||||
cidr => $floating_range,
|
|
||||||
enable_dhcp => false,
|
|
||||||
network_name => $public_network_name,
|
|
||||||
tenant_name => $admin_tenant_name,
|
|
||||||
}
|
|
||||||
|
|
||||||
neutron_network { $private_network_name:
|
|
||||||
ensure => present,
|
|
||||||
tenant_name => $tenant_name,
|
|
||||||
}
|
|
||||||
|
|
||||||
neutron_subnet { $private_subnet_name:
|
|
||||||
ensure => present,
|
|
||||||
cidr => $fixed_range,
|
|
||||||
network_name => $private_network_name,
|
|
||||||
tenant_name => $tenant_name,
|
|
||||||
}
|
|
||||||
|
|
||||||
# Tenant-owned router - assumes network namespace isolation
|
|
||||||
neutron_router { $router_name:
|
|
||||||
ensure => present,
|
|
||||||
tenant_name => $tenant_name,
|
|
||||||
gateway_network_name => $public_network_name,
|
|
||||||
# A neutron_router resource must explicitly declare a dependency on
|
|
||||||
# the first subnet of the gateway network.
|
|
||||||
require => Neutron_subnet[$public_subnet_name],
|
|
||||||
}
|
|
||||||
|
|
||||||
neutron_router_interface { "${router_name}:${private_subnet_name}":
|
|
||||||
ensure => present,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
## Tempest
|
## Tempest
|
||||||
|
|
||||||
if $configure_tempest {
|
if $configure_tempest {
|
||||||
$tempest_requires = concat([Keystone_user[$username]], $neutron_deps)
|
|
||||||
|
|
||||||
class { '::tempest':
|
class { '::tempest':
|
||||||
tempest_repo_uri => $tempest_repo_uri,
|
tempest_repo_uri => $tempest_repo_uri,
|
||||||
tempest_clone_path => $tempest_clone_path,
|
tempest_clone_path => $tempest_clone_path,
|
||||||
|
|||||||
@@ -1,54 +0,0 @@
|
|||||||
|
|
||||||
## Glance
|
|
||||||
$image_name = hiera('CONFIG_PROVISION_IMAGE_NAME')
|
|
||||||
$image_source = hiera('CONFIG_PROVISION_IMAGE_URL')
|
|
||||||
$image_ssh_user = hiera('CONFIG_PROVISION_IMAGE_SSH_USER')
|
|
||||||
$image_format = hiera('CONFIG_PROVISION_IMAGE_FORMAT')
|
|
||||||
|
|
||||||
## Tempest
|
|
||||||
|
|
||||||
$image_name_alt = false
|
|
||||||
$image_source_alt = false
|
|
||||||
$image_ssh_user_alt = false
|
|
||||||
## Images
|
|
||||||
|
|
||||||
glance_image { $image_name:
|
|
||||||
ensure => present,
|
|
||||||
is_public => 'yes',
|
|
||||||
container_format => 'bare',
|
|
||||||
disk_format => $image_format,
|
|
||||||
source => $image_source,
|
|
||||||
}
|
|
||||||
|
|
||||||
# Support creation of a second glance image
|
|
||||||
# distinct from the first, for tempest. It
|
|
||||||
# doesn't need to be a different image, just
|
|
||||||
# have a different name and ref in glance.
|
|
||||||
if $image_name_alt {
|
|
||||||
$image_name_alt_real = $image_name_alt
|
|
||||||
if ! $image_source_alt {
|
|
||||||
# Use the same source by default
|
|
||||||
$image_source_alt_real = $image_source
|
|
||||||
} else {
|
|
||||||
$image_source_alt_real = $image_source_alt
|
|
||||||
}
|
|
||||||
|
|
||||||
if ! $image_ssh_user_alt {
|
|
||||||
# Use the same user by default
|
|
||||||
$image_alt_ssh_user_real = $image_ssh_user
|
|
||||||
} else {
|
|
||||||
$image_alt_ssh_user_real = $image_ssh_user_alt
|
|
||||||
}
|
|
||||||
|
|
||||||
glance_image { $image_name_alt:
|
|
||||||
ensure => present,
|
|
||||||
is_public => 'yes',
|
|
||||||
container_format => 'bare',
|
|
||||||
disk_format => 'qcow2',
|
|
||||||
source => $image_source_alt_real,
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
$image_name_alt_real = $image_name
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user