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:

committed by
Saravanan KR

parent
ee371478d7
commit
d006711426
@@ -386,7 +386,10 @@ resources:
|
|||||||
EndpointMap: {get_attr: [EndpointMapData, value]}
|
EndpointMap: {get_attr: [EndpointMapData, value]}
|
||||||
DefaultPasswords: {get_attr: [DefaultPasswords, passwords]}
|
DefaultPasswords: {get_attr: [DefaultPasswords, passwords]}
|
||||||
RoleName: {{role.name}}
|
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
|
# Lookup of role_data via heat outputs is slow, so workaround this by caching
|
||||||
# the value in an OS::Heat::Value resource
|
# the value in an OS::Heat::Value resource
|
||||||
@@ -564,7 +567,10 @@ resources:
|
|||||||
LoggingGroups: {get_attr: [{{role.name}}ServiceChainRoleData, value, logging_groups]}
|
LoggingGroups: {get_attr: [{{role.name}}ServiceChainRoleData, value, logging_groups]}
|
||||||
ServiceMetadataSettings: {get_attr: [{{role.name}}ServiceChainRoleData, value, service_metadata_settings]}
|
ServiceMetadataSettings: {get_attr: [{{role.name}}ServiceChainRoleData, value, service_metadata_settings]}
|
||||||
DeploymentServerBlacklistDict: {get_attr: [DeploymentServerBlacklistDict, value]}
|
DeploymentServerBlacklistDict: {get_attr: [DeploymentServerBlacklistDict, value]}
|
||||||
RoleParameters: {get_param: {{role.name}}Parameters}
|
RoleParameters:
|
||||||
|
map_merge:
|
||||||
|
- {{role.RoleParametersDefault|default({})}}
|
||||||
|
- get_param: {{role.name}}Parameters
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
{% for role in roles %}
|
{% for role in roles %}
|
||||||
|
@@ -5,7 +5,7 @@
|
|||||||
heat_template_version: queens
|
heat_template_version: queens
|
||||||
description: 'OpenStack {{role.name}} node configured by Puppet'
|
description: 'OpenStack {{role.name}} node configured by Puppet'
|
||||||
parameters:
|
parameters:
|
||||||
{%- set default_flavor_name = 'baremetal' %}
|
{%- set default_flavor_name = role.FlavorDefault|default('baremetal') %}
|
||||||
{%- if role.deprecated_param_flavor is defined %}
|
{%- if role.deprecated_param_flavor is defined %}
|
||||||
{{role.deprecated_param_flavor}}:
|
{{role.deprecated_param_flavor}}:
|
||||||
description: DEPRECATED Use Overcloud{{role.name}}Flavor instead.
|
description: DEPRECATED Use Overcloud{{role.name}}Flavor instead.
|
||||||
@@ -20,7 +20,7 @@ parameters:
|
|||||||
constraints:
|
constraints:
|
||||||
- custom_constraint: nova.flavor
|
- custom_constraint: nova.flavor
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
{%- set default_image_name = 'overcloud-full' %}
|
{%- set default_image_name = role.ImageDefault|default('overcloud-full') %}
|
||||||
{%- if role.deprecated_param_image is defined %}
|
{%- if role.deprecated_param_image is defined %}
|
||||||
{{role.deprecated_param_image}}:
|
{{role.deprecated_param_image}}:
|
||||||
type: string
|
type: string
|
||||||
@@ -294,7 +294,7 @@ resources:
|
|||||||
get_param: {{role.name}}Image
|
get_param: {{role.name}}Image
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
image_update_policy: {get_param: ImageUpdatePolicy}
|
image_update_policy: {get_param: ImageUpdatePolicy}
|
||||||
flavor:
|
flavor:
|
||||||
{%- if role.deprecated_param_flavor is defined %}
|
{%- if role.deprecated_param_flavor is defined %}
|
||||||
if:
|
if:
|
||||||
- deprecated_param_flavor_set
|
- deprecated_param_flavor_set
|
||||||
|
@@ -34,6 +34,16 @@ Role Options
|
|||||||
defaults to '%stackname%-{{role.name.lower()}}-%index%'
|
defaults to '%stackname%-{{role.name.lower()}}-%index%'
|
||||||
sets the default for {{role.name}}HostnameFormat parameter in overcloud.yaml
|
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
|
* disable_constraints: (boolean) optional, whether to disable Nova and Glance
|
||||||
constraints for each role specified in the templates.
|
constraints for each role specified in the templates.
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user