Add a per service bootstrap node variable
In order to call commands that need to be run on a single node, we create a new per-service variable that will contain the first node of each role containing the service. Change-Id: I03e8685f939e8ae1fcd8b16883b559615042505d Partial-Bug: #1615983
This commit is contained in:
parent
b9cab21630
commit
8d796ea0e4
@ -138,3 +138,20 @@ outputs:
|
|||||||
SERVICE_short_node_names: {get_param: ServiceHostnameList}
|
SERVICE_short_node_names: {get_param: ServiceHostnameList}
|
||||||
for_each:
|
for_each:
|
||||||
SERVICE: {get_attr: [EnabledServicesValue, value]}
|
SERVICE: {get_attr: [EnabledServicesValue, value]}
|
||||||
|
short_service_bootstrap_hostnames:
|
||||||
|
description: >
|
||||||
|
Map of enabled services to a list of hostnames where they're running regardless of the network
|
||||||
|
Used for bootstrap purposes
|
||||||
|
value:
|
||||||
|
yaql:
|
||||||
|
# If ServiceHostnameList is empty the role is deployed with zero nodes
|
||||||
|
# therefore we don't want to add any *_node_names to the map
|
||||||
|
expression: dict($.data.map.items().where(len($[1]) > 0))
|
||||||
|
data:
|
||||||
|
map:
|
||||||
|
map_merge:
|
||||||
|
repeat:
|
||||||
|
template:
|
||||||
|
SERVICE_short_bootstrap_node_name: {get_param: ServiceHostnameList}
|
||||||
|
for_each:
|
||||||
|
SERVICE: {get_attr: [EnabledServicesValue, value]}
|
||||||
|
@ -443,6 +443,14 @@ resources:
|
|||||||
l:
|
l:
|
||||||
{% for role in roles %}
|
{% for role in roles %}
|
||||||
- {get_attr: [{{role.name}}IpListMap, short_service_hostnames]}
|
- {get_attr: [{{role.name}}IpListMap, short_service_hostnames]}
|
||||||
|
{% endfor %}
|
||||||
|
short_service_bootstrap_node:
|
||||||
|
yaql:
|
||||||
|
expression: dict($.data.l.where($ != null).selectMany($.items()).groupBy($[0], $[1], [$[0], $[1].flatten().first()]))
|
||||||
|
data:
|
||||||
|
l:
|
||||||
|
{% for role in roles %}
|
||||||
|
- {get_attr: [{{role.name}}IpListMap, short_service_bootstrap_hostnames]}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
# FIXME(shardy): These require further work to move into service_ips
|
# FIXME(shardy): These require further work to move into service_ips
|
||||||
memcache_node_ips: {get_attr: [ControllerIpListMap, net_ip_map, {get_attr: [ServiceNetMap, service_net_map, MemcachedNetwork]}]}
|
memcache_node_ips: {get_attr: [ControllerIpListMap, net_ip_map, {get_attr: [ServiceNetMap, service_net_map, MemcachedNetwork]}]}
|
||||||
|
@ -28,6 +28,8 @@ parameters:
|
|||||||
type: json
|
type: json
|
||||||
short_service_node_names:
|
short_service_node_names:
|
||||||
type: json
|
type: json
|
||||||
|
short_service_bootstrap_node:
|
||||||
|
type: json
|
||||||
controller_names:
|
controller_names:
|
||||||
type: comma_delimited_list
|
type: comma_delimited_list
|
||||||
memcache_node_ips:
|
memcache_node_ips:
|
||||||
@ -125,6 +127,7 @@ resources:
|
|||||||
- {get_param: service_ips}
|
- {get_param: service_ips}
|
||||||
- {get_param: service_node_names}
|
- {get_param: service_node_names}
|
||||||
- {get_param: short_service_node_names}
|
- {get_param: short_service_node_names}
|
||||||
|
- {get_param: short_service_bootstrap_node}
|
||||||
- controller_node_ips:
|
- controller_node_ips:
|
||||||
list_join:
|
list_join:
|
||||||
- ','
|
- ','
|
||||||
|
Loading…
Reference in New Issue
Block a user