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
This commit is contained in:
@@ -38,6 +38,8 @@ parameters:
|
|||||||
description: Mapping of service endpoint -> protocol. Typically set
|
description: Mapping of service endpoint -> protocol. Typically set
|
||||||
via parameter_defaults in the resource registry.
|
via parameter_defaults in the resource registry.
|
||||||
type: json
|
type: json
|
||||||
|
ctlplane_service_ips:
|
||||||
|
type: json
|
||||||
|
|
||||||
conditions:
|
conditions:
|
||||||
{% for step in range(1, deploy_steps_max) %}
|
{% for step in range(1, deploy_steps_max) %}
|
||||||
@@ -119,8 +121,14 @@ resources:
|
|||||||
actions:
|
actions:
|
||||||
CREATE:
|
CREATE:
|
||||||
workflow: { get_resource: WorkflowTasks_Step{{step}} }
|
workflow: { get_resource: WorkflowTasks_Step{{step}} }
|
||||||
|
params:
|
||||||
|
env:
|
||||||
|
service_ips: { get_param: ctlplane_service_ips }
|
||||||
UPDATE:
|
UPDATE:
|
||||||
workflow: { get_resource: WorkflowTasks_Step{{step}} }
|
workflow: { get_resource: WorkflowTasks_Step{{step}} }
|
||||||
|
params:
|
||||||
|
env:
|
||||||
|
service_ips: { get_param: ctlplane_service_ips }
|
||||||
always_update: true
|
always_update: true
|
||||||
# END service_workflow_tasks handling
|
# END service_workflow_tasks handling
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
@@ -133,6 +133,20 @@ outputs:
|
|||||||
SERVICE: {get_attr: [EnabledServicesValue, value]}
|
SERVICE: {get_attr: [EnabledServicesValue, value]}
|
||||||
- values: {get_param: ServiceNetMap}
|
- values: {get_param: ServiceNetMap}
|
||||||
- values: {get_attr: [NetIpMapValue, value]}
|
- values: {get_attr: [NetIpMapValue, value]}
|
||||||
|
ctlplane_service_ips:
|
||||||
|
description: >
|
||||||
|
Map of enabled services to a list of their ctlplane IP addresses
|
||||||
|
value:
|
||||||
|
yaql:
|
||||||
|
expression: dict($.data.map.items().where(len($[1]) > 0))
|
||||||
|
data:
|
||||||
|
map:
|
||||||
|
map_merge:
|
||||||
|
repeat:
|
||||||
|
template:
|
||||||
|
SERVICE_ctlplane_node_ips: {get_param: ControlPlaneIpList}
|
||||||
|
for_each:
|
||||||
|
SERVICE: {get_attr: [EnabledServicesValue, value]}
|
||||||
service_hostnames:
|
service_hostnames:
|
||||||
description: >
|
description: >
|
||||||
Map of enabled services to a list of hostnames where they're running
|
Map of enabled services to a list of hostnames where they're running
|
||||||
|
@@ -737,6 +737,18 @@ resources:
|
|||||||
{% endfor %}
|
{% endfor %}
|
||||||
stack_name: {get_param: 'OS::stack_name'}
|
stack_name: {get_param: 'OS::stack_name'}
|
||||||
EndpointMap: {get_attr: [EndpointMap, endpoint_map]}
|
EndpointMap: {get_attr: [EndpointMap, endpoint_map]}
|
||||||
|
ctlplane_service_ips:
|
||||||
|
# Note (shardy) this somewhat complex yaql may be replaced
|
||||||
|
# with a map_deep_merge function in ocata. It merges the
|
||||||
|
# list of maps, but appends to colliding lists when a service
|
||||||
|
# is deployed on more than one role
|
||||||
|
yaql:
|
||||||
|
expression: dict($.data.l.where($ != null).selectMany($.items()).groupBy($[0], $[1], [$[0], $[1].flatten()]))
|
||||||
|
data:
|
||||||
|
l:
|
||||||
|
{% for role in roles %}
|
||||||
|
- {get_attr: [{{role.name}}IpListMap, ctlplane_service_ips]}
|
||||||
|
{% endfor %}
|
||||||
role_data:
|
role_data:
|
||||||
{% for role in roles %}
|
{% for role in roles %}
|
||||||
{{role.name}}: {get_attr: [{{role.name}}ServiceChainRoleData, value]}
|
{{role.name}}: {get_attr: [{{role.name}}ServiceChainRoleData, value]}
|
||||||
|
@@ -25,5 +25,7 @@ parameters:
|
|||||||
description: >
|
description: >
|
||||||
Setting this to a unique value will re-run any deployment tasks which
|
Setting this to a unique value will re-run any deployment tasks which
|
||||||
perform configuration on a Heat stack-update.
|
perform configuration on a Heat stack-update.
|
||||||
|
ctlplane_service_ips:
|
||||||
|
type: json
|
||||||
|
|
||||||
{% include 'puppet-steps.j2' %}
|
{% include 'puppet-steps.j2' %}
|
||||||
|
@@ -133,8 +133,14 @@ resources:
|
|||||||
actions:
|
actions:
|
||||||
CREATE:
|
CREATE:
|
||||||
workflow: { get_resource: WorkflowTasks_Step{{step}} }
|
workflow: { get_resource: WorkflowTasks_Step{{step}} }
|
||||||
|
params:
|
||||||
|
env:
|
||||||
|
service_ips: { get_param: ctlplane_service_ips }
|
||||||
UPDATE:
|
UPDATE:
|
||||||
workflow: { get_resource: WorkflowTasks_Step{{step}} }
|
workflow: { get_resource: WorkflowTasks_Step{{step}} }
|
||||||
|
params:
|
||||||
|
env:
|
||||||
|
service_ips: { get_param: ctlplane_service_ips }
|
||||||
always_update: true
|
always_update: true
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
# END service_workflow_tasks handling
|
# END service_workflow_tasks handling
|
||||||
|
Reference in New Issue
Block a user