Skip to content
This repository was archived by the owner on Feb 29, 2024. It is now read-only.

Commit 9c1940e

Browse files
committed
Provides a list of per-service ctlplane IPs to the workflows env
Adds in the execution environment of the workflow steps a list of per-service network IPs. This can be used by the workflows to execute actions against the nodes hosting a given service. Change-Id: Id7c735d53f04f6ad848b2f9f1adaa3c84ecd2fcd Implements: blueprint tripleo-ceph-ansible
1 parent 71f1338 commit 9c1940e

File tree

5 files changed

+42
-0
lines changed

5 files changed

+42
-0
lines changed

docker/docker-steps.j2

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ parameters:
3838
description: Mapping of service endpoint -> protocol. Typically set
3939
via parameter_defaults in the resource registry.
4040
type: json
41+
ctlplane_service_ips:
42+
type: json
4143

4244
conditions:
4345
{% for step in range(1, deploy_steps_max) %}
@@ -119,8 +121,14 @@ resources:
119121
actions:
120122
CREATE:
121123
workflow: { get_resource: WorkflowTasks_Step{{step}} }
124+
params:
125+
env:
126+
service_ips: { get_param: ctlplane_service_ips }
122127
UPDATE:
123128
workflow: { get_resource: WorkflowTasks_Step{{step}} }
129+
params:
130+
env:
131+
service_ips: { get_param: ctlplane_service_ips }
124132
always_update: true
125133
# END service_workflow_tasks handling
126134
{% endfor %}

network/ports/net_ip_list_map.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,20 @@ outputs:
133133
SERVICE: {get_attr: [EnabledServicesValue, value]}
134134
- values: {get_param: ServiceNetMap}
135135
- values: {get_attr: [NetIpMapValue, value]}
136+
ctlplane_service_ips:
137+
description: >
138+
Map of enabled services to a list of their ctlplane IP addresses
139+
value:
140+
yaql:
141+
expression: dict($.data.map.items().where(len($[1]) > 0))
142+
data:
143+
map:
144+
map_merge:
145+
repeat:
146+
template:
147+
SERVICE_ctlplane_node_ips: {get_param: ControlPlaneIpList}
148+
for_each:
149+
SERVICE: {get_attr: [EnabledServicesValue, value]}
136150
service_hostnames:
137151
description: >
138152
Map of enabled services to a list of hostnames where they're running

overcloud.j2.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -737,6 +737,18 @@ resources:
737737
{% endfor %}
738738
stack_name: {get_param: 'OS::stack_name'}
739739
EndpointMap: {get_attr: [EndpointMap, endpoint_map]}
740+
ctlplane_service_ips:
741+
# Note (shardy) this somewhat complex yaql may be replaced
742+
# with a map_deep_merge function in ocata. It merges the
743+
# list of maps, but appends to colliding lists when a service
744+
# is deployed on more than one role
745+
yaql:
746+
expression: dict($.data.l.where($ != null).selectMany($.items()).groupBy($[0], $[1], [$[0], $[1].flatten()]))
747+
data:
748+
l:
749+
{% for role in roles %}
750+
- {get_attr: [{{role.name}}IpListMap, ctlplane_service_ips]}
751+
{% endfor %}
740752
role_data:
741753
{% for role in roles %}
742754
{{role.name}}: {get_attr: [{{role.name}}ServiceChainRoleData, value]}

puppet/post.j2.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,7 @@ parameters:
2525
description: >
2626
Setting this to a unique value will re-run any deployment tasks which
2727
perform configuration on a Heat stack-update.
28+
ctlplane_service_ips:
29+
type: json
2830

2931
{% include 'puppet-steps.j2' %}

puppet/puppet-steps.j2

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,14 @@ resources:
133133
actions:
134134
CREATE:
135135
workflow: { get_resource: WorkflowTasks_Step{{step}} }
136+
params:
137+
env:
138+
service_ips: { get_param: ctlplane_service_ips }
136139
UPDATE:
137140
workflow: { get_resource: WorkflowTasks_Step{{step}} }
141+
params:
142+
env:
143+
service_ips: { get_param: ctlplane_service_ips }
138144
always_update: true
139145
{% endfor %}
140146
# END service_workflow_tasks handling

0 commit comments

Comments
 (0)