X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=overcloud.j2.yaml;h=5c75a66f5e68c118b47d0f4bd3a24cea9b4b33e6;hb=9d67d7b3b11b688be0b40fc2fcfb1daf5b5157df;hp=6ca4a14a1aefbe0d289be8c60d9201ffe82b8716;hpb=0d9298bb8fc9903ff42e3d2402cd44e765f4c822;p=apex-tripleo-heat-templates.git diff --git a/overcloud.j2.yaml b/overcloud.j2.yaml index 6ca4a14a..5c75a66f 100644 --- a/overcloud.j2.yaml +++ b/overcloud.j2.yaml @@ -121,16 +121,12 @@ parameters: resource_registry) which represent nested stacks for each service that should get installed on the {{role.name}} role. type: comma_delimited_list - {% if role.ServicesDefault %} - default: {{role.ServicesDefault}} - {% endif %} + default: {{role.ServicesDefault|default([])}} {{role.name}}Count: description: Number of {{role.name}} nodes to deploy type: number - {% if role.CountDefault %} - default: {{role.CountDefault}} - {% endif %} + default: {{role.CountDefault|default(0)}} {{role.name}}HostnameFormat: type: string @@ -140,6 +136,8 @@ parameters: and %stackname% is replaced with the stack name e.g overcloud {% if role.HostnameFormatDefault %} default: "{{role.HostnameFormatDefault}}" + {% else %} + default: "%stackname%-{{role.name.lower()}}-%index%" {% endif %} {{role.name}}RemovalPolicies: @@ -263,6 +261,21 @@ resources: {% for r in roles %} - get_attr: [{{r.name}}ServiceChain, role_data, global_config_settings] {% endfor %} + # This next step combines two yaql passes: + # - The inner one does a deep merge on the service_config_settings for all roles + # - The outer one filters the map based on the services enabled for the role + # then merges the result into one map. + - yaql: + expression: let(root => $) -> $.data.map.items().where($[0] in $root.data.services).select($[1]).reduce($1.mergeWith($2), {}) + data: + map: + yaql: + expression: $.data.where($ != null).reduce($1.mergeWith($2), {}) + data: + {% for r in roles %} + - get_attr: [{{r.name}}ServiceChain, role_data, service_config_settings] + {% endfor %} + services: {get_attr: [{{role.name}}ServiceChain, role_data, service_names]} ServiceNames: {get_attr: [{{role.name}}ServiceChain, role_data, service_names]} MonitoringSubscriptions: {get_attr: [{{role.name}}ServiceChain, role_data, monitoring_subscriptions]} LoggingSources: {get_attr: [{{role.name}}ServiceChain, role_data, logging_sources]} @@ -444,17 +457,13 @@ resources: type: OS::TripleO::AllNodesExtraConfig depends_on: - UpdateWorkflow - - ComputeAllNodesValidationDeployment - - BlockStorageAllNodesValidationDeployment - - ObjectStorageAllNodesValidationDeployment - - CephStorageAllNodesValidationDeployment - - ControllerAllNodesValidationDeployment +{% for role in roles %} + - {{role.name}}AllNodesValidationDeployment +{% endfor %} properties: - controller_servers: {get_attr: [Controller, attributes, nova_server_resource]} - compute_servers: {get_attr: [Compute, attributes, nova_server_resource]} - blockstorage_servers: {get_attr: [BlockStorage, attributes, nova_server_resource]} - objectstorage_servers: {get_attr: [ObjectStorage, attributes, nova_server_resource]} - cephstorage_servers: {get_attr: [CephStorage, attributes, nova_server_resource]} +{% for role in roles %} + servers: {get_attr: [{{role.name}}, attributes, nova_server_resource]} +{% endfor %} # Post deployment steps for all roles AllNodesDeploySteps: