430158acf2abc6d3b18d198157ece332f5a10c8e
[apex-tripleo-heat-templates.git] / network / ports / net_ip_list_map.yaml
1 heat_template_version: 2016-10-14
2
3 parameters:
4   ControlPlaneIpList:
5     default: []
6     type: comma_delimited_list
7   ExternalIpList:
8     default: []
9     type: comma_delimited_list
10   InternalApiIpList:
11     default: []
12     type: comma_delimited_list
13   StorageIpList:
14     default: []
15     type: comma_delimited_list
16   StorageMgmtIpList:
17     default: []
18     type: comma_delimited_list
19   TenantIpList:
20     default: []
21     type: comma_delimited_list
22   ManagementIpList:
23     default: []
24     type: comma_delimited_list
25   EnabledServices:
26     default: []
27     type: comma_delimited_list
28   ServiceNetMap:
29     default: {}
30     type: json
31   ServiceHostnameList:
32     default: []
33     type: comma_delimited_list
34
35 outputs:
36   net_ip_map:
37     description: >
38       A Hash containing a mapping of network names to assigned lists
39       of IP addresses.
40     value:
41       ctlplane: {get_param: ControlPlaneIpList}
42       external: {get_param: ExternalIpList}
43       internal_api: {get_param: InternalApiIpList}
44       storage: {get_param: StorageIpList}
45       storage_mgmt: {get_param: StorageMgmtIpList}
46       tenant: {get_param: TenantIpList}
47       management: {get_param: ManagementIpList}
48   service_ips:
49     description: >
50       Map of enabled services to a list of their IP addresses
51     value:
52       yaql:
53         # This filters any entries where the value hasn't been substituted for
54         # a list, e.g it's still $service_network.  This happens when there is
55         # no network defined for the service in the ServiceNetMap, which is OK
56         # as not all services have to be bound to a network, so we filter them
57         expression: dict($.data.map.items().where(not isString($[1])))
58         data:
59           map:
60             map_replace:
61               - map_replace:
62                   - map_merge:
63                       repeat:
64                         template:
65                           SERVICE_node_ips: SERVICE_network
66                         for_each:
67                           SERVICE: {get_param: EnabledServices}
68                   - values: {get_param: ServiceNetMap}
69               - values:
70                   ctlplane: {get_param: ControlPlaneIpList}
71                   external: {get_param: ExternalIpList}
72                   internal_api: {get_param: InternalApiIpList}
73                   storage: {get_param: StorageIpList}
74                   storage_mgmt: {get_param: StorageMgmtIpList}
75                   tenant: {get_param: TenantIpList}
76                   management: {get_param: ManagementIpList}
77   service_hostnames:
78     description: >
79       Map of enabled services to a list of hostnames where they're running
80     value:
81       map_merge:
82         repeat:
83           template:
84             SERVICE_node_names: {get_param: ServiceHostnameList}
85           for_each:
86               SERVICE: {get_param: EnabledServices}