X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=overcloud.j2.yaml;h=e2ff4c141da9c15044060062436227c8f0cc2d22;hb=1df8cfedbf558a9623f63c8f6861ef5d3e3bf5fe;hp=ec4db843dc756c457d7019a79b55403c1abf0ffc;hpb=a4c0f2c8ab2853a8861a931ba7b4f9a8aad12a66;p=apex-tripleo-heat-templates.git diff --git a/overcloud.j2.yaml b/overcloud.j2.yaml index ec4db843..e2ff4c14 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,8 +261,25 @@ 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]} + LoggingGroups: {get_attr: [{{role.name}}ServiceChain, role_data, logging_groups]} {% endfor %} allNodesConfig: @@ -428,11 +443,10 @@ resources: UpdateWorkflow: type: OS::TripleO::Tasks::UpdateWorkflow 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]} + servers: +{% for role in roles %} + {{role.name}}: {get_attr: [{{role.name}}, attributes, nova_server_resource]} +{% endfor %} input_values: deploy_identifier: {get_param: DeployIdentifier} update_identifier: {get_param: UpdateIdentifier} @@ -443,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: @@ -541,8 +551,6 @@ outputs: EnabledServices: description: The services enabled on each role value: - Controller: {get_attr: [ControllerServiceChain, role_data, service_names]} - Compute: {get_attr: [ComputeServiceChain, role_data, service_names]} - BlockStorage: {get_attr: [BlockStorageServiceChain, role_data, service_names]} - ObjectStorage: {get_attr: [ObjectStorageServiceChain, role_data, service_names]} - CephStorage: {get_attr: [CephStorageServiceChain, role_data, service_names]} +{% for role in roles %} + {{role.name}}: {get_attr: [{{role.name}}ServiceChain, role_data, service_names]} +{% endfor %}