aboutsummaryrefslogtreecommitdiffstats
path: root/network/ports
diff options
context:
space:
mode:
authorSteven Hardy <shardy@redhat.com>2016-07-29 15:44:36 +0100
committerSteven Hardy <shardy@redhat.com>2016-08-28 10:26:42 +0100
commit2291cdda04d415501e75daaa62ea9c2fdada22f9 (patch)
tree587d8a611ab811c994789f76c7ccf7e0fbe2c12d /network/ports
parent49b7064601a58f9d2861674d97934eea05b04592 (diff)
Create composable mapping between enabled services and role ips
Currently we have a hard-coded list of ips for various services that run on the controller, instead we can dynamically generate that list of per-service ips, initially only for the controller but this approach can be extended so it works for any role. Change-Id: I3c8a946e439539d239ad7281a1395414df0893eb Partially-Implements: blueprint custom-roles
Diffstat (limited to 'network/ports')
-rw-r--r--network/ports/net_ip_list_map.yaml37
1 files changed, 36 insertions, 1 deletions
diff --git a/network/ports/net_ip_list_map.yaml b/network/ports/net_ip_list_map.yaml
index 32272bd6..36f3358e 100644
--- a/network/ports/net_ip_list_map.yaml
+++ b/network/ports/net_ip_list_map.yaml
@@ -1,4 +1,4 @@
-heat_template_version: 2015-04-30
+heat_template_version: 2016-10-14
parameters:
ControlPlaneIpList:
@@ -22,6 +22,12 @@ parameters:
ManagementIpList:
default: []
type: comma_delimited_list
+ EnabledServices:
+ default: []
+ type: comma_delimited_list
+ ServiceNetMap:
+ default: {}
+ type: json
outputs:
net_ip_map:
@@ -36,3 +42,32 @@ outputs:
storage_mgmt: {get_param: StorageMgmtIpList}
tenant: {get_param: TenantIpList}
management: {get_param: ManagementIpList}
+ service_ips:
+ description: >
+ Map of enabled services to a list of their IP addresses
+ value:
+ yaql:
+ # This filters any entries where the value hasn't been substituted for
+ # a list, e.g it's still $service_network. This happens when there is
+ # no network defined for the service in the ServiceNetMap, which is OK
+ # as not all services have to be bound to a network, so we filter them
+ expression: dict($.data.map.items().where(not isString($[1])))
+ data:
+ map:
+ map_replace:
+ - map_replace:
+ - map_merge:
+ repeat:
+ template:
+ SERVICE_node_ips: SERVICE_network
+ for_each:
+ SERVICE: {get_param: EnabledServices}
+ - values: {get_param: ServiceNetMap}
+ - values:
+ ctlplane: {get_param: ControlPlaneIpList}
+ external: {get_param: ExternalIpList}
+ internal_api: {get_param: InternalApiIpList}
+ storage: {get_param: StorageIpList}
+ storage_mgmt: {get_param: StorageMgmtIpList}
+ tenant: {get_param: TenantIpList}
+ management: {get_param: ManagementIpList}