aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Hardy <shardy@redhat.com>2017-08-23 08:39:18 +0100
committerEmilien Macchi <emilien@redhat.com>2017-08-31 03:55:30 +0000
commitaf7146888bfc8888bf1086d8a23c36d32130ae10 (patch)
treed8fa55f110b684e8a33a7175fc7a7e5989963bf0
parent831fb49f7de6e89b7b7f7640ebef594c0350af82 (diff)
Move deprecated SchedulerHints logic to overcloud.j2.yaml
The changes in puppet/role.role.j2.yaml should have been made to overcloud.j2.yaml, because we don't want the hard-coded reference to the deprecated name in the parent template. Note we need to pass this value from the parent template so the %index% substitution works, which is required for predictable placement via *SchedulerHints Partial-Bug: #1711656 Change-Id: Ided1802daac48d737f53caa7093df814ba101dd0 (cherry picked from commit c6207379db07544240b699ba000537b58d9fb68f)
-rw-r--r--overcloud.j2.yaml37
-rw-r--r--puppet/role.role.j2.yaml15
2 files changed, 29 insertions, 23 deletions
diff --git a/overcloud.j2.yaml b/overcloud.j2.yaml
index 2e398671..2514f809 100644
--- a/overcloud.j2.yaml
+++ b/overcloud.j2.yaml
@@ -188,15 +188,16 @@ parameters:
doing an update which requires removal of specific resources.
Example format ComputeRemovalPolicies: [{'resource_list': ['0']}]
-{% if role.name != 'Compute' %}
{{role.name}}SchedulerHints:
+ type: json
description: Optional scheduler hints to pass to nova
-{% else %}
- NovaComputeSchedulerHints:
- description: DEPRECATED - use ComputeSchedulerHints instead
-{% endif %}
+ default: {}
+{%- if role.deprecated_param_scheduler_hints is defined %}
+ {{role.deprecated_param_scheduler_hints}}:
type: json
+ description: DEPRECATED - use {{role.name}}SchedulerHints instead
default: {}
+{%- endif %}
{{role.name}}Parameters:
type: json
@@ -229,6 +230,19 @@ parameters:
description: >
List of server hostnames to blacklist from any triggered deployments.
+{% for role in roles %}
+{%- if role.deprecated_param_scheduler_hints is defined %}
+{%- if not parameter_groups_defined|default(false) %}
+parameter_groups:
+- label: deprecated
+ description: Do not use deprecated params, they will be removed.
+ parameters:
+{%- set parameter_groups_defined = true %}
+{%- endif %}
+ - {{role.deprecated_param_scheduler_hints}}
+{%- endif %}
+{%- endfor %}
+
conditions:
add_vips_to_etc_hosts: {equals : [{get_param: AddVipsToEtcHosts}, True]}
@@ -525,11 +539,14 @@ resources:
params:
'%stackname%': {get_param: 'OS::stack_name'}
NodeIndex: '%index%'
- {% if role.name != 'Compute' %}
- {{role.name}}SchedulerHints: {get_param: {{role.name}}SchedulerHints}
- {% else %}
- NovaComputeSchedulerHints: {get_param: NovaComputeSchedulerHints}
- {% endif %}
+ # Note, SchedulerHints must be defined here, not only in the
+ # nested template, as it can contain %index%
+ {{role.name}}SchedulerHints:
+ map_merge:
+{%- if role.deprecated_param_scheduler_hints is defined %}
+ - {get_param: {{role.deprecated_param_scheduler_hints}}}
+{%- endif %}
+ - {get_param: {{role.name}}SchedulerHints}
ServiceConfigSettings: {get_attr: [{{role.name}}ServiceConfigSettings, value]}
ServiceNames: {get_attr: [{{role.name}}ServiceNames, value]}
MonitoringSubscriptions: {get_attr: [{{role.name}}ServiceChainRoleData, value, monitoring_subscriptions]}
diff --git a/puppet/role.role.j2.yaml b/puppet/role.role.j2.yaml
index 5453e65c..f58f7409 100644
--- a/puppet/role.role.j2.yaml
+++ b/puppet/role.role.j2.yaml
@@ -148,12 +148,6 @@ parameters:
type: json
description: Optional scheduler hints to pass to nova
default: {}
-{%- if role.deprecated_param_scheduler_hints is defined %}
- {{role.deprecated_param_scheduler_hints}}:
- type: json
- description: DEPRECATED - use {{role.name}}SchedulerHints instead
- default: {}
-{%- endif %}
NodeIndex:
type: number
default: 0
@@ -239,7 +233,7 @@ parameter_groups:
description: Do not use deprecated params, they will be removed.
parameters:
{%- for property in role %}
-{%- if property.startswith('deprecated_param_') %}
+{%- if property.startswith('deprecated_param_') and not role[property].endswith('SchedulerHints') %}
- {{role[property]}}
{%- endif %}
{%- endfor %}
@@ -317,12 +311,7 @@ resources:
{%- endif %}
- {get_param: {{role.name}}ServerMetadata}
- {get_param: ServiceMetadataSettings}
- scheduler_hints:
- map_merge:
-{%- if role.deprecated_param_scheduler_hints is defined %}
- - {get_param: {{role.deprecated_param_scheduler_hints}}}
-{%- endif %}
- - {get_param: {{role.name}}SchedulerHints}
+ scheduler_hints: {get_param: {{role.name}}SchedulerHints}
deployment_swift_data:
if:
- deployment_swift_data_map_unset