aboutsummaryrefslogtreecommitdiffstats
path: root/network/ports/net_ip_list_map.yaml
blob: 36f3358e14d9786a0739dc976757cef1bece7b2e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
heat_template_version: 2016-10-14

parameters:
  ControlPlaneIpList:
    default: []
    type: comma_delimited_list
  ExternalIpList:
    default: []
    type: comma_delimited_list
  InternalApiIpList:
    default: []
    type: comma_delimited_list
  StorageIpList:
    default: []
    type: comma_delimited_list
  StorageMgmtIpList:
    default: []
    type: comma_delimited_list
  TenantIpList:
    default: []
    type: comma_delimited_list
  ManagementIpList:
    default: []
    type: comma_delimited_list
  EnabledServices:
    default: []
    type: comma_delimited_list
  ServiceNetMap:
    default: {}
    type: json

outputs:
  net_ip_map:
    description: >
      A Hash containing a mapping of network names to assigned lists
      of IP addresses.
    value:
      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}
  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}