Allow defaults for Image/Flavor/RoleParameters in roles_data.yaml
This allows specific roles, e.g ComputeRealTime to specify defaults where the services are the same as some existing roles but a different image and/or configuration are needed. Inspired by discussion of this requirement in: https://review.openstack.org/#/c/531739/ RoleParametersDefaults is merged with the user provided parameters with precendence to user parameters, as this is a special parameter, which contains a map of the actual parameters to be applied to a role. Partially Implements: blueprint tripleo-realtime Change-Id: I6497144340d3b9276e6ed141d3bc655bfbbeb53c
This commit is contained in:
parent
ee371478d7
commit
d006711426
|
@ -386,7 +386,10 @@ resources:
|
|||
EndpointMap: {get_attr: [EndpointMapData, value]}
|
||||
DefaultPasswords: {get_attr: [DefaultPasswords, passwords]}
|
||||
RoleName: {{role.name}}
|
||||
RoleParameters: {get_param: {{role.name}}Parameters}
|
||||
RoleParameters:
|
||||
map_merge:
|
||||
- {{role.RoleParametersDefault|default({})}}
|
||||
- get_param: {{role.name}}Parameters
|
||||
|
||||
# Lookup of role_data via heat outputs is slow, so workaround this by caching
|
||||
# the value in an OS::Heat::Value resource
|
||||
|
@ -564,7 +567,10 @@ resources:
|
|||
LoggingGroups: {get_attr: [{{role.name}}ServiceChainRoleData, value, logging_groups]}
|
||||
ServiceMetadataSettings: {get_attr: [{{role.name}}ServiceChainRoleData, value, service_metadata_settings]}
|
||||
DeploymentServerBlacklistDict: {get_attr: [DeploymentServerBlacklistDict, value]}
|
||||
RoleParameters: {get_param: {{role.name}}Parameters}
|
||||
RoleParameters:
|
||||
map_merge:
|
||||
- {{role.RoleParametersDefault|default({})}}
|
||||
- get_param: {{role.name}}Parameters
|
||||
{% endfor %}
|
||||
|
||||
{% for role in roles %}
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
heat_template_version: queens
|
||||
description: 'OpenStack {{role.name}} node configured by Puppet'
|
||||
parameters:
|
||||
{%- set default_flavor_name = 'baremetal' %}
|
||||
{%- set default_flavor_name = role.FlavorDefault|default('baremetal') %}
|
||||
{%- if role.deprecated_param_flavor is defined %}
|
||||
{{role.deprecated_param_flavor}}:
|
||||
description: DEPRECATED Use Overcloud{{role.name}}Flavor instead.
|
||||
|
@ -20,7 +20,7 @@ parameters:
|
|||
constraints:
|
||||
- custom_constraint: nova.flavor
|
||||
{%- endif %}
|
||||
{%- set default_image_name = 'overcloud-full' %}
|
||||
{%- set default_image_name = role.ImageDefault|default('overcloud-full') %}
|
||||
{%- if role.deprecated_param_image is defined %}
|
||||
{{role.deprecated_param_image}}:
|
||||
type: string
|
||||
|
|
|
@ -34,6 +34,16 @@ Role Options
|
|||
defaults to '%stackname%-{{role.name.lower()}}-%index%'
|
||||
sets the default for {{role.name}}HostnameFormat parameter in overcloud.yaml
|
||||
|
||||
* ImageDefault: (string) optional default image name or ID, defaults to
|
||||
overcloud-full
|
||||
|
||||
* FlavorDefault: (string) optional default flavor name or ID, defaults to
|
||||
baremetal
|
||||
|
||||
* RoleParametersDefault: (map) optional default to the per-role RoleParameters
|
||||
value, this enables roles to specify specific values appropriate to their
|
||||
configuration, defaults to an empty map.
|
||||
|
||||
* disable_constraints: (boolean) optional, whether to disable Nova and Glance
|
||||
constraints for each role specified in the templates.
|
||||
|
||||
|
|
Loading…
Reference in New Issue