c974d72e2ecaacb859fe568fd7adbe0ec20c273e
[apex-tripleo-heat-templates.git] / network / ports / net_ip_map.yaml
1 heat_template_version: ocata
2
3 parameters:
4   ControlPlaneIp:
5     default: ''
6     type: string
7   ControlPlaneSubnetCidr: # Override this via parameter_defaults
8     default: '24'
9     description: The subnet CIDR of the control plane network.
10     type: string
11   ExternalIp:
12     default: ''
13     type: string
14   ExternalIpSubnet:
15     default: ''
16     type: string
17   ExternalIpUri:
18     default: ''
19     type: string
20     description: IP address with brackets in case of IPv6
21   InternalApiIp:
22     default: ''
23     type: string
24   InternalApiIpSubnet:
25     default: ''
26     type: string
27   InternalApiIpUri:
28     default: ''
29     type: string
30     description: IP address with brackets in case of IPv6
31   StorageIp:
32     default: ''
33     type: string
34   StorageIpSubnet:
35     default: ''
36     type: string
37   StorageIpUri:
38     default: ''
39     type: string
40     description: IP address with brackets in case of IPv6
41   StorageMgmtIp:
42     default: ''
43     type: string
44   StorageMgmtIpSubnet:
45     default: ''
46     type: string
47   StorageMgmtIpUri:
48     default: ''
49     type: string
50     description: IP address with brackets in case of IPv6
51   TenantIp:
52     default: ''
53     type: string
54   TenantIpSubnet:
55     default: ''
56     type: string
57   TenantIpUri:
58     default: ''
59     type: string
60     description: IP address with brackets in case of IPv6
61   ManagementIp:
62     default: ''
63     type: string
64   ManagementIpSubnet:
65     default: ''
66     type: string
67   ManagementIpUri:
68     default: ''
69     type: string
70     description: IP address with brackets in case of IPv6
71
72   InternalApiNetName:
73     default: internal_api
74     description: The name of the internal API network.
75     type: string
76   ExternalNetName:
77     default: external
78     description: The name of the external network.
79     type: string
80   ManagementNetName:
81     default: management
82     description: The name of the management network.
83     type: string
84   StorageNetName:
85     default: storage
86     description: The name of the storage network.
87     type: string
88   StorageMgmtNetName:
89     default: storage_mgmt
90     description: The name of the Storage management network.
91     type: string
92   TenantNetName:
93     default: tenant
94     description: The name of the tenant network.
95     type: string
96
97 resources:
98
99   NetIpMapValue:
100     type: OS::Heat::Value
101     properties:
102       type: json
103       value:
104         map_replace:
105           - ctlplane: {get_param: ControlPlaneIp}
106             external: {get_param: ExternalIp}
107             internal_api: {get_param: InternalApiIp}
108             storage: {get_param: StorageIp}
109             storage_mgmt: {get_param: StorageMgmtIp}
110             tenant: {get_param: TenantIp}
111             management: {get_param: ManagementIp}
112             ctlplane_subnet:
113               list_join:
114                 - ''
115                 - - {get_param: ControlPlaneIp}
116                   - '/'
117                   - {get_param: ControlPlaneSubnetCidr}
118             external_subnet: {get_param: ExternalIpSubnet}
119             internal_api_subnet: {get_param: InternalApiIpSubnet}
120             storage_subnet: {get_param: StorageIpSubnet}
121             storage_mgmt_subnet: {get_param: StorageMgmtIpSubnet}
122             tenant_subnet: {get_param: TenantIpSubnet}
123             management_subnet: {get_param: ManagementIpSubnet}
124             ctlplane_uri: {get_param: ControlPlaneIp}
125             external_uri: {get_param: ExternalIpUri}
126             internal_api_uri: {get_param: InternalApiIpUri}
127             storage_uri: {get_param: StorageIpUri}
128             storage_mgmt_uri: {get_param: StorageMgmtIpUri}
129             tenant_uri: {get_param: TenantIpUri}
130             management_uri: {get_param: ManagementIpUri}
131           - keys:
132               external: {get_param: ExternalNetName}
133               internal_api: {get_param: InternalApiNetName}
134               storage: {get_param: StorageNetName}
135               storage_mgmt: {get_param: StorageMgmtNetName}
136               tenant: {get_param: TenantNetName}
137               management: {get_param: ManagementNetName}
138               external_subnet:
139                 str_replace:
140                   template: NAME_subnet
141                   params:
142                     NAME: {get_param: ExternalNetName}
143               internal_api_subnet:
144                 str_replace:
145                   template: NAME_subnet
146                   params:
147                     NAME: {get_param: InternalApiNetName}
148               storage_subnet:
149                 str_replace:
150                   template: NAME_subnet
151                   params:
152                     NAME: {get_param: StorageNetName}
153               storage_mgmt_subnet:
154                 str_replace:
155                   template: NAME_subnet
156                   params:
157                     NAME: {get_param: StorageMgmtNetName}
158               tenant_subnet:
159                 str_replace:
160                   template: NAME_subnet
161                   params:
162                     NAME: {get_param: TenantNetName}
163               management_subnet:
164                 str_replace:
165                   template: NAME_subnet
166                   params:
167                     NAME: {get_param: ManagementNetName}
168               external_uri:
169                 str_replace:
170                   template: NAME_uri
171                   params:
172                     NAME: {get_param: ExternalNetName}
173               internal_api_uri:
174                 str_replace:
175                   template: NAME_uri
176                   params:
177                     NAME: {get_param: InternalApiNetName}
178               storage_uri:
179                 str_replace:
180                   template: NAME_uri
181                   params:
182                     NAME: {get_param: StorageNetName}
183               storage_mgmt_uri:
184                 str_replace:
185                   template: NAME_uri
186                   params:
187                     NAME: {get_param: StorageMgmtNetName}
188               tenant_uri:
189                 str_replace:
190                   template: NAME_uri
191                   params:
192                     NAME: {get_param: TenantNetName}
193               management_uri:
194                 str_replace:
195                   template: NAME_uri
196                   params:
197                     NAME: {get_param: ManagementNetName}
198
199 outputs:
200   net_ip_map:
201     description: >
202       A Hash containing a mapping of network names to assigned IPs
203       for a specific machine.
204     value: {get_attr: [NetIpMapValue, value]}